Class: LadyGaga::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/lady_gaga/response.rb', line 6

def initialize(response)
  @response = response
end

Instance Method Details

#bodyObject



10
11
12
# File 'lib/lady_gaga/response.rb', line 10

def body
  response.body
end

#codeObject



18
19
20
# File 'lib/lady_gaga/response.rb', line 18

def code
  response.code
end

#to_hObject



14
15
16
# File 'lib/lady_gaga/response.rb', line 14

def to_h
  response.to_hash
end

#valid?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/lady_gaga/response.rb', line 22

def valid?
  code == 200
end

#xmlObject



26
27
28
# File 'lib/lady_gaga/response.rb', line 26

def xml
  @xml ||= Nokogiri::XML(body)
end