Module: Slash::Formats

Defined in:
lib/slash/json.rb,
lib/slash/formats.rb,
lib/slash/peanuts.rb

Defined Under Namespace

Classes: Format, JSON, PeanutsXML, WithSuffix

Class Method Summary collapse

Class Method Details

.json(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/slash/formats.rb', line 10

def self.json(options = {})
  options = {:mime => 'application/json'}.update(options)
  options[:codec] ||= JSON
  Format.new(options)
end

.xml(options = {}) ⇒ Object



6
7
8
# File 'lib/slash/formats.rb', line 6

def self.xml(options = {})
  Format.new({:mime => 'application/xml'}.update(options))
end