Class: BEL::Language::StatementGroup

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

#annotationsObject

Returns the value of attribute annotations

Returns:

  • (Object)

    the current value of annotations



116
117
118
# File 'lib/bel/language.rb', line 116

def annotations
  @annotations
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



116
117
118
# File 'lib/bel/language.rb', line 116

def name
  @name
end

#statementsObject

Returns the value of attribute statements

Returns:

  • (Object)

    the current value of statements



116
117
118
# File 'lib/bel/language.rb', line 116

def statements
  @statements
end

Instance Method Details

#<=>(other_group) ⇒ Object



119
120
121
122
123
124
125
# File 'lib/bel/language.rb', line 119

def <=>(other_group)
  if not other_group || other_group.is_a?
    1
  else
    (statements || []) <=> (other_group.statements || [])
  end
end

#to_belObject Also known as: to_s



127
128
129
# File 'lib/bel/language.rb', line 127

def to_bel
  %Q{SET STATEMENT_GROUP = #{quote_if_needed(self.name)}}
end