Class: Datify::Engine
Constant Summary
Constants included from Language
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
Attributes included from Language
Instance Method Summary collapse
-
#initialize(string = nil) ⇒ Engine
constructor
A new instance of Engine.
- #parse_string(string) ⇒ Object
- #valid? ⇒ Boolean
Methods included from Language
#default_language, #get_month, #set_language
Constructor Details
#initialize(string = nil) ⇒ Engine
Returns a new instance of Engine.
8 9 10 11 |
# File 'lib/datify/engine.rb', line 8 def initialize(string = nil) default_language @array = parse_string(string) end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/datify/engine.rb', line 6 def date @date end |
Instance Method Details
#parse_string(string) ⇒ Object
17 18 19 |
# File 'lib/datify/engine.rb', line 17 def parse_string(string) (string.nil?) ? [] : string.split('-') end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/datify/engine.rb', line 21 def valid? ((@array.size == 3) && (get_month(@array[1]) != @array[1])) end |