Sha256: 4c97ca2e176002ac621a494cbdddc922adc19ec7bad8eea9ea05879c229fc4ae
Contents?: true
Size: 712 Bytes
Versions: 3
Compression:
Stored size: 712 Bytes
Contents
require 'octospy/recordable/channel' module Octospy module Recordable class << self def channels @channels ||= [] end def channels_include?(name) !!find_channel(name) end def find_channel(name) channels.find { |channel| channel.name.to_s == name.to_s } end def add_channel(name) channels << Channel.new(name) unless channels_include? name end def del_channel(name) channels.delete_if { |channel| channel.name.to_s == name.to_s } end def channel(name) if channels_include? name find_channel name else Channel.new(name) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
octospy-0.0.4 | lib/octospy/recordable.rb |
octospy-0.0.3 | lib/octospy/recordable.rb |
octospy-0.0.2 | lib/octospy/recordable.rb |