Class: AcnhVillager::Villager
- Inherits:
-
Object
- Object
- AcnhVillager::Villager
- Defined in:
- lib/acnh_villager/villager.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#catch_phrase ⇒ Object
Returns the value of attribute catch_phrase.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#hobby ⇒ Object
Returns the value of attribute hobby.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#jp_name ⇒ Object
Returns the value of attribute jp_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#personality ⇒ Object
Returns the value of attribute personality.
-
#saying ⇒ Object
Returns the value of attribute saying.
-
#species ⇒ Object
Returns the value of attribute species.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(villager) ⇒ Villager
constructor
A new instance of Villager.
Constructor Details
#initialize(villager) ⇒ Villager
Returns a new instance of Villager.
6 7 8 9 10 |
# File 'lib/acnh_villager/villager.rb', line 6 def initialize(villager) self.name = villager[:name][:'name-USen'] self.url = "http://acnhapi.com/v1/villagers/#{villager[:id].to_s}" @@all << self end |
Instance Attribute Details
#birthday ⇒ Object
Returns the value of attribute birthday.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def birthday @birthday end |
#catch_phrase ⇒ Object
Returns the value of attribute catch_phrase.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def catch_phrase @catch_phrase end |
#gender ⇒ Object
Returns the value of attribute gender.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def gender @gender end |
#hobby ⇒ Object
Returns the value of attribute hobby.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def hobby @hobby end |
#image_url ⇒ Object
Returns the value of attribute image_url.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def image_url @image_url end |
#jp_name ⇒ Object
Returns the value of attribute jp_name.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def jp_name @jp_name end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def name @name end |
#personality ⇒ Object
Returns the value of attribute personality.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def personality @personality end |
#saying ⇒ Object
Returns the value of attribute saying.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def @saying end |
#species ⇒ Object
Returns the value of attribute species.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def species @species end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/acnh_villager/villager.rb', line 4 def url @url end |
Class Method Details
.all ⇒ Object
12 13 14 |
# File 'lib/acnh_villager/villager.rb', line 12 def self.all @@all end |