Class: RightSupport::Config::RecursiveTrueClass

Inherits:
Object
  • Object
show all
Defined in:
lib/right_support/config/recursive_true_class.rb

Overview

Recursive(according to []) implementation of TrueClass. To use, just do: true1 = RecTrueClass.new now you can do true1, true1[‘b’], … and it will return

Instance Method Summary collapse

Constructor Details

#initializeRecursiveTrueClass

Returns a new instance of RecursiveTrueClass.



31
32
33
# File 'lib/right_support/config/recursive_true_class.rb', line 31

def initialize
  @value = true    
end

Instance Method Details

#&(other) ⇒ Object



45
46
47
# File 'lib/right_support/config/recursive_true_class.rb', line 45

def &(other)
  @value & other
end

#==(other) ⇒ Object

supporting standart boolean opeimplementation



41
42
43
# File 'lib/right_support/config/recursive_true_class.rb', line 41

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

#[](something) ⇒ Object



35
36
37
# File 'lib/right_support/config/recursive_true_class.rb', line 35

def [](something)
  self
end

#^(other) ⇒ Object



49
50
51
# File 'lib/right_support/config/recursive_true_class.rb', line 49

def ^(other)
  @value ^ other
end

#to_sObject



53
54
55
# File 'lib/right_support/config/recursive_true_class.rb', line 53

def to_s
  @value.to_s
end

#|(other) ⇒ Object



57
58
59
# File 'lib/right_support/config/recursive_true_class.rb', line 57

def |(other)
  @value | other
end