Class: Neh::Cli::O
- Inherits:
-
Object
- Object
- Neh::Cli::O
- Defined in:
- lib/neh/cli/o.rb
Overview
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(*args, options:) ⇒ O
constructor
A new instance of O.
Constructor Details
#initialize(*args, options:) ⇒ O
Returns a new instance of O.
16 17 18 19 20 21 22 |
# File 'lib/neh/cli/o.rb', line 16 def initialize(*args, options:) @message = args.join(' ') @options = @message_pool = {} @expected_sequence_number = 1 @uuid = SecureRandom.uuid end |
Instance Attribute Details
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
14 15 16 |
# File 'lib/neh/cli/o.rb', line 14 def uuid @uuid end |
Instance Method Details
#execute ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/neh/cli/o.rb', line 24 def execute Async::WebSocket::Client.connect(endpoint, headers: { 'Authorization' => "Bearer #{token}" }) do |connection| while ( = connection.read) = JSON.parse(, symbolize_names: true) on_receive(connection, ) end end end |