Class: Cocoadex::Parameter

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/cocoadex/models/parameter.rb

Direct Known Subclasses

DataType::Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description) ⇒ Parameter

Returns a new instance of Parameter.



8
9
10
# File 'lib/cocoadex/models/parameter.rb', line 8

def initialize name, description
  @name, @description = name, description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/cocoadex/models/parameter.rb', line 6

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/cocoadex/models/parameter.rb', line 6

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



16
17
18
# File 'lib/cocoadex/models/parameter.rb', line 16

def <=> other
  name <=> other.name if other.respond_to? :name
end

#to_sObject



12
13
14
# File 'lib/cocoadex/models/parameter.rb', line 12

def to_s
  "#{name} - #{description}"
end