Class: Twitter::ActionFactory
- Inherits:
-
Object
- Object
- Twitter::ActionFactory
- Defined in:
- lib/twitter/action_factory.rb
Class Method Summary collapse
-
.new(action = {}) ⇒ Twitter::Favorite, ...
Instantiates a new action object.
Class Method Details
.new(action = {}) ⇒ Twitter::Favorite, ...
Instantiates a new action object
18 19 20 21 22 23 24 25 |
# File 'lib/twitter/action_factory.rb', line 18 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 |