Class: Mv::Core::Constraint::Description

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/mv/core/constraint/description.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {}
  @name = name.to_sym
  @type = type.to_sym
  @options = options.inject({}) do |res, (name, value)|
    res[name.to_sym] = value.to_s
    res
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/mv/core/constraint/description.rb', line 7

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/mv/core/constraint/description.rb', line 7

def options
  @options
end

#typeObject (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, options] <=> [other_info.name, other_info.type, other_info.options]
end