Class: Umwelt::Phase::Mapper

Inherits:
Abstract::Mapper show all
Defined in:
lib/umwelt/phase/mapper.rb

Instance Method Summary collapse

Methods inherited from Abstract::Mapper

#fill

Methods inherited from Abstract::Interactor

#prove

Instance Method Details

#call(data) ⇒ Object



7
8
9
10
11
12
# File 'lib/umwelt/phase/mapper.rb', line 7

def call(data)
  @struct = fill(
    Struct::Phase,
    data.merge(finished_at: time(data[:finished_at]))
  )
end

#time(str) ⇒ Object



14
15
16
# File 'lib/umwelt/phase/mapper.rb', line 14

def time(str)
  Time.parse str if str
end