Class: OptionHelpers::OptionType
- Inherits:
-
Object
- Object
- OptionHelpers::OptionType
- Defined in:
- lib/option.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type) ⇒ OptionType
constructor
A new instance of OptionType.
Constructor Details
#initialize(type) ⇒ OptionType
Returns a new instance of OptionType.
39 40 41 |
# File 'lib/option.rb', line 39 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
37 38 39 |
# File 'lib/option.rb', line 37 def type @type end |
Class Method Details
.for_class(klass) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/option.rb', line 44 def for_class(klass) case klass when Class option_type_cache[klass] ||= OptionType.new(klass) else raise TypeError, "Must be a Class" end end |