Class: Unfuddler::Project

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/unfuddler.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](name = nil) ⇒ Object



59
60
61
# File 'lib/unfuddler.rb', line 59

def self.[](name = nil)
  self.find(name)
end

.find(name = nil) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/unfuddler.rb', line 42

def self.find(name = nil)
  projects = []
  Unfuddler.get("projects.xml")["projects"].each do |project|
    projects << Project.new(project)
  end

  if name 
    right_project = nil
    projects.each do |project|
      right_project = project if project.short_name == name.to_s
    end
    return right_project
  end

  projects
end

Instance Method Details

#ticketObject



67
68
69
# File 'lib/unfuddler.rb', line 67

def ticket
  Ticket::Interacter.new(self.id)
end

#tickets(argument = nil) ⇒ Object



63
64
65
# File 'lib/unfuddler.rb', line 63

def tickets(argument = nil)
  Ticket.find(self.id, argument)
end