Class: Skyfall::Jetstream
Defined Under Namespace
Classes: AccountMessage, CommitMessage, IdentityMessage, Message, Operation, UnknownMessage
Constant Summary
Constants inherited from Stream
Stream::EVENTS, Stream::MAX_RECONNECT_INTERVAL
Instance Attribute Summary collapse
-
#cursor ⇒ Object
Returns the value of attribute cursor.
Attributes inherited from Stream
#auto_reconnect, #check_heartbeat, #heartbeat_interval, #heartbeat_timeout, #last_update, #user_agent
Class Method Summary collapse
Instance Method Summary collapse
- #handle_message(msg) ⇒ Object
-
#initialize(server, params = {}) ⇒ Jetstream
constructor
A new instance of Jetstream.
Methods inherited from Stream
#connect, #default_user_agent, #disconnect, #inspect, #inspectable_variables, #reconnect, #start_heartbeat_timer, #stop_heartbeat_timer, #version_string
Constructor Details
#initialize(server, params = {}) ⇒ Jetstream
Returns a new instance of Jetstream.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/skyfall/jetstream.rb', line 18 def initialize(server, params = {}) require_relative 'jetstream/message' super(server) @root_url = @root_url.chomp('/') if URI(@root_url).path != '' raise ArgumentError, "Server parameter should not include any path" end @params = check_params(params) @cursor = @params.delete(:cursor) end |
Instance Attribute Details
#cursor ⇒ Object
Returns the value of attribute cursor.
16 17 18 |
# File 'lib/skyfall/jetstream.rb', line 16 def cursor @cursor end |
Class Method Details
.new(server, params = {}) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/skyfall/jetstream.rb', line 9 def self.new(server, params = {}) # to be removed in 0.6 instance = self.allocate instance.send(:initialize, server, params) instance end |