Class: Uttk::Logger::Segment
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#segment ⇒ Object
Returns the value of attribute segment.
Class Method Summary collapse
Instance Method Summary collapse
- #==(rhs) ⇒ Object
-
#initialize(segment, options = nil) ⇒ Segment
constructor
A new instance of Segment.
- #initialize_copy(rhs) ⇒ Object
- #quoted_segment ⇒ Object
- #regexp_quoted_segment ⇒ Object
Constructor Details
#initialize(segment, options = nil) ⇒ Segment
Returns a new instance of Segment.
14 15 16 17 |
# File 'lib/uttk/logger/path.rb', line 14 def initialize ( segment, =nil ) raise if segment.is_a? Segment @segment, = segment, ( || {}) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
13 14 15 |
# File 'lib/uttk/logger/path.rb', line 13 def end |
#segment ⇒ Object
Returns the value of attribute segment.
13 14 15 |
# File 'lib/uttk/logger/path.rb', line 13 def segment @segment end |
Class Method Details
.quote(s) ⇒ Object
24 25 26 |
# File 'lib/uttk/logger/path.rb', line 24 def self.quote ( s ) s.gsub(/(?:([\/\]\[])|\\(.))/, '\\\\\1\2') end |
Instance Method Details
#==(rhs) ⇒ Object
21 22 23 |
# File 'lib/uttk/logger/path.rb', line 21 def == ( rhs ) rhs.is_a?(self.class) && @segment == rhs.segment && == rhs. end |
#initialize_copy(rhs) ⇒ Object
18 19 20 |
# File 'lib/uttk/logger/path.rb', line 18 def initialize_copy ( rhs ) @segment, = rhs.segment.try_dup, rhs..dup end |
#quoted_segment ⇒ Object
27 28 29 |
# File 'lib/uttk/logger/path.rb', line 27 def quoted_segment Segment.quote(@segment.to_s) end |
#regexp_quoted_segment ⇒ Object
30 31 32 |
# File 'lib/uttk/logger/path.rb', line 30 def regexp_quoted_segment Segment.quote(Regexp.quote(@segment.to_s)) end |