Class: Tonal::Comma
- Inherits:
-
Object
- Object
- Tonal::Comma
- Defined in:
- lib/tonal/comma.rb
Class Method Summary collapse
-
.commas ⇒ Hash
Of comma key/value pairs.
-
.keys ⇒ Array
Of comma keys.
-
.method_missing(comma) ⇒ Rational
The comma found in the repo.
-
.values ⇒ Array
Of comma values.
Class Method Details
.commas ⇒ Hash
Returns of comma key/value pairs.
10 11 12 |
# File 'lib/tonal/comma.rb', line 10 def self.commas @commas ||= JSON.parse(YAML::load_file("#{__dir__}/../../data/commas.yml", aliases: true).to_json)["commas"] end |
.keys ⇒ Array
Returns of comma keys.
28 29 30 |
# File 'lib/tonal/comma.rb', line 28 def self.keys @keys ||= commas.keys end |
.method_missing(comma) ⇒ Rational
Returns the comma found in the repo.
36 37 38 |
# File 'lib/tonal/comma.rb', line 36 def self.method_missing(comma) commas[comma.to_s].to_r end |
.values ⇒ Array
Returns of comma values.
19 20 21 |
# File 'lib/tonal/comma.rb', line 19 def self.values @values ||= commas.values.map(&:to_r) end |