Module: Supermarket::Formats

Defined in:
lib/supermarket/formats.rb

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



20
21
22
# File 'lib/supermarket/formats.rb', line 20

def to_html
  HtmlFormat.printToString(self)
end

#to_json(*a) ⇒ Object



12
13
14
# File 'lib/supermarket/formats.rb', line 12

def to_json(*a)
  JsonFormat.printToString(self)
end

#to_rubyObject



24
25
26
27
# File 'lib/supermarket/formats.rb', line 24

def to_ruby
  require 'json'
  JSON.parse(to_json)
end

#to_xmlObject



16
17
18
# File 'lib/supermarket/formats.rb', line 16

def to_xml
  XmlFormat.printToString(self)
end