Class: DataFormatter::ArrayCollection
Constant Summary
collapse
- Limit =
1000
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
9
10
11
|
# File 'lib/data_formatter/array_collection.rb', line 9
def close
@close ||= Tag.new(css_class: "bracket", content: "]")
end
|
#open ⇒ Object
5
6
7
|
# File 'lib/data_formatter/array_collection.rb', line 5
def open
@open ||= Tag.new(css_class: "bracket", content: "[")
end
|
#prepare(data) ⇒ Object
13
14
15
|
# File 'lib/data_formatter/array_collection.rb', line 13
def prepare(data)
data.first(Limit).map { |v| Value.new(data: v, indentation: indentation, lang: lang) }
end
|