Class: Shikibu::Channels::Subscription
- Inherits:
-
Object
- Object
- Shikibu::Channels::Subscription
- Defined in:
- lib/shikibu/channels.rb
Overview
Subscription info
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#subscribed_at ⇒ Object
readonly
Returns the value of attribute subscribed_at.
Instance Method Summary collapse
- #broadcast? ⇒ Boolean
- #competing? ⇒ Boolean
- #direct? ⇒ Boolean
-
#initialize(channel:, mode:, subscribed_at: nil) ⇒ Subscription
constructor
A new instance of Subscription.
Constructor Details
#initialize(channel:, mode:, subscribed_at: nil) ⇒ Subscription
Returns a new instance of Subscription.
68 69 70 71 72 |
# File 'lib/shikibu/channels.rb', line 68 def initialize(channel:, mode:, subscribed_at: nil) @channel = channel @mode = mode.to_s @subscribed_at = subscribed_at || Time.now end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
66 67 68 |
# File 'lib/shikibu/channels.rb', line 66 def channel @channel end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
66 67 68 |
# File 'lib/shikibu/channels.rb', line 66 def mode @mode end |
#subscribed_at ⇒ Object (readonly)
Returns the value of attribute subscribed_at.
66 67 68 |
# File 'lib/shikibu/channels.rb', line 66 def subscribed_at @subscribed_at end |
Instance Method Details
#broadcast? ⇒ Boolean
74 75 76 |
# File 'lib/shikibu/channels.rb', line 74 def broadcast? @mode == ChannelMode::BROADCAST end |
#competing? ⇒ Boolean
78 79 80 |
# File 'lib/shikibu/channels.rb', line 78 def competing? @mode == ChannelMode::COMPETING end |
#direct? ⇒ Boolean
82 83 84 |
# File 'lib/shikibu/channels.rb', line 82 def direct? @mode == ChannelMode::DIRECT end |