Class: AcnhVillager::Villager

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#birthdayObject

Returns the value of attribute birthday.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def birthday
  @birthday
end

#catch_phraseObject

Returns the value of attribute catch_phrase.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def catch_phrase
  @catch_phrase
end

#genderObject

Returns the value of attribute gender.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def gender
  @gender
end

#hobbyObject

Returns the value of attribute hobby.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def hobby
  @hobby
end

#image_urlObject

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_nameObject

Returns the value of attribute jp_name.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def jp_name
  @jp_name
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def name
  @name
end

#personalityObject

Returns the value of attribute personality.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def personality
  @personality
end

#sayingObject

Returns the value of attribute saying.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def saying
  @saying
end

#speciesObject

Returns the value of attribute species.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def species
  @species
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/acnh_villager/villager.rb', line 4

def url
  @url
end

Class Method Details

.allObject



12
13
14
# File 'lib/acnh_villager/villager.rb', line 12

def self.all
    @@all
end