Class: Chronic::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/chronic/tag.rb

Overview

Tokens are tagged with subclassed instances of this class when they match specific criteria

Direct Known Subclasses

Grabber, Ordinal, Pointer, Repeater, Scalar, Separator, TimeZone

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Tag

Returns a new instance of Tag.

Parameters:

  • type (Symbol)


10
11
12
# File 'lib/chronic/tag.rb', line 10

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeSymbol

Returns:

  • (Symbol)


7
8
9
# File 'lib/chronic/tag.rb', line 7

def type
  @type
end

Instance Method Details

#start=(s) ⇒ Object

Parameters:

  • s (Time)

    Set the start timestamp for this Tag



15
16
17
# File 'lib/chronic/tag.rb', line 15

def start=(s)
  @now = s
end