Class: Octospy::Recordable::Channel
- Inherits:
-
Object
- Object
- Octospy::Recordable::Channel
- Defined in:
- lib/octospy/recordable/channel.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_repo(name) ⇒ Object
-
#initialize(name) ⇒ Channel
constructor
A new instance of Channel.
- #remove_repo(name) ⇒ Object
- #repos ⇒ Object
Constructor Details
#initialize(name) ⇒ Channel
Returns a new instance of Channel.
6 7 8 |
# File 'lib/octospy/recordable/channel.rb', line 6 def initialize(name) @name = name.to_sym end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/octospy/recordable/channel.rb', line 4 def name @name end |
Instance Method Details
#add_repo(name) ⇒ Object
14 15 16 |
# File 'lib/octospy/recordable/channel.rb', line 14 def add_repo(name) @repos << name if repos.empty? || !repos.include?(name) end |
#remove_repo(name) ⇒ Object
18 19 20 |
# File 'lib/octospy/recordable/channel.rb', line 18 def remove_repo(name) @repos.delete(name.to_sym) if !repos.empty? && repos.include?(name) end |
#repos ⇒ Object
10 11 12 |
# File 'lib/octospy/recordable/channel.rb', line 10 def repos @repos ||= [] end |