Class: Bruhl::RawString

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/bruhl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ RawString

Returns a new instance of RawString.



114
115
116
# File 'lib/bruhl.rb', line 114

def initialize(str)
  @str = str
end

Instance Attribute Details

#strObject (readonly)

Returns the value of attribute str.



113
114
115
# File 'lib/bruhl.rb', line 113

def str
  @str
end

Instance Method Details

#<=>(other) ⇒ Object



118
119
120
# File 'lib/bruhl.rb', line 118

def <=>(other)
  other.respond_to?(:to_str) && @str <=> other.to_str
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/bruhl.rb', line 122

def eql?(other)
  self == other
end

#hashObject



126
127
128
# File 'lib/bruhl.rb', line 126

def hash
  @str.hash
end

#inspectObject



130
131
132
# File 'lib/bruhl.rb', line 130

def inspect
  to_s
end

#to_sObject



134
135
136
# File 'lib/bruhl.rb', line 134

def to_s
  @str
end

#to_strObject



138
139
140
# File 'lib/bruhl.rb', line 138

def to_str
  @str
end