Sha256: 691935492f21ac6f397eeb9abd87ece86f8d6c3675df4c6acae767582080b76d

Contents?: true

Size: 369 Bytes

Versions: 2

Compression:

Stored size: 369 Bytes

Contents

module LXC
  class Status
    attr_reader :state, :pid

    def initialize(state, pid)
      @state = state.to_s.downcase
      @pid = Integer(pid)
    end

    def == (instance)
      instance.pid == pid && instance.state == state
    end

    def to_hash
      {'state' => state, 'pid' => pid}
    end

    def to_s
      "state=#{state} pid=#{pid}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lxc-ruby-0.3.2 lib/lxc/status.rb
lxc-ruby-0.3.1 lib/lxc/status.rb