Class: LabClient::LabStruct

Inherits:
OpenStruct
  • Object
show all
Includes:
CurlHelper
Defined in:
lib/labclient/lab_struct.rb

Overview

Unique inherited class to not override top level openstruct

Direct Known Subclasses

Klass

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CurlHelper

#curl

Instance Attribute Details

#responseObject (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

#clientObject



24
25
26
# File 'lib/labclient/lab_struct.rb', line 24

def client
  response.client
end

#inspectObject



12
13
14
# File 'lib/labclient/lab_struct.rb', line 12

def inspect
  to_h.inspect
end

#keysObject



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

Returns:

  • (Boolean)


29
30
31
# File 'lib/labclient/lab_struct.rb', line 29

def success?
  @response.success?
end