Class: Bouncer::Activation

Inherits:
Object
  • Object
show all
Defined in:
lib/bouncer-client/activation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/bouncer-client/activation.rb', line 3

def created_at
  @created_at
end

#device_idObject

Returns the value of attribute device_id.



4
5
6
# File 'lib/bouncer-client/activation.rb', line 4

def device_id
  @device_id
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/bouncer-client/activation.rb', line 3

def id
  @id
end

#unit_idObject

Returns the value of attribute unit_id.



4
5
6
# File 'lib/bouncer-client/activation.rb', line 4

def unit_id
  @unit_id
end

#updated_atObject

Returns the value of attribute updated_at.



3
4
5
# File 'lib/bouncer-client/activation.rb', line 3

def updated_at
  @updated_at
end

#user_idObject

Returns the value of attribute user_id.



4
5
6
# File 'lib/bouncer-client/activation.rb', line 4

def user_id
  @user_id
end

Class Method Details

.from_json(json) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/bouncer-client/activation.rb', line 6

def self.from_json json
  activation = Activation.new
  json.keys.map do |key|
    activation.class.class_eval { attr_accessor key.to_sym }
    activation.send("#{key}=", json[key])
  end
  activation
end