Class: Narabikae::Option
- Inherits:
-
Object
- Object
- Narabikae::Option
- Defined in:
- lib/narabikae/option.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#key_max_size ⇒ Object
readonly
Returns the value of attribute key_max_size.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(field:, key_max_size:, scope: []) ⇒ Option
constructor
Initializes a new instance of the Option class.
Constructor Details
#initialize(field:, key_max_size:, scope: []) ⇒ Option
Initializes a new instance of the Option class.
10 11 12 13 14 |
# File 'lib/narabikae/option.rb', line 10 def initialize(field:, key_max_size:, scope: []) @field = field.to_sym @key_max_size = key_max_size.to_i @scope = scope.is_a?(Array) ? scope.map(&:to_sym) : [] end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
3 4 5 |
# File 'lib/narabikae/option.rb', line 3 def field @field end |
#key_max_size ⇒ Object (readonly)
Returns the value of attribute key_max_size.
3 4 5 |
# File 'lib/narabikae/option.rb', line 3 def key_max_size @key_max_size end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
3 4 5 |
# File 'lib/narabikae/option.rb', line 3 def scope @scope end |