Sha256: 902639be6ed4465fc309d17570743d1e0873cdf55581b953bf2618b060e9eb25
Contents?: true
Size: 400 Bytes
Versions: 9
Compression:
Stored size: 400 Bytes
Contents
require "ostruct" module Ucasy class Context < OpenStruct def self.build(context = {}) (self === context) ? context : new(context) end def fail!(options = {}) options.each { |key, value| self[key.to_sym] = value } @failure = true raise Failure, self end def failure? @failure || false end def success? !failure? end end end
Version data entries
9 entries across 9 versions & 1 rubygems