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::NonWordMatcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Quoting

#always_quote, #ensure_quotes, #quotes_required?, #remove_quotes

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



82
83
84
# File 'lib/bel/language.rb', line 82

def name
  @name
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



82
83
84
# File 'lib/bel/language.rb', line 82

def value
  @value
end

Instance Method Details

#to_belObject 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