Sha256: 0f944f0aefcb3034d6bfb8c9b6b6764682efb4027fbc3293db57e13c71b88f12

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 Bytes

Contents

module Net
  module NTLM

    class String < Field
      def initialize(opts)
        super(opts)
        @size = opts[:size]
      end

      def parse(str, offset=0)
        if @active and str.size >= offset + @size
          @value = str[offset, @size]
          @size
        else
          0
        end
      end

      def serialize
        if @active
          @value.to_s
        else
          ""
        end
      end

      def value=(val)
        @value = val
        @size = @value.nil? ? 0 : @value.size
        @active = (@size > 0)
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rubyntlm-0.6.1/lib/net/ntlm/string.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
rubyntlm-0.6.1 lib/net/ntlm/string.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rubyntlm-0.6.0/lib/net/ntlm/string.rb
rubyntlm-0.6.0 lib/net/ntlm/string.rb