Class: Yuriita::Configuration
- Inherits:
-
Object
- Object
- Yuriita::Configuration
- Includes:
- Enumerable
- Defined in:
- lib/yuriita/configuration.rb
Constant Summary collapse
- EMPTY_STRING =
"".freeze
Instance Attribute Summary collapse
-
#default_input ⇒ Object
readonly
Returns the value of attribute default_input.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #find_definition(key) ⇒ Object
-
#initialize(definitions, default_input: EMPTY_STRING) ⇒ Configuration
constructor
A new instance of Configuration.
- #size ⇒ Object
Constructor Details
#initialize(definitions, default_input: EMPTY_STRING) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 |
# File 'lib/yuriita/configuration.rb', line 8 def initialize(definitions, default_input: EMPTY_STRING) @definitions = definitions @default_input = default_input end |
Instance Attribute Details
#default_input ⇒ Object (readonly)
Returns the value of attribute default_input.
6 7 8 |
# File 'lib/yuriita/configuration.rb', line 6 def default_input @default_input end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 20 21 |
# File 'lib/yuriita/configuration.rb', line 17 def each(&block) block or return enum_for(__method__) { size } definitions.each_value(&block) self end |
#find_definition(key) ⇒ Object
13 14 15 |
# File 'lib/yuriita/configuration.rb', line 13 def find_definition(key) definitions.fetch(key) end |
#size ⇒ Object
23 24 25 |
# File 'lib/yuriita/configuration.rb', line 23 def size definitions.size end |