Module: Rmclient
- Defined in:
- lib/rmclient.rb,
lib/rmclient/version.rb
Defined Under Namespace
Classes: Enumeration, Issue, RestAPI, Time_entry, Time_entry_activity
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
-
#mktime_entry(id, date, activity, hours, comment) ⇒ Object
create time entry.
-
#print_activities ⇒ Object
print possible activities.
-
#print_issues(user = "me") ⇒ Object
print issues assigned to user.
-
#print_time_entries(user = "me") ⇒ Object
print time entries for user.
Instance Method Details
#mktime_entry(id, date, activity, hours, comment) ⇒ Object
create time entry
51 52 53 54 55 |
# File 'lib/rmclient.rb', line 51 def mktime_entry(id, date, activity, hours, comment) # parse date a = Time_entry.new(:issue_id => id, :spent_on => date, :hours => hours, :comments => comment, :activity_id => activity) a.save() end |
#print_activities ⇒ Object
print possible activities
39 40 41 |
# File 'lib/rmclient.rb', line 39 def print_activities() Time_entry_activity.find(:all).each{|a| print "#{a.id} #{a.name}\n"} end |
#print_issues(user = "me") ⇒ Object
print issues assigned to user
25 26 27 28 |
# File 'lib/rmclient.rb', line 25 def print_issues(user = "me") issues = Issue.find(:all, :params => { :assigned_to_id => user, "limit" => 100}) issues.each{|i| print "#{i.id} #{i.subject}\n"} end |
#print_time_entries(user = "me") ⇒ Object
print time entries for user
33 34 35 36 |
# File 'lib/rmclient.rb', line 33 def print_time_entries(user = "me") entries = Time_entry.find(:all, :params => { :user_id => user, "limit" => 100}) entries.each{|e| print "#{e.id} #{e.spent_on} #{e.hours} #{e.comments}\n"} end |