Class: BEL::Language::Parameter
- Inherits:
-
Object
- Object
- BEL::Language::Parameter
- Includes:
- Comparable
- Defined in:
- lib/bel/language.rb
Instance Attribute Summary collapse
-
#enc ⇒ Object
readonly
Returns the value of attribute enc.
-
#ns_def ⇒ Object
readonly
Returns the value of attribute ns_def.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(ns_def, value, enc) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#enc ⇒ Object (readonly)
Returns the value of attribute enc.
117 118 119 |
# File 'lib/bel/language.rb', line 117 def enc @enc end |
#ns_def ⇒ Object (readonly)
Returns the value of attribute ns_def.
117 118 119 |
# File 'lib/bel/language.rb', line 117 def ns_def @ns_def end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
117 118 119 |
# File 'lib/bel/language.rb', line 117 def signature @signature end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
117 118 119 |
# File 'lib/bel/language.rb', line 117 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
126 127 128 129 130 131 132 133 |
# File 'lib/bel/language.rb', line 126 def <=>(other) ns_compare = ns_def <=> other.ns_def if ns_compare == 0 value <=> other.value else ns_compare end end |
#to_s ⇒ Object
135 136 137 138 139 140 141 |
# File 'lib/bel/language.rb', line 135 def to_s value = @value if value =~ %r{\W} value = %Q{"#{value}"} end "#{@ns_def}:#{value}" end |