Class: Prune::PObjects::PLiteralString
- Defined in:
- lib/prune/p_objects/p_literal_string.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #==(value) ⇒ Object
-
#initialize(string) ⇒ PLiteralString
constructor
A new instance of PLiteralString.
- #to_s ⇒ Object
Methods inherited from Base
#indent!, #outdent!, #space, #value_to_s
Constructor Details
#initialize(string) ⇒ PLiteralString
Returns a new instance of PLiteralString.
8 9 10 11 12 |
# File 'lib/prune/p_objects/p_literal_string.rb', line 8 def initialize(string) raise PLiteralStringTypeError unless string.instance_of?(String) @string = string end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
6 7 8 |
# File 'lib/prune/p_objects/p_literal_string.rb', line 6 def string @string end |
Instance Method Details
#==(value) ⇒ Object
14 15 16 17 |
# File 'lib/prune/p_objects/p_literal_string.rb', line 14 def ==(value) false unless value.instance_of?(self.class) @string == value.string end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/prune/p_objects/p_literal_string.rb', line 19 def to_s "(#{@string})" end |