Class: Rlaunchpadlib::ProjectGroup

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rlaunchpadlib/project_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group) ⇒ ProjectGroup

Returns a new instance of ProjectGroup.



11
12
13
14
# File 'lib/rlaunchpadlib/project_group.rb', line 11

def initialize(group)
    @group = group
    @client = Rlaunchpadlib::Client.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object

I’m nuts so lets patch method missing.



37
38
39
# File 'lib/rlaunchpadlib/project_group.rb', line 37

def method_missing(name, *args, &block)
  overview.has_key?(name.to_s) ? overview[name.to_s] : super
end

Instance Attribute Details

#groupObject

Returns the value of attribute group.



8
9
10
# File 'lib/rlaunchpadlib/project_group.rb', line 8

def group
  @group
end

#overview_dataObject

Returns the value of attribute overview_data.



9
10
11
# File 'lib/rlaunchpadlib/project_group.rb', line 9

def overview_data
  @overview_data
end

Instance Method Details

#branchesObject



32
33
34
# File 'lib/rlaunchpadlib/project_group.rb', line 32

def branches
    @client.get(@group, 'getBranches')
end

#bugsObject



24
25
26
# File 'lib/rlaunchpadlib/project_group.rb', line 24

def bugs
    @client.get(@group, 'searchTasks')
end

#merge_proposalsObject



28
29
30
# File 'lib/rlaunchpadlib/project_group.rb', line 28

def merge_proposals
    @client.get(@group, 'getMergeProposals')
end

#overviewObject



16
17
18
19
20
21
22
# File 'lib/rlaunchpadlib/project_group.rb', line 16

def overview
     if @overview_data.nil?
        @client.get(@group)
    else
        @overview_data
    end
end