Class: SerwerSMS::Resources::Accounts

Inherits:
Object
  • Object
show all
Defined in:
lib/serwersms/resources/accounts.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Accounts

Returns a new instance of Accounts.



4
5
6
# File 'lib/serwersms/resources/accounts.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#add(params = {}) ⇒ Hash

Register new account

Parameters:

  • params (Hash) (defaults to: {})

    @option params [String] :phone @option params [String] :email @option params [String] :first_name @option params [String] :last_name @option params [String] :company

Returns:

  • (Hash)

    @option return [Boolean] :success



18
19
20
# File 'lib/serwersms/resources/accounts.rb', line 18

def add(params = {})
  @client.call('account/add', params)
end

#help(params = {}) ⇒ Hash

Return contact details

Returns:

  • (Hash)

    @option return [String] :telephone @option return [String] :email @option return [String] :form @option return [String] :faq @option return [Hash] :guardian_account @option guardian_account [String] :name @option guardian_account [String] :email @option guardian_account [String] :telephone @option guardian_account [String] :photo



45
46
47
# File 'lib/serwersms/resources/accounts.rb', line 45

def help(params = {})
  @client.call('account/help', params)
end

#limits(params = {}) ⇒ Hash

Return SMS limits for account

Returns:

  • (Hash)

    @option return [Array] :items @option item [String] :type Type of message @option item [String] :chars_limit Maximum length of message @option item [String] :value Limit messages



29
30
31
# File 'lib/serwersms/resources/accounts.rb', line 29

def limits(params = {})
  @client.call('account/limits', params)
end

#messages(params = {}) ⇒ Hash

Return messages from the administrator

Returns:

  • (Hash)

    @option return [Boolean] :new Marking unread message @option return [String] :message



54
55
56
# File 'lib/serwersms/resources/accounts.rb', line 54

def messages(params = {})
  @client.call('account/messages', params)
end