Class: Blockhead::OptionKey
- Inherits:
-
Object
- Object
- Blockhead::OptionKey
- Defined in:
- lib/blockhead/option_key.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ OptionKey
constructor
A new instance of OptionKey.
- #key ⇒ Object
Constructor Details
#initialize(name, options) ⇒ OptionKey
Returns a new instance of OptionKey.
5 6 7 8 |
# File 'lib/blockhead/option_key.rb', line 5 def initialize(name, ) @default = name = end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
3 4 5 |
# File 'lib/blockhead/option_key.rb', line 3 def default @default end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/blockhead/option_key.rb', line 3 def end |
Instance Method Details
#key ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/blockhead/option_key.rb', line 10 def key if raise TypeError, 'Aliase is not of expected type' if bad_type? [:as] else default end end |