Class: Rubyang::Xpath::Literal
- Inherits:
-
Object
- Object
- Rubyang::Xpath::Literal
- Defined in:
- lib/rubyang/xpath.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Literal
constructor
A new instance of Literal.
Constructor Details
#initialize(value) ⇒ Literal
Returns a new instance of Literal.
407 408 409 410 411 412 413 414 415 416 |
# File 'lib/rubyang/xpath.rb', line 407 def initialize value @value = case value when /^"(?:[^"])*"/ value.gsub(/^"/,'').gsub(/"$/,'').gsub(/\\n/,"\n").gsub(/\\t/,"\t").gsub(/\\"/,"\"").gsub(/\\\\/,"\\") when /^'(?:[^'])*'/ value.gsub(/^'/,'').gsub(/'$/,'') else value end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
406 407 408 |
# File 'lib/rubyang/xpath.rb', line 406 def value @value end |