Class: BitmaskEnum::Options Private
- Inherits:
-
Object
- Object
- BitmaskEnum::Options
- Defined in:
- lib/bitmask_enum/options.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handles the bitmask enum’s user-provided options
Instance Attribute Summary collapse
- #flag_prefix ⇒ Object readonly private
- #flag_suffix ⇒ Object readonly private
- #nil_handling ⇒ Object readonly private
- #validate ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(options) ⇒ Options
constructor
private
A new instance of Options.
Constructor Details
#initialize(options) ⇒ Options
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Options.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bitmask_enum/options.rb', line 11 def initialize() @nil_handling = [:nil_handling].to_sym unless NIL_HANDLING_OPTIONS.include?(@nil_handling) raise BitmaskEnumInvalidError, "#{@nil_handling} is not a valid nil handling option" end @flag_prefix = [:flag_prefix].nil? ? '' : "#{[:flag_prefix]}_" @flag_suffix = [:flag_suffix].nil? ? '' : "_#{[:flag_suffix]}" @validate = [:validate] end |
Instance Attribute Details
#flag_prefix ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/bitmask_enum/options.rb', line 9 def flag_prefix @flag_prefix end |
#flag_suffix ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/bitmask_enum/options.rb', line 9 def flag_suffix @flag_suffix end |
#nil_handling ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/bitmask_enum/options.rb', line 9 def nil_handling @nil_handling end |
#validate ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/bitmask_enum/options.rb', line 9 def validate @validate end |