Skip to content

Commit

Permalink
Placeholders && Initialisers
Browse files Browse the repository at this point in the history
  • Loading branch information
rbin committed Jun 10, 2014
1 parent 60ed3b9 commit 3cc7297
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
Contributors:

<!-- ##
## THIS IS HOW I WANNA USE IT.
# sg = sendgrid::Client.new("Myuser", "Mykey")
# m = sendgrid::Mail.new()
# m.to("[email protected]")
# sg.send(m)
## OR
# m = sendgrid::Mail.new(:to => "[email protected]", :from => "[email protected]")
# sg.send(m)
#
##
##
-->


# Sendgrid::Ruby

TODO: Write a gem description
Expand Down
2 changes: 2 additions & 0 deletions lib/sendgrid.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "faraday"

module SendGrid
class Client

Expand Down
43 changes: 14 additions & 29 deletions lib/sendgrid/mail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,51 @@
module SendGrid
class Mail

def initialize()
@endpoint = "/api/mail.send.json?"
def initialize(to)
@endpoint = "/api/mail.send.json"
end

attr_reader :to_email,
attr_accessor :endpoint, :to, :from, :subject, :text

def add_to(to_email)
#add stuff
@to = to_email
end

def add_tos(to_emails = {})
#add stuff
@tos = Array.new(10) { iii }
end

def add_to_name(name)
def add_to_name(to_name)
#add stuff
end

def add_to_names(names = {})
def add_to_names(to_names = {})
#add stuff
end

def set_from(from_email)
#add stuff
@from = from_email
end

def set_from_email(from_name)
#add stuff
end

def set_subject(subject)
#add stuff
@subject = subject
end

def set_text(text, format)
#add stuff
def set_text(text)
@text = text
end

def set_html(html, something = {}, inject(Array.new) { |arr, a| arr.push(*a) })
def set_html(html)
#add stuff
end

def set_x_smtpapi(json{})
# def set_x_smtpapi(json{})

end
# end

def add_bcc(bcc)
#add stuff
Expand Down Expand Up @@ -79,18 +79,3 @@ def add_headers(headers = {})

end
end




##
## THIS IS HOW I WANNA USE IT.
# sg = sendgrid.Client.new("Myuser", "Mykey")
# m = sendgrid.Mail.new()
# m.add_to("[email protected]")
# sg.send(m)

## OR

# m = sendgrid.Mail.new(:to => "[email protected]", :from => "[email protected]")
# sg.send(m)
1 change: 1 addition & 0 deletions sendgrid-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Gem::Specification.new do |gem|
gem.email = '[email protected]'
gem.homepage = 'http://github.com/sendgrid/sendgrid-ruby'

gem.add_development_dependency "faraday"
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec"
gem.add_development_dependency "rspec-nc"
Expand Down

0 comments on commit 3cc7297

Please sign in to comment.