Class: BEL::Language::DocumentProperty

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



20
21
22
# File 'lib/bel/language.rb', line 20

def name
  @name
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



20
21
22
# File 'lib/bel/language.rb', line 20

def value
  @value
end

Instance Method Details

#to_belObject Also known as: to_s



28
29
30
31
32
33
34
35
36
# File 'lib/bel/language.rb', line 28

def to_bel
  property_value =
    if self.value.respond_to?(:each)
      self.value.map(&:to_s).join('|')
    else
      self.value.to_s
    end
  %Q{SET DOCUMENT #{self.name} = #{quote_if_needed(property_value)}}
end