Class: OneSignal::Responses::BaseResponse
- Inherits:
-
Object
- Object
- OneSignal::Responses::BaseResponse
- Defined in:
- lib/onesignal/responses/base_response.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BaseResponse
constructor
A new instance of BaseResponse.
Constructor Details
#initialize(attributes = {}) ⇒ BaseResponse
Returns a new instance of BaseResponse.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/onesignal/responses/base_response.rb', line 6 def initialize attributes = {} @attributes = attributes.deep_symbolize_keys .keep_if { |k, _v| self.class::ATTRIBUTES_WHITELIST.include?(k.to_sym) } self.class::ATTRIBUTES_WHITELIST.each do |attribute| self.class.send(:define_method, attribute) do @attributes[attribute] end end end |