module BELParser::Language::Relationship

Relationship allows you to describe the type of BEL Relationship.

BEL Relationships represent an interaction between a subject and object in the BEL expression.

Public Instance Methods

==(other) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 72
def ==(other)
  return true if equal?(other)
  return false if other.nil?
  short == other || long == other
end
=~(regexp) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 96
def =~(regexp)
  short =~ regexp || long =~ regexp
end
causal?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 28
def causal?
  false
end
correlative?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 32
def correlative?
  false
end
decreasing?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 36
def decreasing?
  false
end
deprecated?() click to toggle source

Indicates whether this relationship is deprecated. Override in your relationship to mark as deprecated.

@return [Boolean] false

# File lib/bel_parser/language/relationship.rb, line 24
def deprecated?
  false
end
description() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 16
def description
  raise NotImplementedError, "#{__method__} is not implemented."
end
direct?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 40
def direct?
  false
end
directed?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 44
def directed?
  false
end
genomic?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 48
def genomic?
  false
end
increasing?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 52
def increasing?
  false
end
indirect?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 56
def indirect?
  false
end
injected?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 60
def injected?
  false
end
listable?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 64
def listable?
  false
end
long() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 12
def long
  raise NotImplementedError, "#{__method__} is not implemented."
end
self?() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 68
def self?
  false
end
short() click to toggle source
# File lib/bel_parser/language/relationship.rb, line 8
def short
  raise NotImplementedError, "#{__method__} is not implemented."
end
to_h(hash = {}) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 88
def to_h(hash = {})
  hash.merge!({
    'short'       => short,
    'long'        => long,
    'description' => description
  })
end
to_s(form = :short) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 82
def to_s(form = :short)
  value = _form_value(form)
  return nil unless value
  value.to_s
end
to_sym(form = :short) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 78
def to_sym(form = :short)
  _form_value(form)
end

Private Instance Methods

_form_value(form = :short) click to toggle source
# File lib/bel_parser/language/relationship.rb, line 102
def _form_value(form = :short)
  case form
  when :short
    short
  when :long
    long
  end
end