Sha256: 30fda49bb8fa39889459fd880d7a7952294a6f3ffd134d88c9c5deb10fcaeff2

Contents?: true

Size: 334 Bytes

Versions: 5

Compression:

Stored size: 334 Bytes

Contents

module Slayer
  class Result
    attr_reader :value, :status, :message

    def initialize(value, status, message)
      @value   = value
      @status  = status
      @message = message
    end

    def ok?
      !err?
    end

    def err?
      @err ||= false
    end

    def fail
      @err ||= true
      self
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slayer-0.5.4 lib/slayer/result.rb
slayer-0.5.3 lib/slayer/result.rb
slayer-0.5.2 lib/slayer/result.rb
slayer-0.5.1 lib/slayer/result.rb
slayer-0.5.0.beta lib/slayer/result.rb