Class: Rubiderella::Idol

Inherits:
Person
  • Object
show all
Defined in:
lib/rubiderella/idol.rb,
lib/rubiderella/idol/name.rb,
lib/rubiderella/idol/birthday.rb

Defined Under Namespace

Classes: Birthday, Name

Instance Attribute Summary

Attributes inherited from Person

#age, #birthday, #blood, #bust, #cv, #favorite, #from, #handed, #height, #hip, #name, #sign, #type, #waist, #weight

Class Method Summary collapse

Methods inherited from Person

all, #initialize, names, valid?

Constructor Details

This class inherits a constructor from Rubiderella::Person

Class Method Details

.configObject



6
7
8
9
10
# File 'lib/rubiderella/idol.rb', line 6

def config
  @config = Dir.glob("#{File.dirname(__FILE__)}/../../config/idols/*.yml").each_with_object({}) do |file, idols|
    idols.merge!(YAML.load_file(file))
  end.deep_symbolize_keys
end

.find_by_key(key) ⇒ Object

Raises:



12
13
14
15
16
# File 'lib/rubiderella/idol.rb', line 12

def find_by_key(key)
  raise UnknownIdolError unless valid?(key)

  new(@config[key])
end