Sha256: 1c43a58a00c99c048885c02f86a0d425f68a7450d474f6e1c8ed2d7bc58e9bc3

Contents?: true

Size: 539 Bytes

Versions: 3

Compression:

Stored size: 539 Bytes

Contents

require "jan/version"
require "jan/parser"
require "jan/check_digit_calculator"
require "jan/validator"
require "jan/random"

class Jan
  InstorePrefixes = %w(02 20 21 22 23 24 25 26 27 28 29)

  attr_accessor :code

  def initialize(code)
    @code = code
  end

  def valid?
    Validator.validate(@code)
  end

  def check_digit
    Parser.check_digit(@code)
  end

  def even_digits
    Parser.even_digits(@code)
  end

  def odd_digits
    Parser.odd_digits(@code)
  end

  def instore_code?
    Parser.instore_code?(@code)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jan-0.0.3 lib/jan.rb
jan-0.0.2 lib/jan.rb
jan-0.0.1 lib/jan.rb