Class: ConfCtl::Swpins::ChannelList
- Inherits:
-
Array
- Object
- Array
- ConfCtl::Swpins::ChannelList
- Defined in:
- lib/confctl/swpins/channel_list.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pattern: '*') ⇒ ChannelList
constructor
A new instance of ChannelList.
- #pattern(pattern) ⇒ Array<Swpins::Channel>
- #refresh ⇒ Object
Constructor Details
#initialize(pattern: '*') ⇒ ChannelList
Returns a new instance of ChannelList.
18 19 20 21 |
# File 'lib/confctl/swpins/channel_list.rb', line 18 def initialize(pattern: '*') super() parse(pattern:) end |
Class Method Details
.get ⇒ Swpins::ChannelList
4 5 6 |
# File 'lib/confctl/swpins/channel_list.rb', line 4 def self.get @get ||= new end |
.pattern(pattern) ⇒ Object
9 10 11 |
# File 'lib/confctl/swpins/channel_list.rb', line 9 def self.pattern(pattern) get.pattern(pattern) end |
.refresh ⇒ Object
13 14 15 |
# File 'lib/confctl/swpins/channel_list.rb', line 13 def self.refresh get.refresh end |
Instance Method Details
#pattern(pattern) ⇒ Array<Swpins::Channel>
25 26 27 |
# File 'lib/confctl/swpins/channel_list.rb', line 25 def pattern(pattern) select { |c| Pattern.match?(pattern, c.name) } end |
#refresh ⇒ Object
29 30 31 32 |
# File 'lib/confctl/swpins/channel_list.rb', line 29 def refresh clear parse end |