Sha256: 8433bcd6ea35b8e66cc19edd827d62ed3d6e8bdc225e31bf4e57869a2985b0eb

Contents?: true

Size: 549 Bytes

Versions: 19

Compression:

Stored size: 549 Bytes

Contents

module Fontist
  class StyleVersion
    def initialize(text)
      @text = text
    end

    def value
      @value ||= numbers || default_value
    end

    def numbers
      string_version&.split(".")&.map(&:strip)
    end

    def string_version
      @text&.split(";")&.first
    end

    def default_value
      ["0"]
    end

    def <=>(other)
      value <=> other.value
    end

    def ==(other)
      value == other.value
    end

    def eql?(other)
      value.eql?(other.value)
    end

    def hash
      value.hash
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
fontist-1.20.0 lib/fontist/style_version.rb
fontist-1.19.0 lib/fontist/style_version.rb
fontist-1.18.2 lib/fontist/style_version.rb
fontist-1.17.1 lib/fontist/style_version.rb
fontist-1.17.0 lib/fontist/style_version.rb
fontist-1.16.0 lib/fontist/style_version.rb
fontist-1.15.2 lib/fontist/style_version.rb
fontist-1.15.1 lib/fontist/style_version.rb
fontist-1.15.0 lib/fontist/style_version.rb
fontist-1.14.6 lib/fontist/style_version.rb
fontist-1.14.5 lib/fontist/style_version.rb
fontist-1.14.4 lib/fontist/style_version.rb
fontist-1.14.3 lib/fontist/style_version.rb
fontist-1.14.2 lib/fontist/style_version.rb
fontist-1.14.1 lib/fontist/style_version.rb
fontist-1.14.0 lib/fontist/style_version.rb
fontist-1.13.2 lib/fontist/style_version.rb
fontist-1.13.1 lib/fontist/style_version.rb
fontist-1.13.0 lib/fontist/style_version.rb