Class: CollectionJSON::QueryBuilder
- Inherits:
-
Object
- Object
- CollectionJSON::QueryBuilder
- Defined in:
- lib/collection-json/builder.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #add_data(name, params = {}) ⇒ Object
-
#initialize(data) ⇒ QueryBuilder
constructor
A new instance of QueryBuilder.
Constructor Details
#initialize(data) ⇒ QueryBuilder
Returns a new instance of QueryBuilder.
73 74 75 |
# File 'lib/collection-json/builder.rb', line 73 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
71 72 73 |
# File 'lib/collection-json/builder.rb', line 71 def data @data end |
Instance Method Details
#add_data(name, params = {}) ⇒ Object
77 78 79 80 |
# File 'lib/collection-json/builder.rb', line 77 def add_data(name, params = {}) params.merge!({'name' => name}) data << params end |