class Delegation

The Delegation class inherits from Array and describes methods that can be called on a Delegation for ease of display and database query.

Public Instance Methods

+(value) click to toggle source

Overloads the + operator to return a new Delegation instead of an Array.

Calls superclass method
# File lib/get-your-rep/delegation.rb, line 14
def +(value)
  if value.is_a?(Delegation)
    super.to_del
  else
    Delegation.new(super)
  end
end
<<(value) click to toggle source

Overloads the << operator so the receiving object is not overwritten as an Array, and there are no nested Delegations.

Calls superclass method
# File lib/get-your-rep/delegation.rb, line 5
def <<(value)
  if value.is_a?(Delegation) || value.is_a?(Array)
    self.replace(self + value)
  else
    super
  end
end
business_cards() click to toggle source

Maps all rep business cards.

# File lib/get-your-rep/delegation.rb, line 33
def business_cards
  self.map { |rep| rep.business_card }
end
eigth() click to toggle source

Get the [7] index.

# File lib/get-your-rep/delegation.rb, line 68
def eigth
  self[7]
end
fifth() click to toggle source

Get the [4] index.

# File lib/get-your-rep/delegation.rb, line 53
def fifth
  self[4]
end
first_names() click to toggle source

Collects the first names of every rep in the Delegation.

# File lib/get-your-rep/delegation.rb, line 23
def first_names
  self.map { |rep| rep.first_name }
end
fourth() click to toggle source

Get the [3] index.

# File lib/get-your-rep/delegation.rb, line 48
def fourth
  self[3]
end
last_names() click to toggle source

Collects the last names of every rep in the Delegation.

# File lib/get-your-rep/delegation.rb, line 28
def last_names
  self.map { |rep| rep.last_name }
end
ninth() click to toggle source

Get the [8] index.

# File lib/get-your-rep/delegation.rb, line 73
def ninth
  self[8]
end
second() click to toggle source

Get the [1] index.

# File lib/get-your-rep/delegation.rb, line 38
def second
  self[1]
end
seventh() click to toggle source

Get the [6] index.

# File lib/get-your-rep/delegation.rb, line 63
def seventh
  self[6]
end
sixth() click to toggle source

Get the [5] index.

# File lib/get-your-rep/delegation.rb, line 58
def sixth
  self[5]
end
tenth() click to toggle source

Get the [9] index.

# File lib/get-your-rep/delegation.rb, line 78
def tenth
  self[9]
end
third() click to toggle source

Get the [2] index.

# File lib/get-your-rep/delegation.rb, line 43
def third
  self[2]
end