Class: OboParser::Tokens::RelationshipTag
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
, :qualifier.
-
#related_term ⇒ Object
readonly
, :qualifier.
-
#relation ⇒ Object
readonly
, :qualifier.
-
#tag ⇒ Object
readonly
, :qualifier.
-
#xrefs ⇒ Object
readonly
, :qualifier.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(str) ⇒ RelationshipTag
constructor
A new instance of RelationshipTag.
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
#comment ⇒ Object (readonly)
, :qualifier
134 135 136 |
# File 'lib/tokens.rb', line 134 def comment @comment end |
#related_term ⇒ Object (readonly)
, :qualifier
134 135 136 |
# File 'lib/tokens.rb', line 134 def @related_term end |
#relation ⇒ Object (readonly)
, :qualifier
134 135 136 |
# File 'lib/tokens.rb', line 134 def relation @relation end |
#tag ⇒ Object (readonly)
, :qualifier
134 135 136 |
# File 'lib/tokens.rb', line 134 def tag @tag end |
#xrefs ⇒ Object (readonly)
, :qualifier
134 135 136 |
# File 'lib/tokens.rb', line 134 def xrefs @xrefs end |