Class: User

Inherits:
RestApi::Base show all
Includes:
Capabilities
Defined in:
app/models/user.rb

Overview

The REST API model object representing the currently authenticated user.

Instance Method Summary collapse

Methods included from Capabilities

#gear_sizes, #to_capabilities

Methods inherited from RestApi::Base

alias_attribute, aliased_attributes, allow_anonymous?, #as, #as=, #assign_attributes, attr_alters, #attributes=, calculated_attributes, #clone, configuration=, connection, custom_id, delete, #dup, #duplicate_errors, element_path, exception_for_code, find, find_one, get, #get, #has_exit_code?, headers, #initialize, #load, #load_remote_errors, on_exit_code, #raise_on_invalid, #reload, remote_errors_for, #remote_results, #save!, #save_with_change_tracking, shared_connection, singleton?, #to_json, translate_api_error, use_patch_on_update?, #valid?

Methods included from ActiveResource::Associations

#belongs_to, #has_many, #has_one

Constructor Details

This class inherits a constructor from RestApi::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RestApi::Base

Instance Method Details

#planObject



20
21
22
# File 'app/models/user.rb', line 20

def plan
  @plan ||= Aria::MasterPlan.cached.find plan_id
end

#plan=(plan) ⇒ Object



23
24
25
# File 'app/models/user.rb', line 23

def plan=(plan)
  @plan_id = plan.is_a?(String) ? plan : plan.id
end

#plan_idObject



16
17
18
# File 'app/models/user.rb', line 16

def plan_id
  super or 'freeshift'
end