class Ellington::ConnectionList

Attributes

inner_list[R]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/ellington/connection_list.rb, line 5
def initialize
  @inner_list = []
  super inner_list
end

Public Instance Methods

<<(connection)
Alias for: push
push(connection) click to toggle source
# File lib/ellington/connection_list.rb, line 10
def push(connection)
  check connection
  inner_list.push connection
end
Also aliased as: <<

Protected Instance Methods

check(connection) click to toggle source
# File lib/ellington/connection_list.rb, line 21
def check(connection)
  matches = inner_list.select do |c| 
    c.line == connection && c.states == connection.states
  end
  raise Ellington::ListAlreadyContainsConnection unless matches.empty?
end