-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
NoMethodError: private method `define_method' called for OneSignal::Notification::Headings:Class
error showing when I call
OneSignal::Notification::Headings.new(en: 'Hello!', it: 'Ciao!')
doing this in OneSignnal::Automap fixes it, is this the right way?
def create_readers **attributes
attributes.keys.each do |k|
self.class.send(:define_method, k) do
attributes[k]
end
end
end
Also in response
NoMethodError: private method `attr_reader' called for OneSignal::Responses::Notification:Class
usinng the mattr_reader instead attr_reader fixes it in OneSignal::Responses::BaseResponse. is this the right way?
def initialize attributes = {}
@attributes = attributes.deep_symbolize_keys
.keep_if { |k, _v| self.class::ATTRIBUTES_WHITELIST.include?(k.to_sym) }
self.class.mattr_reader(*self.class::ATTRIBUTES_WHITELIST)
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels