Class: Locomotive::Coal::Resources::MyAccount

Inherits:
Struct
  • Object
show all
Includes:
Concerns::Request
Defined in:
lib/locomotive/coal/resources/my_account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Request

#delete, #do_request, #post, #put, #without_authentication

Instance Attribute Details

#credentialsObject

Returns the value of attribute credentials

Returns:

  • (Object)

    the current value of credentials



4
5
6
# File 'lib/locomotive/coal/resources/my_account.rb', line 4

def credentials
  @credentials
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



4
5
6
# File 'lib/locomotive/coal/resources/my_account.rb', line 4

def uri
  @uri
end

Instance Method Details

#create(attributes = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/locomotive/coal/resources/my_account.rb', line 12

def create(attributes = {})
  without_authentication do
    data = post('my_account', account: attributes)
    Resource.new(data)
  end
end

#getObject



8
9
10
# File 'lib/locomotive/coal/resources/my_account.rb', line 8

def get
  Resource.new(super('my_account'))
end

#update(attributes = {}) ⇒ Object



19
20
21
22
# File 'lib/locomotive/coal/resources/my_account.rb', line 19

def update(attributes = {})
  data = put('my_account', account: attributes)
  Resource.new(data)
end