Class: Chronic::SpanDictionary

Inherits:
Dictionary show all
Defined in:
lib/chronic/dictionary.rb

Instance Attribute Summary

Attributes inherited from Dictionary

#defined_items, #options

Instance Method Summary collapse

Methods inherited from Dictionary

#definitions

Constructor Details

#initialize(options = {}) ⇒ SpanDictionary

Collection of SpanDefinitions



24
25
26
27
# File 'lib/chronic/dictionary.rb', line 24

def initialize(options = {})
  super
  @defined_items = [:time,:date,:anchor,:arrow,:narrow,:endian]
end

Instance Method Details

#[](handler_type = :symbol) ⇒ Object

returns the definitions of a specific subclass of SpanDefinitions SpanDefinition#definitions returns an Hash of Handler instances arguments should come in as symbols



32
33
34
# File 'lib/chronic/dictionary.rb', line 32

def [](handler_type=:symbol)
  definitions[handler_type]
end