Class: GitlabJanitor::BaseCleaner::Model
- Inherits:
-
Object
- Object
- GitlabJanitor::BaseCleaner::Model
- Defined in:
- lib/gitlab_janitor/base_cleaner.rb
Direct Known Subclasses
ContainerCleaner::Model, ImageCleaner::Model, VolumeCleaner::Model
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model) ⇒ Model
constructor
A new instance of Model.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to?(*args) ⇒ Boolean
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(model) ⇒ Model
Returns a new instance of Model.
8 9 10 |
# File 'lib/gitlab_janitor/base_cleaner.rb', line 8 def initialize(model) @model = model end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/gitlab_janitor/base_cleaner.rb', line 12 def method_missing(method, *args, &block) super unless model.respond_to?(method) model.send(method, *args, &block) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/gitlab_janitor/base_cleaner.rb', line 6 def model @model end |
Instance Method Details
#respond_to?(*args) ⇒ Boolean
18 19 20 |
# File 'lib/gitlab_janitor/base_cleaner.rb', line 18 def respond_to?(*args) model.send(:respond_to?, *args) || super end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
22 23 24 |
# File 'lib/gitlab_janitor/base_cleaner.rb', line 22 def respond_to_missing?(method_name, include_private = false) model.send(:respond_to_missing?, method_name, include_private) || super end |