Module: Sendgrid

Extended by:
Sendgrid
Included in:
Sendgrid
Defined in:
lib/sendgrid.rb,
lib/sendgrid/version.rb

Defined Under Namespace

Classes: List, Recipient

Constant Summary collapse

VERSION =
"1.1.0"

Instance Method Summary collapse

Instance Method Details

#config(&block) ⇒ Object



15
16
17
# File 'lib/sendgrid.rb', line 15

def config(&block)
  instance_eval &block
end

#parameter(*names) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/sendgrid.rb', line 4

def parameter(*names)
  names.each do |name|
    attr_accessor name

    define_method name do |*values|
      value = values.first
      value ? self.send("#{name}=", value) : instance_variable_get("@#{name}")
    end
  end
end