Module: MM::API

Defined in:
lib/mm.rb

Instance Method Summary collapse

Instance Method Details

#create_transition_execution(attrs) ⇒ Object



51
52
53
54
# File 'lib/mm.rb', line 51

def create_transition_execution(attrs)
  init(Resource::TransitionExecution)
  Resource::TransitionExecution.create(attrs)
end

#execute_cmd(cmd) ⇒ Object



75
76
77
# File 'lib/mm.rb', line 75

def execute_cmd(cmd)
  %x[#{cmd}]
end

#favoritesObject



46
47
48
49
# File 'lib/mm.rb', line 46

def favorites
  init(Resource::Favorite)
  Resource::Favorite.find(:all)
end

#find_card(options) ⇒ Object



56
57
58
59
# File 'lib/mm.rb', line 56

def find_card(options)
  init(Resource::Card)
  Resource::Card.find(:first, options)
end

#find_card_by_number(number) ⇒ Object



61
62
63
64
# File 'lib/mm.rb', line 61

def find_card_by_number(number)
  init(Resource::Card)
  Resource::Card.find(number)
end

#find_cards(options) ⇒ Object



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

def find_cards(options)
  init(Resource::Card)
  Resource::Card.find(:all, :params => options)
end

#init(klass) ⇒ Object



71
72
73
# File 'lib/mm.rb', line 71

def init(klass)
  Command::Init.new.do_once(klass)
end

#property_definitionsObject



40
41
42
43
44
# File 'lib/mm.rb', line 40

def property_definitions
  return @property_definitions if defined?(@property_definitions)
  init(Resource::PropertyDefinition)
  @property_definitions = Resource::PropertyDefinition.find(:all)
end

#team_membersObject



34
35
36
37
38
# File 'lib/mm.rb', line 34

def team_members
  return @team_members if defined?(@team_members)
  init(Resource::User)
  @team_members = Resource::User.find(:all)
end