Class: SendgridCli::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid_cli/interface.rb

Direct Known Subclasses

SpamReport

Instance Method Summary collapse

Constructor Details

#initialize(user, pass) ⇒ Interface

Returns a new instance of Interface.



5
6
7
8
9
10
11
# File 'lib/sendgrid_cli/interface.rb', line 5

def initialize(user, pass)
  @api_user = user
  @api_pass = pass
  if @api_pass.nil? || @api_user.nil?
    raise "Please configure gem before use. Try 'help' for usage."
  end
end

Instance Method Details

#delete(command, email) ⇒ Object



18
19
20
# File 'lib/sendgrid_cli/interface.rb', line 18

def delete(command, email)
  query_api(command, 'delete', email)
end

#get(command, email = nil) ⇒ Object



14
15
16
# File 'lib/sendgrid_cli/interface.rb', line 14

def get(command, email=nil)
  query_api(command, 'get', email)
end