Class: V2Intuity::Users::User
- Inherits:
-
Object
- Object
- V2Intuity::Users::User
- Defined in:
- lib/v2_intuity/users/user.rb
Instance Attribute Summary collapse
-
#applications ⇒ Object
Returns the value of attribute applications.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#devices ⇒ Object
Returns the value of attribute devices.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#validic_token ⇒ Object
Returns the value of attribute validic_token.
Instance Method Summary collapse
-
#get_marketplace(client, format_redirect = 'json', redirect_uri = V2Intuity::Endpoints::Marketplace::REDIRECT_URI) ⇒ Object
method finds the marketplace connected and disconnected json response.
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
-
#refresh_marketplace(client) ⇒ Object
method refreshes marketplace user token.
- #send_request(method, client) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ User
Returns a new instance of User.
7 8 9 10 11 12 |
# File 'lib/v2_intuity/users/user.rb', line 7 def initialize( = {}) @validic_token = .fetch(:validic_token, nil) @uid = .fetch(:uid, nil) @time_zone = .fetch(:location, nil) @country_code = .fetch(:country_code, nil) end |
Instance Attribute Details
#applications ⇒ Object
Returns the value of attribute applications.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def applications @applications end |
#country_code ⇒ Object
Returns the value of attribute country_code.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def country_code @country_code end |
#devices ⇒ Object
Returns the value of attribute devices.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def devices @devices end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def time_zone @time_zone end |
#uid ⇒ Object
Returns the value of attribute uid.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def uid @uid end |
#validic_token ⇒ Object
Returns the value of attribute validic_token.
4 5 6 |
# File 'lib/v2_intuity/users/user.rb', line 4 def validic_token @validic_token end |
Instance Method Details
#get_marketplace(client, format_redirect = 'json', redirect_uri = V2Intuity::Endpoints::Marketplace::REDIRECT_URI) ⇒ Object
method finds the marketplace connected and disconnected json response
30 31 32 33 34 35 36 |
# File 'lib/v2_intuity/users/user.rb', line 30 def get_marketplace(client, format_redirect = 'json', redirect_uri = V2Intuity::Endpoints::Marketplace::REDIRECT_URI) # marketplace user defined token raise 'validic token is required' unless validic_token endpoint, = (validic_token, format_redirect, redirect_uri) client.build_and_send_request(endpoint, ) end |
#refresh_marketplace(client) ⇒ Object
method refreshes marketplace user token.
20 21 22 23 24 25 26 27 |
# File 'lib/v2_intuity/users/user.rb', line 20 def refresh_marketplace(client) raise 'uid is required' unless uid = { method: V2Intuity::Request::METHODS[:post], id: uid } endpoint = V2Intuity::Endpoints::Marketplace.new client.build_and_send_request(endpoint, ) end |
#send_request(method, client) ⇒ Object
14 15 16 17 |
# File 'lib/v2_intuity/users/user.rb', line 14 def send_request(method, client) endpoint, = (method) client.build_and_send_request(endpoint, ) end |