Sha256: 550f432ac99037dec53eecfa04fbb83e28170f77c869856f10fbb08958204f5d

Contents?: true

Size: 392 Bytes

Versions: 14

Compression:

Stored size: 392 Bytes

Contents

module Faker
  module Amazon
    class << self
      def asin
        raw = 9.times.map { rand(10).to_s }
        (raw << Bookland::ISBN.new.send(:check_digit_10, raw)).join
      end

      def ean
        Bookland::ISBN.to_13(asin)
      end

      def merchant_id
        seed = ('A'..'Z').to_a + (0..9).to_a
        14.times.map { seed[rand(seed.size)] }.join
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
fassbinder-0.0.1 spec/support/faker.rb
kosher-0.1.12 spec/support/faker.rb
kosher-0.1.11 spec/support/faker.rb
kosher-0.1.10 spec/support/faker.rb
kosher-0.1.9 spec/support/faker.rb
kosher-0.1.8 spec/support/faker.rb
kosher-0.1.7 spec/support/faker.rb
kosher-0.1.6 spec/support/faker.rb
kosher-0.1.5 spec/support/faker.rb
kosher-0.1.4 spec/support/faker.rb
kosher-0.1.3 spec/support/faker.rb
kosher-0.1.2 spec/support/faker.rb
kosher-0.1.1 spec/support/faker.rb
kosher-0.1.0 spec/support/faker.rb