Class: MM::API

Inherits:
Object
  • Object
show all
Includes:
Mingle
Defined in:
lib/mm/api.rb,
lib/mm/api/mingle.rb

Defined Under Namespace

Modules: Mingle

Instance Method Summary collapse

Methods included from Mingle

#card_transitions, #create_transition_execution, #favorites, #find_card, #find_card_by_number, #find_cards, #property_definitions, #team_members

Constructor Details

#initialize(runtime = {}) ⇒ API

Returns a new instance of API.



7
8
9
# File 'lib/mm/api.rb', line 7

def initialize(runtime={})
  @runtime = runtime
end

Instance Method Details

#execute_cmd(cmd) ⇒ Object



11
12
13
14
# File 'lib/mm/api.rb', line 11

def execute_cmd(cmd)
  output = %x[#{cmd}]
  [$?.exitstatus, output]
end

#init(klass) ⇒ Object



16
17
18
19
20
# File 'lib/mm/api.rb', line 16

def init(klass)
  raise "Please setup a variable named 'site' for your project. \n - Example: site = 'http://login:[email protected]/projects/project_identifier'" if @runtime[:site].blank?
  
  klass.site = @runtime[:site]
end

#renewObject



22
23
24
# File 'lib/mm/api.rb', line 22

def renew
  self.class.new(@runtime)
end

#to_sObject



26
27
28
# File 'lib/mm/api.rb', line 26

def to_s
  Mingle.instance_methods.join("\n")
end