Class: Concerns::EventFight

Inherits:
Object
  • Object
show all
Defined in:
lib/event_fight.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(red_name = nil, blue_name = nil, fight_hash = nil) ⇒ EventFight

Returns a new instance of EventFight.



6
7
8
9
10
11
12
13
# File 'lib/event_fight.rb', line 6

def initialize(red_name = nil,  blue_name = nil, fight_hash = nil)
  @red_name = red_name
  @blue_name = blue_name
  fight_hash.each do |key, value|
    self.send("#{key}=", value)
  end
  @@all << self
end

Instance Attribute Details

#blue_heightObject

Returns the value of attribute blue_height.



2
3
4
# File 'lib/event_fight.rb', line 2

def blue_height
  @blue_height
end

#blue_nameObject

Returns the value of attribute blue_name.



2
3
4
# File 'lib/event_fight.rb', line 2

def blue_name
  @blue_name
end

#blue_recordObject

Returns the value of attribute blue_record.



2
3
4
# File 'lib/event_fight.rb', line 2

def blue_record
  @blue_record
end

#blue_weightObject

Returns the value of attribute blue_weight.



2
3
4
# File 'lib/event_fight.rb', line 2

def blue_weight
  @blue_weight
end

#eventObject

Returns the value of attribute event.



2
3
4
# File 'lib/event_fight.rb', line 2

def event
  @event
end

#fightsObject

Returns the value of attribute fights.



2
3
4
# File 'lib/event_fight.rb', line 2

def fights
  @fights
end

#red_heightObject

Returns the value of attribute red_height.



2
3
4
# File 'lib/event_fight.rb', line 2

def red_height
  @red_height
end

#red_nameObject

Returns the value of attribute red_name.



2
3
4
# File 'lib/event_fight.rb', line 2

def red_name
  @red_name
end

#red_recordObject

Returns the value of attribute red_record.



2
3
4
# File 'lib/event_fight.rb', line 2

def red_record
  @red_record
end

#red_weightObject

Returns the value of attribute red_weight.



2
3
4
# File 'lib/event_fight.rb', line 2

def red_weight
  @red_weight
end

Class Method Details

.allObject



15
16
17
# File 'lib/event_fight.rb', line 15

def self.all
  @@all
end

.clearObject



19
20
21
# File 'lib/event_fight.rb', line 19

def self.clear
  @@all.clear
end