Class: Taxonifi::Splitter::Tokens::VolumeNumber
- Defined in:
- lib/taxonifi/splitter/tokens.rb
Overview
A token to match volume-number combinations, with various possible formats.
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(str) ⇒ VolumeNumber
constructor
A new instance of VolumeNumber.
Constructor Details
#initialize(str) ⇒ VolumeNumber
Returns a new instance of VolumeNumber.
251 252 253 254 255 256 257 258 |
# File 'lib/taxonifi/splitter/tokens.rb', line 251 def initialize(str) str.strip str =~ /\A\s*([^:(]+)\s*[:\(]?\s*([^:)]+)?\)?\s*/i @volume = $1 @number = $2 @volume && @volume.strip! @number && @number.strip! end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
246 247 248 |
# File 'lib/taxonifi/splitter/tokens.rb', line 246 def number @number end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
246 247 248 |
# File 'lib/taxonifi/splitter/tokens.rb', line 246 def volume @volume end |