Class: CollectionJson::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/collection_json/template.rb

Instance Method Summary collapse

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_jsonObject



12
13
14
# File 'lib/collection_json/template.rb', line 12

def to_json
  @attributes.map{|a| {name: a, value: ""}}.to_json
end