Class: Apical::JsonContentType
- Inherits:
-
ContentType
- Object
- ContentType
- Apical::JsonContentType
- Defined in:
- lib/apical/content_types.rb
Instance Method Summary collapse
Methods inherited from ContentType
Instance Method Details
#generate(obj) ⇒ Object
28 29 30 |
# File 'lib/apical/content_types.rb', line 28 def generate(obj) JSON.pretty_generate(obj) end |
#header ⇒ Object
24 25 26 |
# File 'lib/apical/content_types.rb', line 24 def header 'application/json' end |
#parse(str) ⇒ Object
32 33 34 |
# File 'lib/apical/content_types.rb', line 32 def parse(str) JSON.parse(str) end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/apical/content_types.rb', line 36 def to_s 'json' end |