Class: BEL::Language::AnnotationDefinition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



30
31
32
# File 'lib/bel/language.rb', line 30

def prefix
  @prefix
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



30
31
32
# File 'lib/bel/language.rb', line 30

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



30
31
32
# File 'lib/bel/language.rb', line 30

def value
  @value
end

Instance Method Details

#to_belObject Also known as: to_s



31
32
33
34
35
36
37
38
39
40
# File 'lib/bel/language.rb', line 31

def to_bel
  case self.type
  when :list
    %Q{DEFINE ANNOTATION #{self.prefix} AS LIST {#{self.value.join(',')}}}
  when :pattern
    %Q{DEFINE ANNOTATION #{self.prefix} AS PATTERN "#{self.value}"}
  when :url
    %Q{DEFINE ANNOTATION #{self.prefix} AS URL "#{self.value}"}
  end
end