Class: FuzzyDate
- Inherits:
-
Object
- Object
- FuzzyDate
- Defined in:
- lib/fuzzy-date.rb,
lib/fuzzy-date/analyze.rb,
lib/fuzzy-date/variables.rb,
lib/fuzzy-date/fuzzy-date.rb
Constant Summary collapse
- VERSION =
'0.2.1'- DATE_SEPARATOR =
'[^A-Za-z0-9]'
Instance Attribute Summary collapse
-
#circa ⇒ Object
readonly
Returns the value of attribute circa.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#era ⇒ Object
readonly
Returns the value of attribute era.
-
#fixed ⇒ Object
readonly
Returns the value of attribute fixed.
-
#full ⇒ Object
readonly
Returns the value of attribute full.
-
#long ⇒ Object
readonly
Returns the value of attribute long.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#month_name ⇒ Object
readonly
Returns the value of attribute month_name.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#short ⇒ Object
readonly
Returns the value of attribute short.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(date, euro = false) ⇒ FuzzyDate
constructor
A new instance of FuzzyDate.
- #to_hash ⇒ Object
Constructor Details
#initialize(date, euro = false) ⇒ FuzzyDate
Returns a new instance of FuzzyDate.
3 4 5 6 |
# File 'lib/fuzzy-date/fuzzy-date.rb', line 3 def initialize( date, euro = false ) setup analyze date, euro end |
Instance Attribute Details
#circa ⇒ Object (readonly)
Returns the value of attribute circa.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def circa @circa end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def day @day end |
#era ⇒ Object (readonly)
Returns the value of attribute era.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def era @era end |
#fixed ⇒ Object (readonly)
Returns the value of attribute fixed.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def fixed @fixed end |
#full ⇒ Object (readonly)
Returns the value of attribute full.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def full @full end |
#long ⇒ Object (readonly)
Returns the value of attribute long.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def long @long end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def month @month end |
#month_name ⇒ Object (readonly)
Returns the value of attribute month_name.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def month_name @month_name end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def original @original end |
#short ⇒ Object (readonly)
Returns the value of attribute short.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def short @short end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/fuzzy-date/analyze.rb', line 5 def year @year end |
Class Method Details
Instance Method Details
#to_hash ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fuzzy-date/fuzzy-date.rb', line 8 def to_hash { circa: @circa, day: @day, era: @era, fixed: @fixed, full: @full, long: @long, month: @month, month_name: @month_name, original: @original, short: @short, year: @year } end |