Module: Conduit::Core::Driver
- Defined in:
- lib/conduit/core/driver.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#action(action_name) ⇒ Object
Set available actions.
-
#actions ⇒ Object
Storage array for required credentials.
-
#credentials ⇒ Object
Storage array for required credentials.
-
#required_credentials(*args) ⇒ Object
Set required credentials.
Class Method Details
.extended(base) ⇒ Object
24 25 26 27 |
# File 'lib/conduit/core/driver.rb', line 24 def self.extended(base) base.instance_variable_set("@_driver_path", File.dirname(caller.first[/^[^:]+/])) end |
Instance Method Details
#action(action_name) ⇒ Object
Set available actions
e.g.
> action :purchase
43 44 45 46 47 |
# File 'lib/conduit/core/driver.rb', line 43 def action(action_name) require File.join(@_driver_path, 'actions', action_name.to_s) require File.join(@_driver_path, 'parsers', action_name.to_s) actions << action_name end |
#actions ⇒ Object
Storage array for required credentials
e.g. Conduit::Driver::Fusion.actions
> [:purchase]
65 66 67 |
# File 'lib/conduit/core/driver.rb', line 65 def actions @actions ||= Set.new end |
#credentials ⇒ Object
Storage array for required credentials
e.g. Conduit::Driver::Fusion.credentials
> [:foo, :bar, :baz]
55 56 57 |
# File 'lib/conduit/core/driver.rb', line 55 def credentials @credentials ||= Set.new end |
#required_credentials(*args) ⇒ Object
Set required credentials
e.g.
> required_credentials :foo, :bar, :baz
34 35 36 |
# File 'lib/conduit/core/driver.rb', line 34 def required_credentials(*args) credentials.merge(args) end |