Sha256: 442c032e3ebcc8c626384aa1e3e689d8e0de1c93041d62e2febe1b2d2affa836

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

module Mailstro
  class Delivery < Resource
    attr_reader :email_name

    def initialize(email_name, options)
      @email_name = email_name
      @options    = options
    end

    def to
      @options.fetch(:to)
    end

    def data
      @options.fetch(:data, nil)
    end

    def deliver
      post("deliveries",
           :to         => to,
           :email_name => email_name,
           :data       => data
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mailstro-0.1.0 lib/mailstro/delivery.rb
mailstro-0.0.10 lib/mailstro/delivery.rb