Class: RenderSync::Channel

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Channel

Returns a new instance of Channel.



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

def initialize(name)
  self.name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/render_sync/channel.rb', line 5

def name
  @name
end

Instance Method Details

#signatureObject



11
12
13
14
15
16
17
# File 'lib/render_sync/channel.rb', line 11

def signature
  OpenSSL::HMAC.hexdigest(
    OpenSSL::Digest.new('sha1'),
    RenderSync.auth_token,
    self.name
  )
end

#to_sObject



19
20
21
# File 'lib/render_sync/channel.rb', line 19

def to_s
  RenderSync.client.normalize_channel(self.signature)
end