Class: Chronic::Pointer
Instance Attribute Summary
Attributes inherited from Tag
Class Method Summary collapse
- .patterns ⇒ Object
-
.scan(tokens, options) ⇒ Object
Scan an Array of Token objects and apply any necessary Pointer tags to each token.
Instance Method Summary collapse
Methods inherited from Tag
Constructor Details
This class inherits a constructor from Chronic::Tag
Class Method Details
.patterns ⇒ Object
17 18 19 20 21 22 |
# File 'lib/chronic/tags/pointer.rb', line 17 def self.patterns @@patterns ||= { 'past' => :past, /^future|in$/i => :future, } end |
.scan(tokens, options) ⇒ Object
Scan an Array of Token objects and apply any necessary Pointer tags to each token.
tokens - An Array of tokens to scan. options - The Hash of options specified in Chronic::parse.
Returns an Array of tokens.
11 12 13 14 15 |
# File 'lib/chronic/tags/pointer.rb', line 11 def self.scan(tokens, ) tokens.each do |token| token.tag scan_for(token, self, patterns, ) end end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/chronic/tags/pointer.rb', line 24 def to_s 'pointer-' << @type.to_s end |