Sha256: 2fe8dea65966bae20eef71cfeca6c6429de0cb34ddb4e081678cba53af6ca28a

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

# frozen_string_literal: true

module SSHTunnel
  module UI
    module Forms
      class HostForm < ApplicationForm

        attribute :name, required: true
        attribute :user, required: true
        attribute :host, required: true
        attribute :port, required: true
        attribute :identity_file

        validates_inclusion_of :port, in: 0..65_535

        # Callbacks
        before_validation :cast_port_to_int


        def cast_port_to_int
          self.port = cast_to_int(port)
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ssh-hull-2.0 lib/ssh-hull/ui/forms/host_form.rb
ssh-hull-1.0.0 lib/ssh-hull/ui/forms/host_form.rb