Class: BEL::Language::Annotation

Inherits:
Struct
  • Object
show all
Includes:
Quoting
Defined in:
lib/bel/language.rb

Constant Summary

Constants included from Quoting

Quoting::KeywordMatcher, Quoting::Keywords, Quoting::LenientQuotedMatcher, Quoting::NonWordMatcher, Quoting::QuoteNotEscapedMatcher, Quoting::StrictQuotedMatcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Quoting

#always_quote, #ensure_quotes, #identifier_value?, #quote, #quote_if_needed, #quoted?, #quotes_required?, #remove_quotes, #string_value?, #unquote, #unquoted?

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



92
93
94
# File 'lib/bel/language.rb', line 92

def name
  @name
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



92
93
94
# File 'lib/bel/language.rb', line 92

def value
  @value
end

Instance Method Details

#to_belObject Also known as: to_s



95
96
97
98
99
100
101
102
103
# File 'lib/bel/language.rb', line 95

def to_bel
  if self.value.respond_to? :each
    value = self.value.map {|v| quote(v)}
    value = "{#{value.join(',')}}"
  else
    value = quote_if_needed(self.value)
  end
  "SET #{self.name} = #{value}"
end