Class: Rubiderella::Trainer

Inherits:
Person
  • Object
show all
Defined in:
lib/rubiderella/trainer.rb,
lib/rubiderella/trainer/name.rb,
lib/rubiderella/trainer/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/trainer.rb', line 6

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

.find_by_key(key) ⇒ Object



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

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

  new(@config[key])
end