Sha256: 8046543e852b169ae2cfec34ed1ed32e7d73b2501b1c9a3c6f8df56132bf9fec
Contents?: true
Size: 804 Bytes
Versions: 5
Compression:
Stored size: 804 Bytes
Contents
require "Checked/Base" require "Checked/Demand/DSL" module Checked class Demand Failed = Class.new(RuntimeError) module Base include DSL include ::Checked::Base def err_msg msg = "...is invalid." message = if msg.strip[ %r!^\.\.\.! ] msg.sub('...', '').strip else msg end @err_msg || "#{target_name} #{message}" end def err_msg= msg demand! msg, :string!, :not_empty! @err_msg = msg end private # ========================================== def fail! msg raise Failed, err_msg(msg) end end # === module Base include Base end # === class Demand end # === module Checked
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
Checked-0.1.4 | lib/Checked/Demand.rb |
Checked-0.1.3 | lib/Checked/Demand.rb |
Checked-0.1.2 | lib/Checked/Demand.rb |
Checked-0.1.1 | lib/Checked/Demand.rb |
Checked-0.1.0 | lib/Checked/Demand.rb |