Class: Minglr::Action::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/minglr/action.rb

Class Method Summary collapse

Class Method Details

.attach(options, flag_options, config) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/minglr/action.rb', line 29

def self.attach(options, flag_options, config)
  raise "Missing card number!" if options.empty?
  
  card_number = options.first
  file_name = flag_options[:file_attachment]
  Resources::Attachment.attach(card_number, file_name, config[:username], config[:password])
end

.card(options, flag_options, config) ⇒ Object



37
38
39
40
41
42
# File 'lib/minglr/action.rb', line 37

def self.card(options, flag_options, config)
  raise "Missing card number!" if options.empty?
  
  card_number = options.first
  Resources::Card.print_card(card_number, config[:status_property])
end

.cards(options, flag_options, config) ⇒ Object



44
45
46
# File 'lib/minglr/action.rb', line 44

def self.cards(options, flag_options, config)
  Resources::Card.print_all(options, config[:status_property])
end

.create(options, flag_options, config) ⇒ Object



48
49
50
# File 'lib/minglr/action.rb', line 48

def self.create(options, flag_options, config)
  Resources::Card.create(flag_options, config[:status_property])
end

.fetch(options, flag_options, config) ⇒ Object



52
53
54
55
56
57
# File 'lib/minglr/action.rb', line 52

def self.fetch(options, flag_options, config)
  raise "Missing card number!" if options.empty?
  
  card_number = options.first
  Resources::Attachment.fetch(card_number, config[:username], config[:password])
end

.move(options, flag_options, config) ⇒ Object



59
60
61
62
63
64
# File 'lib/minglr/action.rb', line 59

def self.move(options, flag_options, config)
  raise "Missing card number!" if options.empty?
  
  card_number = options.first
  Resources::Card.move(card_number, flag_options, config)
end

.projects(options, flag_options, config) ⇒ Object



66
67
68
# File 'lib/minglr/action.rb', line 66

def self.projects(options, flag_options, config)
  Resources::Project.print_all(options, config[:status_property])
end

.update(options, flag_options, config) ⇒ Object



70
71
72
73
74
75
# File 'lib/minglr/action.rb', line 70

def self.update(options, flag_options, config)
  raise "Missing card number!" if options.empty?
  
  card_number = options.first
  Resources::Card.update(card_number, flag_options)
end

.users(options, flag_options, config) ⇒ Object



77
78
79
# File 'lib/minglr/action.rb', line 77

def self.users(options, flag_options, config)
  Resources::User.print_all(options)
end