Class: MailUp::Public::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/mailup/public/console.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ Console

Returns a new instance of Console.



6
7
8
# File 'lib/mailup/public/console.rb', line 6

def initialize(api)
    @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



4
5
6
# File 'lib/mailup/public/console.rb', line 4

def api
  @api
end

Instance Method Details

#new(account = {}) ⇒ JSON

Create a new trial console.

Examples:


account = {
  NameAndSurname: "Joe Public",
  Email: "[email protected]",
  Company: "ACME",
  PhoneNumber: "15555551212",
  Language: "En",
  IsUSA: true,
  RegisterToNewsletter: true
}
trial = mailup.public.console.new(account)
trial['id']
=> 1329874

Parameters:

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

    A hash of account attributes.

  • params (Hash)

    a customizable set of options

Returns:

  • (JSON)

    The trial console including:

    • Hash [String]

    • Id [Integer]

See Also:



41
42
43
# File 'lib/mailup/public/console.rb', line 41

def new( = {})
  @api.post("#{@api.path}/Console/TrialActivation", body: )
end

#status(account = {}) ⇒ JSON

Retrieve the information about current trial activation status.

Examples:


account = {
  Hash: "1k23hj432jh4kh3j24k",
  Id: "1324"
}
status = mailup.public.console.status(account)
status['Code']
=> 1234
status['Description']
=> "Status description..."

Parameters:

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

    A hash of account attributes.

  • params (Hash)

    a customizable set of options

Returns:

  • (JSON)

    An activation status object including:

    • Code [Integer]

    • Descriptin [String]

See Also:



69
70
71
# File 'lib/mailup/public/console.rb', line 69

def status( = {})
  @api.post("#{@api.path}/Console/TrialActivationStatus", body: )
end