Class: PostyClient::Resources::UserAlias

Inherits:
Base
  • Object
show all
Extended by:
FinderConcern
Defined in:
lib/posty_client/resources/user_alias.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #errors, #name, #new_resource

Class Method Summary collapse

Instance Method Summary collapse

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, #save, #update

Constructor Details

#initialize(user, name = nil) ⇒ UserAlias

Returns a new instance of UserAlias.



10
11
12
13
14
# File 'lib/posty_client/resources/user_alias.rb', line 10

def initialize(user, name=nil)
  @user = user
  @name = name
  load if name
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



8
9
10
# File 'lib/posty_client/resources/user_alias.rb', line 8

def user
  @user
end

Class Method Details

.resource_nameObject



24
25
26
# File 'lib/posty_client/resources/user_alias.rb', line 24

def self.resource_name
  :aliases
end

Instance Method Details

#resource_slugObject



20
21
22
# File 'lib/posty_client/resources/user_alias.rb', line 20

def resource_slug
  [user.slug, 'aliases'].join('/')
end

#slugObject



16
17
18
# File 'lib/posty_client/resources/user_alias.rb', line 16

def slug
  [resource_slug, name].join('/')
end