Class: Artifactory::Collection::Base
- Inherits:
-
Object
- Object
- Artifactory::Collection::Base
- Defined in:
- lib/artifactory/collections/base.rb
Instance Method Summary collapse
-
#initialize(klass, parent, options = {}, &block) ⇒ Base
constructor
Create a new collection object (proxy).
-
#method_missing(m, *args, &block) ⇒ Object
Use method missing to delegate methods to the class object or instance object.
Constructor Details
#initialize(klass, parent, options = {}, &block) ⇒ Base
Create a new collection object (proxy).
31 32 33 34 35 36 |
# File 'lib/artifactory/collections/base.rb', line 31 def initialize(klass, parent, = {}, &block) @klass = klass @parent = parent @options = @block = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
Use method missing to delegate methods to the class object or instance object.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/artifactory/collections/base.rb', line 42 def method_missing(m, *args, &block) if klass.respond_to?(m) if args.last.is_a?(Hash) args.last.merge() end klass.send(m, *args, &block) else instance.send(m, *args, &block) end end |