Class: PostyClient::Resources::User
- Extended by:
- FinderConcern
- Defined in:
- lib/posty_client/resources/user.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
Attributes inherited from Base
#attributes, #errors, #name, #new_resource
Instance Method Summary collapse
- #aliases ⇒ Object
-
#initialize(domain, name = nil) ⇒ User
constructor
A new instance of User.
- #resource_slug ⇒ Object
- #slug ⇒ Object
Methods included from FinderConcern
find_all_by_domain, find_all_by_user
Methods inherited from Base
#create, #delete, #load, #new_resource?, #request_with_error_handling, #resource_name, resource_name, #save, #update
Constructor Details
#initialize(domain, name = nil) ⇒ User
Returns a new instance of User.
10 11 12 13 14 |
# File 'lib/posty_client/resources/user.rb', line 10 def initialize(domain, name=nil) @name = name @domain = domain load if name end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/posty_client/resources/user.rb', line 8 def domain @domain end |
Instance Method Details
#aliases ⇒ Object
16 17 18 |
# File 'lib/posty_client/resources/user.rb', line 16 def aliases UserAlias.find_all_by_user(self) end |
#resource_slug ⇒ Object
24 25 26 |
# File 'lib/posty_client/resources/user.rb', line 24 def resource_slug [domain.slug, 'users'].join('/') end |
#slug ⇒ Object
20 21 22 |
# File 'lib/posty_client/resources/user.rb', line 20 def slug [resource_slug, name].join('/') end |