Sha256: 0b7c8d6e8c04304f6bab9ece620a5a4e1c8b76149f83adc2d365ed7c46343528

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

require 'rails_trade/engine'
require 'rails_trade/config'

module RailsTrade

  def self.buyer_class
    @buyer_class
  end

  def self.buyer_class=(buyer)
    if @buyer_class&.name == buyer.name
      return
    elsif buyer.ancestors.include?(ActiveRecord::Base)
      @buyer_class = buyer
    elsif buyer.is_a?(Class)
      raise 'You can not include RailsTradeBuyer more than once'
    else
      raise 'You must assign an ActiveRecord class'
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_trade-0.0.1 lib/rails_trade.rb