module Octospy::Recordable

Public Class Methods

add_channel(name) click to toggle source
# File lib/octospy/recordable.rb, line 18
def add_channel(name)
  channels << Channel.new(name) unless channels_include? name
end
channel(name) click to toggle source
# File lib/octospy/recordable.rb, line 26
def channel(name)
  if channels_include? name
    find_channel name
  else
    add_channel name
    find_channel name
  end
end
channels() click to toggle source
# File lib/octospy/recordable.rb, line 6
def channels
  @channels ||= []
end
channels_include?(name) click to toggle source
# File lib/octospy/recordable.rb, line 10
def channels_include?(name)
  !!find_channel(name)
end
find_channel(name) click to toggle source
# File lib/octospy/recordable.rb, line 14
def find_channel(name)
  channels.find { |channel| channel.name.to_s == name.to_s }
end
remove_channel(name) click to toggle source
# File lib/octospy/recordable.rb, line 22
def remove_channel(name)
  channels.delete_if { |channel| channel.name.to_s == name.to_s }
end