Class: Optionable::Any
- Inherits:
-
Object
- Object
- Optionable::Any
- Defined in:
- lib/optionable/any.rb
Overview
Represents an option that can be of any value of a certain type.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Object
Check equality of the value for this type.
-
#initialize(type) ⇒ Any
constructor
Initialize the new any value object.
-
#inspect ⇒ String
Return the pretty inspected type.
Constructor Details
#initialize(type) ⇒ Any
Initialize the new any value object.
33 34 35 |
# File 'lib/optionable/any.rb', line 33 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object
11 12 13 |
# File 'lib/optionable/any.rb', line 11 def type @type end |
Instance Method Details
#==(other) ⇒ Object
Check equality of the value for this type.
21 22 23 |
# File 'lib/optionable/any.rb', line 21 def ==(other) other.is_a?(type) end |
#inspect ⇒ String
Return the pretty inspected type.
45 46 47 |
# File 'lib/optionable/any.rb', line 45 def inspect "any #{type}" end |