Class: Resourceful::Resource::Json

Inherits:
Format
  • Object
show all
Defined in:
lib/resourceful/resource/format.rb

Constant Summary

Constants inherited from Format

Format::SUPPORTED

Class Method Summary collapse

Methods inherited from Format

get, json, xml

Class Method Details

.build(json_str) ⇒ Object



58
59
60
61
62
# File 'lib/resourceful/resource/format.rb', line 58

def build(json_str)
  parsable?(json_str) do
    JSON.parse(json_str.to_s.strip)
  end
end

.to_sObject



54
55
56
# File 'lib/resourceful/resource/format.rb', line 54

def to_s
  "json"
end