Class: Bcash::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/bcash/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Notification

Returns a new instance of Notification.



5
6
7
8
9
# File 'lib/bcash/notification.rb', line 5

def initialize(params) 
  @params = params

  create_bcash_attrs
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/bcash/notification.rb', line 3

def params
  @params
end

Instance Method Details

#create_bcash_attrsObject



11
12
13
14
15
16
17
18
19
# File 'lib/bcash/notification.rb', line 11

def create_bcash_attrs
  @params.each do |key, value|
    self.instance_variable_set "@#{key}", value

    self.class.class_eval do
      attr_reader key
    end
  end
end