Class: PlanningCenter::Base
- Inherits:
-
Object
- Object
- PlanningCenter::Base
- Defined in:
- lib/planning_center/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attrs ⇒ Object
Returns the value of attribute attrs.
Instance Method Summary collapse
-
#initialize(attrs, client) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method_name, *args) ⇒ Object
- #respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
Constructor Details
#initialize(attrs, client) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/planning_center/base.rb', line 7 def initialize(attrs, client) @attrs = attrs @client = client end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
12 13 14 |
# File 'lib/planning_center/base.rb', line 12 def method_missing(method_name, *args) attrs.fetch(method_name.to_s) { super } end |
Instance Attribute Details
#attrs ⇒ Object
Returns the value of attribute attrs.
5 6 7 |
# File 'lib/planning_center/base.rb', line 5 def attrs @attrs end |
Instance Method Details
#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
16 17 18 |
# File 'lib/planning_center/base.rb', line 16 def respond_to_missing?(method_name, _include_private = false) attrs.key?(method_name.to_s) || super end |