Sha256: 82865c401a2de9de2edd77f84658d40456f66768f38da0d42c18ace2c75e7b60

Contents?: true

Size: 441 Bytes

Versions: 5

Compression:

Stored size: 441 Bytes

Contents

# frozen_string_literal: true

require_relative '../numeric_generator'

module Dagger
  module Generate
    # Generate an integer value from a format string
    #
    # _default.key:
    #   - integer: "#{key}"
    #   - integer:
    #     - "#{key}"
    #     - ...
    #   - integer:
    #       accumulate:
    class Integer < NumericGenerator
      private

      def from_s(string)
        string.to_f.round
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-dagger-0.4.0 lib/dagger/generate/integer.rb
ruby-dagger-0.3.3 lib/dagger/generate/integer.rb
ruby-dagger-0.3.2 lib/dagger/generate/integer.rb
ruby-dagger-0.3.1 lib/dagger/generate/integer.rb
ruby-dagger-0.3.0 lib/dagger/generate/integer.rb