Class: Lighthouse::Ticket
- Defined in:
- lib/lighthouse/ticket.rb
Overview
Find tickets
Lighthouse::Ticket.find(:all, :params => { :project_id => 44 })
Lighthouse::Ticket.find(:all, :params => { :project_id => 44, :q => "state:closed tagged:committed" })
project = Lighthouse::Project.find(44)
project.tickets
project.tickets(:q => "state:closed tagged:committed")
Creating a Ticket
ticket = Lighthouse::Ticket.new(:project_id => 44)
ticket.title = 'asdf'
...
ticket. << 'ruby' << 'rails' << '@high'
ticket.save
Updating a Ticket
ticket = Lighthouse::Ticket.find(20, :params => { :project_id => 44 })
ticket.state = 'resolved'
ticket..delete '@high'
ticket.save
Instance Attribute Summary collapse
Instance Method Summary collapse
- #body ⇒ Object
- #body=(value) ⇒ Object
- #body_html ⇒ Object
- #body_html=(value) ⇒ Object
- #id ⇒ Object
- #save_with_tags ⇒ Object
Methods inherited from Base
Instance Attribute Details
#tags ⇒ Object
36 37 38 39 |
# File 'lib/lighthouse/ticket.rb', line 36 def attributes['tag'] ||= nil @tags ||= tag.blank? ? [] : parse_with_spaces(tag) end |
Instance Method Details
#body ⇒ Object
41 42 43 |
# File 'lib/lighthouse/ticket.rb', line 41 def body attributes['body'] ||= '' end |
#body=(value) ⇒ Object
45 46 47 |
# File 'lib/lighthouse/ticket.rb', line 45 def body=(value) attributes['body'] = value end |
#body_html ⇒ Object
49 50 51 |
# File 'lib/lighthouse/ticket.rb', line 49 def body_html attributes['body_html'] ||= '' end |
#body_html=(value) ⇒ Object
53 54 55 |
# File 'lib/lighthouse/ticket.rb', line 53 def body_html=(value) attributes['body_html'] = value end |
#id ⇒ Object
31 32 33 34 |
# File 'lib/lighthouse/ticket.rb', line 31 def id attributes['number'] ||= nil number end |
#save_with_tags ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/lighthouse/ticket.rb', line 57 def self.tag = self..collect do |tag| tag.include?(' ') ? tag.inspect : tag end.join(" ") if self..is_a?(Array) self. = nil end |