Class: PlayGOT::House
- Inherits:
-
Object
- Object
- PlayGOT::House
- Defined in:
- lib/play_GOT/house.rb
Constant Summary collapse
- @@all =
[]
- @@chosen =
{}
Instance Attribute Summary collapse
-
#ancestral_weapons ⇒ Object
Returns the value of attribute ancestral_weapons.
-
#name ⇒ Object
Returns the value of attribute name.
-
#region ⇒ Object
Returns the value of attribute region.
-
#titles ⇒ Object
Returns the value of attribute titles.
-
#words ⇒ Object
Returns the value of attribute words.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(house_attributes) ⇒ House
constructor
A new instance of House.
Constructor Details
#initialize(house_attributes) ⇒ House
Returns a new instance of House.
6 7 8 9 10 11 |
# File 'lib/play_GOT/house.rb', line 6 def initialize(house_attributes) house_attributes.each do |k, v| self.send("#{k}=", v) end @@all << self end |
Instance Attribute Details
#ancestral_weapons ⇒ Object
Returns the value of attribute ancestral_weapons.
2 3 4 |
# File 'lib/play_GOT/house.rb', line 2 def ancestral_weapons @ancestral_weapons end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/play_GOT/house.rb', line 2 def name @name end |
#region ⇒ Object
Returns the value of attribute region.
2 3 4 |
# File 'lib/play_GOT/house.rb', line 2 def region @region end |
#titles ⇒ Object
Returns the value of attribute titles.
2 3 4 |
# File 'lib/play_GOT/house.rb', line 2 def titles @titles end |
#words ⇒ Object
Returns the value of attribute words.
2 3 4 |
# File 'lib/play_GOT/house.rb', line 2 def words @words end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/play_GOT/house.rb', line 14 def self.all @@all end |
.find(i) ⇒ Object
26 27 28 |
# File 'lib/play_GOT/house.rb', line 26 def self.find(i) @@chosen = self.all[i - 1] end |
.list_all ⇒ Object
19 20 21 22 23 |
# File 'lib/play_GOT/house.rb', line 19 def self.list_all self.all.each.with_index(1) do |h, i| puts "#{i} - #{h.name}".blue end end |