Sha256: d4644e727b18d8d0ab71d0079ef5059615d3e90d61155e053cdd008871090ba9
Contents?: true
Size: 828 Bytes
Versions: 1
Compression:
Stored size: 828 Bytes
Contents
module Fix class Subject attr_reader :last_arg def initialize input, *args @args = args @error = nil @implemented = true @last_arg = -1 begin @cache_value = params.inject input do |mem, param| @implemented = mem.respond_to? param.first, false @last_arg = @last_arg.next mem.__send__(*param) end @last_arg = @last_arg.next rescue => @error end end def actual if @error.nil? @cache_value.__send__(*challenge) else raise @error end end def params @args[0..-2] end def challenge @args.last end def implemented? @error.nil? && @implemented && @cache_value.respond_to?(challenge.first, false) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fix-0.6.1 | lib/fix/subject.rb |