Class: DataFormatter::HashCollection
Instance Attribute Summary
Attributes inherited from Collection
#indentation, #items, #lang
Instance Method Summary
collapse
Methods inherited from Collection
#initialize, #to_s
Instance Method Details
#close ⇒ Object
8
9
10
|
# File 'lib/data_formatter/hash_collection.rb', line 8
def close
@close ||= Tag.new(css_class: "curly-bracket", content: "}")
end
|
#open ⇒ Object
4
5
6
|
# File 'lib/data_formatter/hash_collection.rb', line 4
def open
@open ||= Tag.new(css_class: "curly-bracket", content: "{")
end
|
#prepare(data) ⇒ Object
12
13
14
|
# File 'lib/data_formatter/hash_collection.rb', line 12
def prepare(data)
data.map { |k, v| ValuePair.new(key: Value.new(data: k, indentation: indentation, is_key: true), value: Value.new(data: v, indentation: indentation, lang: lang), lang: lang) }
end
|