Class: HelpScout::User
- Defined in:
- lib/help_scout/user.rb
Constant Summary collapse
- BASIC_ATTRIBUTES =
%i[ id first_name last_name email created_at updated_at role timezone type photoUrl ].freeze
Instance Attribute Summary collapse
-
#hrefs ⇒ Object
readonly
Returns the value of attribute hrefs.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ User
constructor
A new instance of User.
Methods included from Getable
Methods included from Listable
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ User
Returns a new instance of User.
24 25 26 27 28 29 30 31 32 |
# File 'lib/help_scout/user.rb', line 24 def initialize(params = {}) BASIC_ATTRIBUTES.each do |attribute| next unless params[attribute] instance_variable_set("@#{attribute}", params[attribute]) end @hrefs = HelpScout::Util.map_links(params[:_links]) end |
Instance Attribute Details
#hrefs ⇒ Object (readonly)
Returns the value of attribute hrefs.
22 23 24 |
# File 'lib/help_scout/user.rb', line 22 def hrefs @hrefs end |