Class: LabClient::LabStruct
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- LabClient::LabStruct
- Includes:
- CurlHelper
- Defined in:
- lib/labclient/lab_struct.rb
Overview
Unique inherited class to not override top level openstruct
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #as_json(*args) ⇒ Object
- #client ⇒ Object
- #inspect ⇒ Object
- #keys ⇒ Object
- #slice(*opts) ⇒ Object
-
#success? ⇒ Boolean
Forward response success.
Methods included from CurlHelper
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/labclient/lab_struct.rb', line 6 def response @response end |
Instance Method Details
#as_json(*args) ⇒ Object
16 17 18 |
# File 'lib/labclient/lab_struct.rb', line 16 def as_json(*args) super.as_json['table'] end |
#client ⇒ Object
24 25 26 |
# File 'lib/labclient/lab_struct.rb', line 24 def client response.client end |
#inspect ⇒ Object
12 13 14 |
# File 'lib/labclient/lab_struct.rb', line 12 def inspect to_h.inspect end |
#keys ⇒ Object
8 9 10 |
# File 'lib/labclient/lab_struct.rb', line 8 def keys to_h.keys.sort end |
#slice(*opts) ⇒ Object
20 21 22 |
# File 'lib/labclient/lab_struct.rb', line 20 def slice(*opts) to_h.slice(*opts) end |
#success? ⇒ Boolean
Forward response success
29 30 31 |
# File 'lib/labclient/lab_struct.rb', line 29 def success? @response.success? end |