Class: FullCircle::ResponseParser

Inherits:
Object
  • Object
show all
Defined in:
lib/full_circle/response_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_method_name, object_name) ⇒ ResponseParser

Returns a new instance of ResponseParser.



6
7
8
9
# File 'lib/full_circle/response_parser.rb', line 6

def initialize(api_method_name, object_name)
  @api_method_name= api_method_name
  @object_name = object_name
end

Instance Attribute Details

#api_method_nameObject (readonly)

Returns the value of attribute api_method_name.



4
5
6
# File 'lib/full_circle/response_parser.rb', line 4

def api_method_name
  @api_method_name
end

#object_nameObject (readonly)

Returns the value of attribute object_name.



4
5
6
# File 'lib/full_circle/response_parser.rb', line 4

def object_name
  @object_name
end

Instance Method Details

#parse(response) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/full_circle/response_parser.rb', line 11

def parse(response)
  if response
    attrs = response.parsed_response

    parse_response(attrs, response_name, object_name)
  end
end