Module: Card::Set::All::Csv::CsvFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb
Instance Method Summary collapse
-
#default_item_view ⇒ Object
-
#default_nest_view ⇒ Object
-
#nests ⇒ Object
-
#show(view, args) ⇒ Object
-
#view: body ⇒ Object
-
#view: header ⇒ Object
localize.
-
#view: row ⇒ Object
-
#view: titled ⇒ Object
-
#view: unknown ⇒ Object
Instance Method Details
#default_item_view ⇒ Object
24 25 26 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 24 def default_item_view :name end |
#default_nest_view ⇒ Object
20 21 22 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 20 def default_nest_view :titled end |
#nests ⇒ Object
16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 16 def nests [["_self", { view: :name }], ["_self", { view: :type }]] end |
#show(view, args) ⇒ Object
11 12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 11 def show view, args view ||= :titled super view, args end |
#view: body ⇒ Object
33 34 35 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 33 view :body do item_cards.map { |item_card| nest item_card } end |
#view: header ⇒ Object
localize
42 43 44 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 42 view :header do [%w[Name Type]] end |
#view: row ⇒ Object
37 38 39 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 37 view :row do nests.map { |nest_args| nest(*nest_args) } end |
#view: titled ⇒ Object
28 29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 28 view :titled do voo.items[:view] ||= :row (render_header + render_body).map { |row| CSV.generate_line row }.join end |
#view: unknown ⇒ Object
46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/csv.rb', line 46 view :unknown do "" end |