Sha256: f2b1d6cae2b5c0df635ebee92e2bd2d624eff2d21badda2e1fb54566d1e46d7f

Contents?: true

Size: 615 Bytes

Versions: 10

Compression:

Stored size: 615 Bytes

Contents

module Euston
  class CommandHeaders
    attr_reader :id, :type, :version, :log_completion

    def initialize id, type, version, log_completion = false
      @id = id
      @type = type
      @version = version
      @log_completion = log_completion
    end

    def to_hash
      {
        :id => id,
        :type => type,
        :version => version,
        :log_completion => log_completion
      }
    end

    def self.from_hash hash
      self.new hash[:id], hash[:type].to_sym, hash[:version], ( hash[:log_completion] || false )
    end

    def to_s
      "#{id} #{type} (v#{version})"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
euston-1.2.3 lib/euston/command_headers.rb
euston-1.2.3-java lib/euston/command_headers.rb
euston-1.2.2 lib/euston/command_headers.rb
euston-1.2.2-java lib/euston/command_headers.rb
euston-1.2.1 lib/euston/command_headers.rb
euston-1.2.1-java lib/euston/command_headers.rb
euston-1.2.0 lib/euston/command_headers.rb
euston-1.2.0-java lib/euston/command_headers.rb
euston-1.1.0 lib/euston/command_headers.rb
euston-1.1.0-java lib/euston/command_headers.rb