Class: PlanningCenter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/planning_center/base.rb

Direct Known Subclasses

Arrangement, Item, Organization, Plan, ServiceType

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attrsObject

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

Returns:

  • (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