Class: Card::Format::JsonFormat
- Inherits:
-
DataFormat
- Object
- Card::Format
- DataFormat
- Card::Format::JsonFormat
- Defined in:
- lib/card/format/json_format.rb
Overview
card format class for json (JavaScript Object Notation) views
Instance Method Summary collapse
Instance Method Details
#expand_stubs(content) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/card/format/json_format.rb', line 13 def content case content when Hash content.each { |k, v| content[k] = v } when Array content.map { |item| item } else super end end |
#mime_type ⇒ Object
9 10 11 |
# File 'lib/card/format/json_format.rb', line 9 def mime_type "text/json" end |