Sha256: cdb74cbfe62bedb733d382fb9149589c237d7d8b1201ba9dec4096573630b40a

Contents?: true

Size: 352 Bytes

Versions: 33

Compression:

Stored size: 352 Bytes

Contents

class Code
  class Object
    class Boolean < ::Code::Object
      attr_reader :raw

      def initialize(raw)
        @raw = raw
      end

      def truthy?
        raw
      end

      def succ
        ::Code::Object::Boolean.new(!raw)
      end

      def to_s
        raw.to_s
      end

      def inspect
        to_s
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
template-ruby-0.5.6 lib/code/object/boolean.rb
language-ruby-0.5.6 lib/code/object/boolean.rb
code-ruby-0.5.6 lib/code/object/boolean.rb
template-ruby-0.5.5 lib/code/object/boolean.rb
language-ruby-0.5.5 lib/code/object/boolean.rb
code-ruby-0.5.5 lib/code/object/boolean.rb
template-ruby-0.5.4 lib/code/object/boolean.rb
language-ruby-0.5.4 lib/code/object/boolean.rb
code-ruby-0.5.4 lib/code/object/boolean.rb
template-ruby-0.5.3 lib/code/object/boolean.rb
language-ruby-0.5.3 lib/code/object/boolean.rb
code-ruby-0.5.3 lib/code/object/boolean.rb
template-ruby-0.5.2 lib/code/object/boolean.rb
language-ruby-0.5.2 lib/code/object/boolean.rb
code-ruby-0.5.2 lib/code/object/boolean.rb
language-ruby-0.5.1 lib/code/object/boolean.rb
template-ruby-0.5.1 lib/code/object/boolean.rb
code-ruby-0.5.1 lib/code/object/boolean.rb
template-ruby-0.5.0 lib/code/object/boolean.rb
language-ruby-0.5.0 lib/code/object/boolean.rb