Class: RenderSync::Channel
- Inherits:
-
Object
- Object
- RenderSync::Channel
- Defined in:
- lib/render_sync/channel.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Channel
constructor
A new instance of Channel.
- #signature ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/render_sync/channel.rb', line 5 def name @name end |
Instance Method Details
#signature ⇒ Object
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_s ⇒ Object
19 20 21 |
# File 'lib/render_sync/channel.rb', line 19 def to_s RenderSync.client.normalize_channel(self.signature) end |