Class: HexWrench::DateFeature

Inherits:
Feature
  • Object
show all
Defined in:
lib/hexwrench/core/feature.rb,
lib/hexwrench/weka/feature.rb

Constant Summary collapse

DEFAULT_WEKA_FORMAT =
"yyyy-MM-dd"

Instance Attribute Summary collapse

Attributes inherited from Feature

#resource, #sym

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Feature

for, mapping

Constructor Details

#initialize(sym, resource, format = nil) ⇒ DateFeature

Returns a new instance of DateFeature.



36
37
38
39
# File 'lib/hexwrench/core/feature.rb', line 36

def initialize(sym, resource, format=nil)
  super(sym, resource)
  @format = format
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



31
32
33
# File 'lib/hexwrench/core/feature.rb', line 31

def format
  @format
end

#weka_formatObject



8
9
10
# File 'lib/hexwrench/weka/feature.rb', line 8

def weka_format
  @weka_format || format || DEFAULT_WEKA_FORMAT
end

Class Method Details

.default_formatObject



32
33
34
# File 'lib/hexwrench/core/feature.rb', line 32

def self.default_format
  "%Y-%m-%d"
end