class IronBank::Collection
Collection
class which allows records reloadable from the source
Public Class Methods
new(klass, conditions, records)
click to toggle source
# File lib/iron_bank/collection.rb, line 17 def initialize(klass, conditions, records) @klass = klass @conditions = conditions @records = records end
Public Instance Methods
reload()
click to toggle source
Update records from source
# File lib/iron_bank/collection.rb, line 24 def reload @records = @klass.where(@conditions) end
to_a()
click to toggle source
In case you need to access all array methods
# File lib/iron_bank/collection.rb, line 29 def to_a @records end