Class: OboParser::Tokens::RelationshipTag

Inherits:
Token
  • Object
show all
Defined in:
lib/tokens.rb

Instance Attribute Summary collapse

Attributes inherited from Token

#value

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ RelationshipTag

Returns a new instance of RelationshipTag.



136
137
138
139
140
141
142
143
144
145
146
# File 'lib/tokens.rb', line 136

def initialize(str)
  @tag = 'relationship'
  @xrefs = [] 
  @relation, @related_term = str.split(/\s/,3)
  
  str =~ /\s+!\s+(.*)\s*\n*/i
  @comment = $1

  @comment ||= ""
  [@relation, @related_term, @comment].map(&:strip!)
end

Instance Attribute Details

#commentObject (readonly)

, :qualifier



134
135
136
# File 'lib/tokens.rb', line 134

def comment
  @comment
end

, :qualifier



134
135
136
# File 'lib/tokens.rb', line 134

def related_term
  @related_term
end

#relationObject (readonly)

, :qualifier



134
135
136
# File 'lib/tokens.rb', line 134

def relation
  @relation
end

#tagObject (readonly)

, :qualifier



134
135
136
# File 'lib/tokens.rb', line 134

def tag
  @tag
end

#xrefsObject (readonly)

, :qualifier



134
135
136
# File 'lib/tokens.rb', line 134

def xrefs
  @xrefs
end