Class: BEL::Language::Annotation
- Inherits:
-
Struct
- Object
- Struct
- BEL::Language::Annotation
- Includes:
- Quoting
- Defined in:
- lib/bel/language.rb
Constant Summary
Constants included from Quoting
Quoting::KeywordMatcher, Quoting::NonWordMatcher
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #to_bel ⇒ Object (also: #to_s)
Methods included from Quoting
#always_quote, #ensure_quotes, #quotes_required?, #remove_quotes
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
82 83 84 |
# File 'lib/bel/language.rb', line 82 def name @name end |
#value ⇒ Object
Returns the value of attribute value
82 83 84 |
# File 'lib/bel/language.rb', line 82 def value @value end |
Instance Method Details
#to_bel ⇒ Object Also known as: to_s
85 86 87 88 89 90 91 92 93 |
# File 'lib/bel/language.rb', line 85 def to_bel if self.value.respond_to? :each value = self.value.map {|v| always_quote(v)} value = "{#{value.join(',')}}" else value = ensure_quotes(self.value) end "SET #{self.name} = #{value}" end |