Sha256: 47fe41cbbf722b441e08708e2910614216c1665ce1ffb5b774907cc5929a9cba

Contents?: true

Size: 510 Bytes

Versions: 2

Compression:

Stored size: 510 Bytes

Contents

module Ykutils
  class RetCode
    attr_reader :val
    attr_accessor :bool, :mes, :ret

    def initialize(obj)
      @val = obj
      @mes = obj["mes"]
      @ret = obj["ret"]
      @bool = obj["bool"]
    end

    def [](key)
      @val[key]
    end

    def to_s
      @bool
    end
  end

  class RetCode2 < RetCode
    attr_reader :val
    attr_accessor :mes, :ret, :bool

    def initialize(ret, bool, mes)
      @val = { "ret" => ret, "bool" => bool, "mes" => mes }
      super(@val)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ykutils-0.1.10 lib/ykutils/retcodex.rb
ykutils-0.1.8 lib/ykutils/retcodex.rb