Class: CollectionJson::Template
- Inherits:
-
Object
- Object
- CollectionJson::Template
- Defined in:
- lib/collection_json/template.rb
Instance Method Summary collapse
-
#initialize(*attributes) ⇒ Template
constructor
A new instance of Template.
- #to_json ⇒ Object
Constructor Details
#initialize(*attributes) ⇒ Template
Returns a new instance of Template.
8 9 10 |
# File 'lib/collection_json/template.rb', line 8 def initialize *attributes @attributes = attributes end |
Instance Method Details
#to_json ⇒ Object
12 13 14 |
# File 'lib/collection_json/template.rb', line 12 def to_json @attributes.map{|a| {name: a, value: ""}}.to_json end |