Class: Twitter::ActionFactory
- Inherits:
-
Object
- Object
- Twitter::ActionFactory
- Defined in:
- lib/twitter/action_factory.rb
Class Method Summary (collapse)
-
+ (Twitter::Favorite, ...) new(action = {})
Instantiates a new action object.
Class Method Details
+ (Twitter::Favorite, ...) new(action = {})
Instantiates a new action object
17 18 19 20 21 22 23 24 |
# File 'lib/twitter/action_factory.rb', line 17 def self.new(action={}) type = action.delete('action') if type Twitter.const_get(type.camelize.to_sym).new(action) else raise ArgumentError, "argument must have an 'action' key" end end |