Class: Puffer::Controller::Config::Config
- Inherits:
-
Object
- Object
- Puffer::Controller::Config::Config
- Defined in:
- lib/puffer/controller/config.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(controller) ⇒ Config
constructor
A new instance of Config.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(controller) ⇒ Config
Returns a new instance of Config.
59 60 61 |
# File 'lib/puffer/controller/config.rb', line 59 def initialize controller @controller = controller end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/puffer/controller/config.rb', line 63 def method_missing method, *args, &block method_name = "_puffer_attribute_#{method}" if args.present? && controller.respond_to?("#{method_name}=") controller.send "#{method_name}=", args.first elsif controller.respond_to?(method_name) controller.send method_name else super end end |
Instance Attribute Details
#controller ⇒ Object
Returns the value of attribute controller.
57 58 59 |
# File 'lib/puffer/controller/config.rb', line 57 def controller @controller end |