class AcunoteProject
API for accessing Acunote projects.
Public Class Methods
acu_conn()
click to toggle source
# File lib/acunote_project.rb, line 5 def self.acu_conn AcunoteConnection.instance end
find_by_name(name)
click to toggle source
NAME can be a literal string or a regex.
# File lib/acunote_project.rb, line 21 def self.find_by_name(name) projects = acu_conn.get_page(url('')) projects.links_with(:href => /projects\/([0-9]*)\/sprints$/, :text => name).first if projects end
find_id_by_name(name)
click to toggle source
# File lib/acunote_project.rb, line 13 def self.find_id_by_name(name) link = find_by_name(name) if(link && link.uri.to_s =~ /projects\/([0-9]*)\/sprints/) $1 end end
url(id)
click to toggle source
# File lib/acunote_project.rb, line 9 def self.url(id) "#{acu_conn.home_url}/projects/#{id}" end