Class: Shikibu::Channels::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/shikibu/channels.rb

Overview

Subscription info

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#channelObject (readonly)

Returns the value of attribute channel.



66
67
68
# File 'lib/shikibu/channels.rb', line 66

def channel
  @channel
end

#modeObject (readonly)

Returns the value of attribute mode.



66
67
68
# File 'lib/shikibu/channels.rb', line 66

def mode
  @mode
end

#subscribed_atObject (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

Returns:

  • (Boolean)


74
75
76
# File 'lib/shikibu/channels.rb', line 74

def broadcast?
  @mode == ChannelMode::BROADCAST
end

#competing?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/shikibu/channels.rb', line 78

def competing?
  @mode == ChannelMode::COMPETING
end

#direct?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/shikibu/channels.rb', line 82

def direct?
  @mode == ChannelMode::DIRECT
end