Class: Access::User
- Inherits:
-
Object
- Object
- Access::User
- Defined in:
- lib/access/user.rb
Class Method Summary collapse
- .authenticate(options = {}) ⇒ Object
- .authenticate_by_cvt(options = {}) ⇒ Object
- .authenticate_by_member_key(options = {}) ⇒ Object
- .process_batch(chunk) ⇒ Object
- .register(options = {}) ⇒ Object
- .update(options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(values) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(values) ⇒ User
Returns a new instance of User.
8 9 10 11 12 13 |
# File 'lib/access/user.rb', line 8 def initialize(values) self.class.class_eval {attr_reader *values.keys } values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end end |
Class Method Details
.authenticate(options = {}) ⇒ Object
23 24 25 |
# File 'lib/access/user.rb', line 23 def self.authenticate( = {}) Access::Api.new.user_authentication end |
.authenticate_by_cvt(options = {}) ⇒ Object
27 28 29 |
# File 'lib/access/user.rb', line 27 def self.authenticate_by_cvt( = {}) Access::Api.new.user_authentication_by_cvt end |
.authenticate_by_member_key(options = {}) ⇒ Object
31 32 33 |
# File 'lib/access/user.rb', line 31 def self.authenticate_by_member_key( = {}) Access::Api.new.user_authentication_by_member_key end |
.process_batch(chunk) ⇒ Object
4 5 6 |
# File 'lib/access/user.rb', line 4 def self.process_batch(chunk) chunk.map { |user| new(user) } end |
.register(options = {}) ⇒ Object
15 16 17 |
# File 'lib/access/user.rb', line 15 def self.register( = {}) Access::Api.new.user_registration end |
.update(options = {}) ⇒ Object
19 20 21 |
# File 'lib/access/user.rb', line 19 def self.update( = {}) Access::Api.new.user_update end |