Sha256: 37bcaa5f4370629755bdfa8a69fe8ea7a090d31d2801f8b582b25dd386e9a7f9

Contents?: true

Size: 277 Bytes

Versions: 4

Compression:

Stored size: 277 Bytes

Contents

module Cellularity
  class Iccid
    attr_accessor :iccid

    def initialize(iccid = '')
      self.iccid = iccid.to_s
    end

    def valid?
      [19, 20].include?(self.iccid.length) && !!Integer(self.iccid)
    rescue ArgumentError, TypeError
      false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cellularity-1.0.0 lib/cellularity/iccid.rb
cellularity-0.0.2.1 lib/cellularity/iccid.rb
cellularity-0.0.2 lib/cellularity/iccid.rb
cellularity-0.0.1 lib/cellularity/iccid.rb