class Alegra::Response
Attributes
body[R]
formatter[R]
Public Class Methods
new(body, formatter_class_name='UnderscoreFormatter')
click to toggle source
# File lib/alegra/response.rb, line 6 def initialize(body, formatter_class_name='UnderscoreFormatter') @body = JSON.parse(body) @formatter = Object.const_get("Alegra::Formatters::#{ formatter_class_name }").new end
Public Instance Methods
call(options={})
click to toggle source
# File lib/alegra/response.rb, line 11 def call(options={}) if options[:none] JSON.parse(body) else formatter.call(content: body) end end