Class: Boundy::Formatters::Time

Inherits:
Object
  • Object
show all
Includes:
Boundy::Formatter::Sql::Plugin
Defined in:
lib/boundy/formatters/time.rb

Defined Under Namespace

Classes: Factory

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Boundy::Formatter::Sql::Plugin

for, included

Constructor Details

#initialize(format, time) ⇒ Time

Returns a new instance of Time.



33
34
35
# File 'lib/boundy/formatters/time.rb', line 33

def initialize(format, time)
  @formatted = time.strftime(format)
end

Class Attribute Details

.factoryObject



25
26
27
# File 'lib/boundy/formatters/time.rb', line 25

def factory
  @factory = Factory.new("%Y-%m-%d %H:%M:%S")
end

Class Method Details

.typeObject



19
20
21
# File 'lib/boundy/formatters/time.rb', line 19

def self.type
  ::Time
end

Instance Method Details

#to_sObject



37
38
39
# File 'lib/boundy/formatters/time.rb', line 37

def to_s
  @formatted
end