Sha256: 19bf6dc91b55394114b1562047e286b6f94e96ead6ce4eaa73edddab7d8a6db1

Contents?: true

Size: 865 Bytes

Versions: 3

Compression:

Stored size: 865 Bytes

Contents

module Vx
  module Builder
    class BuildConfiguration
      class Vexor

        attr_reader :attributes

        def initialize(new_attributes)
          normalize_attributes(new_attributes)
        end

        def timeout
          tm = @attributes["timeout"].to_i
          tm.to_i > 0 ? tm.to_i : nil
        end

        def read_timeout
          tm = @attributes["read_timeout"].to_i
          tm.to_i > 0 ? tm.to_i : nil
        end

        private

          def normalize_attributes(new_attributes)

            @attributes =
              case new_attributes
              when Hash
                {
                  "timeout"      => new_attributes["timeout"],
                  "read_timeout" => new_attributes["read_timeout"],
                }
              else
                {}
              end

          end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vx-builder-0.3.7 lib/vx/builder/build_configuration/vexor.rb
vx-builder-0.3.6 lib/vx/builder/build_configuration/vexor.rb
vx-builder-0.3.5 lib/vx/builder/build_configuration/vexor.rb