Class: Urifetch::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, strategy_key, data) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
# File 'lib/urifetch/response.rb', line 7

def initialize(status,strategy_key,data)
  @status         = status
  @strategy_key   = strategy_key
  @data           = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#strategy_keyObject

Returns the value of attribute strategy_key.



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

def strategy_key
  @strategy_key
end

Instance Method Details

#to_hObject



13
14
15
# File 'lib/urifetch/response.rb', line 13

def to_h
  @data
end

#to_jsonObject



17
18
19
# File 'lib/urifetch/response.rb', line 17

def to_json
  to_h.to_json
end