Sha256: 3c44d9e56bc4c89aa0c9c3e93bf85b7c62b3a086b98bbb9ca2e16f2201173587

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

module Semi
  module Variables
    class Base

      def initialize(val)
        set(val)
      end

      def set(val)
        @value = val
      end

      def to_s
        @value.to_s
      end

      def value
        @value
      end

      def &(other)
        return @value & other
      end

      def |(other)
        return @value | other
      end

      def <=>(other)
        return @value <=> other
      end

      def eql?(other)
        return @value.eql? other
      end

      def equal?(other)
        return @value.equal? other
      end

      def ^(other)
        return @value ^ other
      end

      def !=(other)
        return @value != other
      end

      def ==(other)
        return @value == other
      end

      def ===(other)
        return @value === other
      end

      def =~(other)
        return @value =~ other
      end

      def !~(other)
        return @value != other
      end


      def method_missing(m, *args, &block)
        @value.to_s.send(m, *args, &block)
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
semi-0.8.6 lib/semi/variables/base.rb
semi-0.8.5 lib/semi/variables/base.rb
semi-0.8.4 lib/semi/variables/base.rb
semi-0.8.3 lib/semi/variables/base.rb
semi-0.8.2 lib/semi/variables/base.rb
semi-0.8.1 lib/semi/variables/base.rb
semi-0.8.0 lib/semi/variables/base.rb
semi-0.7.1 lib/semi/variables/base.rb
semi-0.7.0 lib/semi/variables/base.rb