Class: Taxonifi::Splitter::Tokens::Pages
- Defined in:
- lib/taxonifi/splitter/tokens.rb
Overview
A token to match page ranges, with remainders noted.
Instance Attribute Summary collapse
-
#pg_end ⇒ Object
readonly
Returns the value of attribute pg_end.
-
#pg_start ⇒ Object
readonly
Returns the value of attribute pg_start.
-
#remainder ⇒ Object
readonly
Returns the value of attribute remainder.
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(str) ⇒ Pages
constructor
A new instance of Pages.
Constructor Details
#initialize(str) ⇒ Pages
Returns a new instance of Pages.
266 267 268 269 270 271 272 |
# File 'lib/taxonifi/splitter/tokens.rb', line 266 def initialize(str) str.strip str =~ /\A\s*(\d+)\s*[-]?\s*(\d+)?\)?\s*[\.\,]?(.*)?/i @pg_start = $1 @pg_end = $2 @remainder = $3.strip end |
Instance Attribute Details
#pg_end ⇒ Object (readonly)
Returns the value of attribute pg_end.
263 264 265 |
# File 'lib/taxonifi/splitter/tokens.rb', line 263 def pg_end @pg_end end |
#pg_start ⇒ Object (readonly)
Returns the value of attribute pg_start.
263 264 265 |
# File 'lib/taxonifi/splitter/tokens.rb', line 263 def pg_start @pg_start end |
#remainder ⇒ Object (readonly)
Returns the value of attribute remainder.
263 264 265 |
# File 'lib/taxonifi/splitter/tokens.rb', line 263 def remainder @remainder end |