Class: Mv::Core::Constraint::Description
- Inherits:
-
Object
- Object
- Mv::Core::Constraint::Description
- Includes:
- Comparable
- Defined in:
- lib/mv/core/constraint/description.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(other_info) ⇒ Object
-
#initialize(name, type, options = {}) ⇒ Description
constructor
A new instance of Description.
Constructor Details
#initialize(name, type, options = {}) ⇒ Description
Returns a new instance of Description.
9 10 11 12 13 14 15 16 |
# File 'lib/mv/core/constraint/description.rb', line 9 def initialize name, type, = {} @name = name.to_sym @type = type.to_sym = .inject({}) do |res, (name, value)| res[name.to_sym] = value.to_s res end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/mv/core/constraint/description.rb', line 7 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/mv/core/constraint/description.rb', line 7 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/mv/core/constraint/description.rb', line 7 def type @type end |
Instance Method Details
#<=>(other_info) ⇒ Object
18 19 20 |
# File 'lib/mv/core/constraint/description.rb', line 18 def <=> other_info [name, type, ] <=> [other_info.name, other_info.type, other_info.] end |