Class: LighthouseBranch
- Inherits:
- 
      Object
      
        - Object
- LighthouseBranch
 
- Defined in:
- lib/lighthouse_branch.rb
Instance Method Summary collapse
- #branch_name(id) ⇒ Object
- 
  
    
      #initialize(account, token, project_id)  ⇒ LighthouseBranch 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of LighthouseBranch. 
- #ticket(id) ⇒ Object
Constructor Details
#initialize(account, token, project_id) ⇒ LighthouseBranch
Returns a new instance of LighthouseBranch.
| 4 5 6 7 8 | # File 'lib/lighthouse_branch.rb', line 4 def initialize(account, token, project_id) Lighthouse.account = account Lighthouse.token = token @project = Lighthouse::Project.find(project_id) end | 
Instance Method Details
#branch_name(id) ⇒ Object
| 14 15 16 | # File 'lib/lighthouse_branch.rb', line 14 def branch_name(id) "#{id}-#{ticket(id).title.gsub(/[^\w ]/, '').gsub(/[^a-z0-9]+/i, '-').downcase}" end | 
#ticket(id) ⇒ Object
| 10 11 12 | # File 'lib/lighthouse_branch.rb', line 10 def ticket(id) Lighthouse::Ticket.find(id, :params => { :project_id => @project.id }) end |