Class: Privat24Api::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/privat24_api/response/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Response

Returns a new instance of Response.



7
8
9
# File 'lib/privat24_api/response/response.rb', line 7

def initialize(body)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/privat24_api/response/response.rb', line 5

def body
  @body
end

Instance Method Details

#to_hashObject



11
12
13
# File 'lib/privat24_api/response/response.rb', line 11

def to_hash
  Hash.from_xml(body)
end

#to_jsonObject



15
16
17
# File 'lib/privat24_api/response/response.rb', line 15

def to_json
  Hash.from_xml(body).to_json
end

#to_xmlObject



19
20
21
# File 'lib/privat24_api/response/response.rb', line 19

def to_xml
  body
end