Sha256: edbe169d3c9fcacb415f381cfa01d855d4823e51db79e2613347f6ad8438c83f

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

module AffiliateWindow::Helpers

  # Helper methods for client classes.
  module Client

    def parse_options(options)
      set_account(options.delete(:account))
      options.each do |k, v|
        if respond_to?(k)
          instance_variable_set("@#{k}", v)
        else
          raise ArgumentError, "Unknown option #{k}."
        end
      end
    end

    def fetch(target = Tempfile.new('awin').path)
      AffiliateWindow.fetch(url, target)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
affiliate-window-0.2.1.pre1 lib/affiliate-window/helpers/client.rb