Class: Slash::Formats::JSON

Inherits:
Object
  • Object
show all
Defined in:
lib/slash/json.rb

Instance Method Summary collapse

Instance Method Details

#decode(data) ⇒ Object



11
12
13
# File 'lib/slash/json.rb', line 11

def decode(data)
  ::JSON.parse(data.read)
end

#encode(data) ⇒ Object



7
8
9
# File 'lib/slash/json.rb', line 7

def encode(data)
  ::JSON.generate(data)
end