Class: NexusParser::NexusParser::Note
- Inherits:
-
Object
- Object
- NexusParser::NexusParser::Note
- Defined in:
- lib/nexus_parser.rb
Instance Attribute Summary collapse
-
#vars ⇒ Object
Returns the value of attribute vars.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Note
constructor
A new instance of Note.
- #note ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Note
90 91 92 |
# File 'lib/nexus_parser.rb', line 90 def initialize( = {}) @vars = end |
Instance Attribute Details
#vars ⇒ Object
Returns the value of attribute vars.
89 90 91 |
# File 'lib/nexus_parser.rb', line 89 def vars @vars end |
Instance Method Details
#note ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/nexus_parser.rb', line 94 def note n = '' if @vars[:tf] n = @vars[:tf] elsif @vars[:text] n = @vars[:text] else n = 'No text recovered, possible parsing error.' end # THIS IS A HACK for handling the TF = (CM <note>) format, I assume there will be other params in the future beyond CM, at that point move processing to the parser if n[0..2] =~ /\A\s*\(\s*CM\s*/i n.strip! n = n[1..-2] if n[0..0] == "(" # get rid of quotation marks n.strip! n = n[2..-1] if n[0..1].downcase == "cm" # strip CM n.strip! n = n[1..-2] if n[0..0] == "'" # get rid of quote marks n = n[1..-2] if n[0..0] == '"' end n.strip end |