Class: Card::Format::JsonFormat

Inherits:
DataFormat show all
Defined in:
lib/card/format/json_format.rb

Instance Method Summary collapse

Instance Method Details

#expand_stubs(content) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/card/format/json_format.rb', line 12

def expand_stubs content
  case content
  when Hash
    content.each { |k, v| content[k] = expand_stubs v }
  when Array
    content.map { |item| expand_stubs item }
  else
    super
  end
end

#mime_typeObject



8
9
10
# File 'lib/card/format/json_format.rb', line 8

def mime_type
  "text/json"
end