Class: Reginald::Atom
- Inherits:
-
Struct
- Object
- Struct
- Reginald::Atom
- Defined in:
- lib/rack/mount/vendor/reginald/reginald/atom.rb
Instance Attribute Summary collapse
-
#ignorecase ⇒ Object
Returns the value of attribute ignorecase.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
- #casefold? ⇒ Boolean
-
#eql?(other) ⇒ Boolean
:nodoc:.
-
#freeze ⇒ Object
:nodoc:.
-
#initialize(*args) ⇒ Atom
constructor
A new instance of Atom.
-
#inspect ⇒ Object
:nodoc:.
-
#literal? ⇒ Boolean
Returns true if expression could be treated as a literal string.
- #to_s(parent = false) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Atom
Returns a new instance of Atom.
5 6 7 8 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 5 def initialize(*args) @ignorecase = nil super end |
Instance Attribute Details
#ignorecase ⇒ Object
Returns the value of attribute ignorecase.
3 4 5 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 3 def ignorecase @ignorecase end |
#value ⇒ Object
Returns the value of attribute value
2 3 4 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 2 def value @value end |
Instance Method Details
#==(other) ⇒ Object
:nodoc:
27 28 29 30 31 32 33 34 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 27 def ==(other) #:nodoc: case other when String other == to_s else eql?(other) end end |
#casefold? ⇒ Boolean
15 16 17 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 15 def casefold? ignorecase ? true : false end |
#eql?(other) ⇒ Boolean
:nodoc:
36 37 38 39 40 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 36 def eql?(other) #:nodoc: other.instance_of?(self.class) && self.value.eql?(other.value) && (!!self.ignorecase).eql?(!!other.ignorecase) end |
#freeze ⇒ Object
:nodoc:
42 43 44 45 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 42 def freeze #:nodoc: value.freeze super end |
#inspect ⇒ Object
:nodoc:
23 24 25 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 23 def inspect #:nodoc: "#<#{self.class.to_s.sub('Reginald::', '')} #{to_s.inspect}>" end |
#literal? ⇒ Boolean
Returns true if expression could be treated as a literal string.
11 12 13 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 11 def literal? false end |
#to_s(parent = false) ⇒ Object
19 20 21 |
# File 'lib/rack/mount/vendor/reginald/reginald/atom.rb', line 19 def to_s(parent = false) "#{value}" end |