Class: Ptimelog::Command::Upload

Inherits:
Base
  • Object
show all
Defined in:
lib/ptimelog/command/upload.rb

Overview

Upload entries to puzzletime

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Ptimelog::Command::Base

Instance Attribute Details

#entries=(value) ⇒ Object (writeonly)

Sets the attribute entries

Parameters:

  • value

    the value to set the attribute entries to.



9
10
11
# File 'lib/ptimelog/command/upload.rb', line 9

def entries=(value)
  @entries = value
end

Instance Method Details

#needs_entries?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ptimelog/command/upload.rb', line 11

def needs_entries?
  true
end

#runObject



15
16
17
18
19
20
21
22
# File 'lib/ptimelog/command/upload.rb', line 15

def run
  @entries.each do |date, list|
    puts "Uploading #{date}"
    list.each do |entry|
      open_browser(entry)
    end
  end
end