Class: Ucb::Hcm::Response
- Inherits:
-
Object
- Object
- Ucb::Hcm::Response
- Extended by:
- Forwardable
- Defined in:
- lib/ucb/hcm/response.rb
Instance Attribute Summary collapse
-
#data_fetcher ⇒ Object
Returns the value of attribute data_fetcher.
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
- #response ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(raw_response) ⇒ Response
Returns a new instance of Response.
10 11 12 |
# File 'lib/ucb/hcm/response.rb', line 10 def initialize(raw_response) @raw_response = raw_response end |
Instance Attribute Details
#data_fetcher ⇒ Object
Returns the value of attribute data_fetcher.
6 7 8 |
# File 'lib/ucb/hcm/response.rb', line 6 def data_fetcher @data_fetcher end |
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
6 7 8 |
# File 'lib/ucb/hcm/response.rb', line 6 def raw_response @raw_response end |
Instance Method Details
#data ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/ucb/hcm/response.rb', line 22 def data if raw_response["response"]&.count == 1 raw_response["response"]&.first else raw_response["response"] end end |
#response ⇒ Object
14 15 16 |
# File 'lib/ucb/hcm/response.rb', line 14 def response raw_response end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/ucb/hcm/response.rb', line 18 def success? code == 200 end |