Module: Droppper::Actions
Instance Method Summary collapse
- #action(action_id) ⇒ Object
- #actions(args) ⇒ Object
- #list(*args) ⇒ Object
- #status(action_id) ⇒ Object
Instance Method Details
#action(action_id) ⇒ Object
26 27 28 |
# File 'lib/droppper/actions.rb', line 26 def action(action_id) Droppper.client.actions.find id: action_id end |
#actions(args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/droppper/actions.rb', line 15 def actions(args) pr = Droppper.client.actions.all(page:1, per_page: 25) pr.each data = pr.collection if args.size > 0 re = Regexp.new(Array(args).join(".*")) data = data.select{|i| i.id.to_s=~re or i.status=~re or i.type=~re or i.resource_type=~re} end data end |
#list(*args) ⇒ Object
5 6 7 8 |
# File 'lib/droppper/actions.rb', line 5 def list(*args) data = actions(args) tp data, :id, :status, :type, :started_at, :completed_at, :resource_id, :resource_type, :region_slug end |
#status(action_id) ⇒ Object
10 11 12 13 |
# File 'lib/droppper/actions.rb', line 10 def status(action_id) act = action(action_id) puts act.inspect end |