Class: Everhour2toggl::Everhour

Inherits:
Object
  • Object
show all
Defined in:
lib/everhour2toggl/everhour.rb

Instance Method Summary collapse

Constructor Details

#initialize(from:, to:, fields:, apikey:) ⇒ Everhour

Returns a new instance of Everhour.



8
9
10
11
12
13
# File 'lib/everhour2toggl/everhour.rb', line 8

def initialize(from:, to:, fields:, apikey:)
  @from = from
  @to =  to
  @fields = fields
  @apikey = apikey
end

Instance Method Details

#exportObject



15
16
17
18
19
# File 'lib/everhour2toggl/everhour.rb', line 15

def export
  output_path = "everhour_entries"
  file_generator = Everhour2toggl::FileGenerator.new(output: output_path, filename: "#{@from}-#{@to}-#{@fields}.json")
  file_generator.generate(exported_time_str)
end