class Proposal::Adapter

Wrapper object for the ORM. In this case it only supports ActiveRecord. In theory you could write an Adapter for each different ORM then use the rails initializer to add.

Public Class Methods

new(options) click to toggle source
# File lib/proposal/engine.rb, line 15
def initialize options
  @options = options
end
where(options) click to toggle source

Delegates to ORM object and returns all proposal objects for given type.

# File lib/proposal/engine.rb, line 33
def self.where options
  Token.where options
end

Public Instance Methods

to(email, options = {}) click to toggle source

Method to return in instantiate the proposal object using an email address.

# File lib/proposal/engine.rb, line 28
def to email, options = {}
  Token.find_or_new @options.merge(options).merge email: email
end
with(arguments) click to toggle source
# File lib/proposal/engine.rb, line 19
def with arguments
  @options.merge! arguments: arguments
  self
end
Also aliased as: with_args
with_args(arguments)
Alias for: with