Class: Databound::Data
- Inherits:
-
Object
- Object
- Databound::Data
- Defined in:
- lib/databound/data.rb
Instance Method Summary collapse
-
#initialize(controller, json, model) ⇒ Data
constructor
A new instance of Data.
- #records ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(controller, json, model) ⇒ Data
Returns a new instance of Data.
3 4 5 6 7 8 9 10 |
# File 'lib/databound/data.rb', line 3 def initialize(controller, json, model) return unless json @controller = controller @json = json @data = interpolated_params @model = model end |
Instance Method Details
#records ⇒ Object
12 13 14 |
# File 'lib/databound/data.rb', line 12 def records @model.where(@data) end |
#to_h ⇒ Object
16 17 18 |
# File 'lib/databound/data.rb', line 16 def to_h @data || {} end |