Class: Pakyow::Realtime::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/realtime/channel.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel_name, qualifier = nil) ⇒ Channel

Returns a new instance of Channel.



14
15
16
# File 'lib/pakyow/realtime/channel.rb', line 14

def initialize(channel_name, qualifier = nil)
  @name, @qualifier = channel_name, qualifier
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/pakyow/realtime/channel.rb', line 12

def name
  @name
end

#qualifierObject (readonly)

Returns the value of attribute qualifier.



12
13
14
# File 'lib/pakyow/realtime/channel.rb', line 12

def qualifier
  @qualifier
end

Class Method Details

.parse(qualified_channel) ⇒ Object



7
8
9
# File 'lib/pakyow/realtime/channel.rb', line 7

def parse(qualified_channel)
  Channel.new(*qualified_channel.split("::", 2))
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/pakyow/realtime/channel.rb', line 18

def to_s
  [@name, @qualifier].join("::")
end