Class: Smartdown::Model::Answer::Date

Inherits:
Base
  • Object
show all
Defined in:
lib/smartdown/model/answer/date.rb

Instance Attribute Summary

Attributes inherited from Base

#error, #question, #value

Instance Method Summary collapse

Methods inherited from Base

#*, #+, #-, #/, #<=>, #initialize, #invalid?, #valid?

Constructor Details

This class inherits a constructor from Smartdown::Model::Answer::Base

Instance Method Details

#humanizeObject



15
16
17
# File 'lib/smartdown/model/answer/date.rb', line 15

def humanize
  value.strftime("%-d %B %Y")
end

#to_sObject



11
12
13
# File 'lib/smartdown/model/answer/date.rb', line 11

def to_s
  value.strftime("%Y-%-m-%-d")
end

#value_typeObject



7
8
9
# File 'lib/smartdown/model/answer/date.rb', line 7

def value_type
  ::Date
end