class DataFormatter::HashCollection
Public Instance Methods
close()
click to toggle source
# File lib/data_formatter/hash_collection.rb, line 8 def close @close ||= Tag.new(css_class: "curly-bracket", content: "}") end
open()
click to toggle source
# File lib/data_formatter/hash_collection.rb, line 4 def open @open ||= Tag.new(css_class: "curly-bracket", content: "{") end
prepare(data)
click to toggle source
# 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