Class: TapRep::Client
- Inherits:
-
Struct
- Object
- Struct
- TapRep::Client
- Defined in:
- lib/client.rb
Overview
rubocop:disable Metrics/BlockLength
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
-
#stream ⇒ Object
Returns the value of attribute stream.
-
#token ⇒ Object
Returns the value of attribute token.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Client
constructor
A new instance of Client.
- #output(hash) ⇒ Object
- #process(model) ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ Client
Returns a new instance of Client.
15 16 17 |
# File 'lib/client.rb', line 15 def initialize(**kwargs) super(*members.map { |k| kwargs[k] }) end |
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state
14 15 16 |
# File 'lib/client.rb', line 14 def state @state end |
#stream ⇒ Object
Returns the value of attribute stream
14 15 16 |
# File 'lib/client.rb', line 14 def stream @stream end |
#token ⇒ Object
Returns the value of attribute token
14 15 16 |
# File 'lib/client.rb', line 14 def token @token end |
#verbose ⇒ Object
Returns the value of attribute verbose
14 15 16 |
# File 'lib/client.rb', line 14 def verbose @verbose end |
Instance Method Details
#output(hash) ⇒ Object
28 29 30 |
# File 'lib/client.rb', line 28 def output(hash) stream.puts JSON.generate(hash) end |
#process(model) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/client.rb', line 19 def process(model) records = get(model) return unless records.any? output_records model, records output_state model, records.last['end_time'] process model end |