Class: Esendex::Account

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/xednese/account.rb,
lib/xednese/account/messages.rb,
lib/xednese/account/dispatcher.rb

Defined Under Namespace

Classes: Dispatcher, Messages

Instance Method Summary collapse

Constructor Details

#initialize(credentials, response) ⇒ Account

Returns a new instance of Account.



4
5
6
7
# File 'lib/xednese/account.rb', line 4

def initialize(credentials, response)
  @credentials = credentials
  @response = response
end

Instance Method Details

#dispatcherDispatcher



11
12
13
# File 'lib/xednese/account.rb', line 11

def dispatcher
  Dispatcher.new(@credentials, reference)
end

#labelObject



25
26
27
# File 'lib/xednese/account.rb', line 25

def label
  @label || @response.label
end

#label=(value) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/xednese/account.rb', line 29

def label=(value)
  request = Requests::Account.new(label: value)

  Client.put(@credentials, "v1.0/accounts/#{id}", request) do |code, body|
    @label = value
  end
end

#messagesMessages

Returns:



16
17
18
# File 'lib/xednese/account.rb', line 16

def messages
  Messages.new(@credentials, reference)
end