Class: Minglr::Action
- Inherits:
-
Object
- Object
- Minglr::Action
- Defined in:
- lib/minglr/action.rb
Defined Under Namespace
Classes: Commands
Class Method Summary collapse
- .execute(action, options = [], flag_options = {}, config = {}) ⇒ Object
- .valid_action?(action) ⇒ Boolean
- .valid_actions ⇒ Object
Class Method Details
.execute(action, options = [], flag_options = {}, config = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/minglr/action.rb', line 5 def self.execute(action, = [], = {}, config = {}) if action.to_s == [0] .shift else .shift .shift end begin Commands.send(action, , , config) rescue ActiveResource::ResourceNotFound => error puts error. + " for URL '#{Resources::Base.site}' ..." end end |
.valid_action?(action) ⇒ Boolean
23 24 25 |
# File 'lib/minglr/action.rb', line 23 def self.valid_action?(action) valid_actions.include? action end |
.valid_actions ⇒ Object
19 20 21 |
# File 'lib/minglr/action.rb', line 19 def self.valid_actions Commands.methods(false) end |