Module: Remotely
- Defined in:
- lib/remotely.rb,
lib/remotely/model.rb,
lib/remotely/version.rb,
lib/remotely/collection.rb,
lib/remotely/application.rb,
lib/remotely/associations.rb,
lib/remotely/http_methods.rb
Defined Under Namespace
Modules: Associations, HTTPMethods Classes: Application, Collection, HasManyForeignKeyError, Model, NonJsonResponseError, RemoteAppError, RemotelyError, URLHostError
Constant Summary collapse
- VERSION =
"0.2.2"
Class Method Summary collapse
-
.app(name, url = nil, &block) ⇒ Object
Register an application with Remotely.
-
.apps ⇒ Hash
Registered application configurations.
-
.configure(&block) ⇒ Object
Configure applications to be used by models.
-
.reset! ⇒ Object
Clear all registered apps.
Class Method Details
.app(name, url = nil, &block) ⇒ Object
Register an application with Remotely.
68 69 70 71 72 73 74 |
# File 'lib/remotely.rb', line 68 def app(name, url=nil, &block) if !url && block_given? apps[name] = Application.new(name, &block) else apps[name] = Application.new(name) { url(url) } end end |
.apps ⇒ Hash
Returns Registered application configurations.
44 45 46 |
# File 'lib/remotely.rb', line 44 def apps @apps ||= {} end |
.configure(&block) ⇒ Object
Configure applications to be used by models. Accepts a block which specifies multiple apps via the ‘app` method.
58 59 60 |
# File 'lib/remotely.rb', line 58 def configure(&block) instance_eval(&block) end |
.reset! ⇒ Object
Clear all registered apps
78 79 80 |
# File 'lib/remotely.rb', line 78 def reset! @apps = {} end |