Class: Compose::Model
- Inherits:
-
Object
- Object
- Compose::Model
- Defined in:
- lib/compose/model.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
12 13 14 |
# File 'lib/compose/model.rb', line 12 def self.all yaml[:models] end |
.find(name) ⇒ Object
16 17 18 |
# File 'lib/compose/model.rb', line 16 def self.find(name) all.find { |model| model[:name] == name || model[:nickname] == name } end |
.preferred_verifier_model ⇒ Object
20 21 22 23 |
# File 'lib/compose/model.rb', line 20 def self.preferred_verifier_model preferred_nickname = yaml[:preferred_verifier_model] all.find { |model| model[:nickname] == preferred_nickname } end |
.yaml ⇒ Object
5 6 7 8 9 10 |
# File 'lib/compose/model.rb', line 5 def self.yaml return @yaml if @yaml yaml_content = File.read(File.("../../config/models.yml", __dir__)) @yaml = YAML.safe_load(yaml_content, symbolize_names: true) end |