Class: ActiveZone::Zone
- Inherits:
-
Object
- Object
- ActiveZone::Zone
- Defined in:
- lib/active_zone/zone.rb
Overview
Proxy class for easily accessing Provider::Zone at the current Provider
Defined Under Namespace
Modules: Builtins
Class Method Summary collapse
-
.method_missing(method_name, *arguments, &block) ⇒ Object
Delegate class methods to current [Provider::Zone].
-
.respond_to_missing?(method_name, include_private = false) ⇒ TrueClass, FalseClass
Delegate class methods to current [Provider::Zone].
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Zone
constructor
A new instance of Zone.
-
#method_missing(method_name) ⇒ Object
Delegate to Provider::Zone.
-
#respond_to_missing?(method_name, include_private = false) ⇒ TrueClass, FalseClass
Delegate to Provider::Zone.
Constructor Details
#initialize(**attributes) ⇒ Zone
Returns a new instance of Zone.
5 6 7 |
# File 'lib/active_zone/zone.rb', line 5 def initialize(**attributes) @zone = ActiveZone.provider.Zone.new(**attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
Delegate to Provider::Zone
10 11 12 |
# File 'lib/active_zone/zone.rb', line 10 def method_missing(method_name, *, &) @zone.send(method_name, *, &) end |
Class Method Details
.method_missing(method_name, *arguments, &block) ⇒ Object
Delegate class methods to current [Provider::Zone]
21 22 23 24 25 |
# File 'lib/active_zone/zone.rb', line 21 def self.method_missing(method_name, *arguments, &block) ActiveZone.provider.Zone.with_provider(ActiveZone.provider) do |z| z.send(method_name, *arguments, &block) end end |
.respond_to_missing?(method_name, include_private = false) ⇒ TrueClass, FalseClass
Delegate class methods to current [Provider::Zone]
29 30 31 |
# File 'lib/active_zone/zone.rb', line 29 def self.respond_to_missing?(method_name, include_private = false) ActiveZone.provider.Zone.respond_to?(method_name, include_private) end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ TrueClass, FalseClass
Delegate to Provider::Zone
16 17 18 |
# File 'lib/active_zone/zone.rb', line 16 def respond_to_missing?(method_name, include_private = false) @zone.respond_to?(method_name, include_private) end |