Class: CSVPlusPlus::Language::Entities::String
- Defined in:
- lib/csv_plus_plus/language/entities/string.rb
Overview
A string value
Instance Attribute Summary collapse
-
#value ⇒ String
readonly
The current value of value.
Attributes inherited from Entity
Instance Method Summary collapse
- #==(other) ⇒ boolean
-
#initialize(value) ⇒ String
constructor
A new instance of String.
- #to_s ⇒ String
Methods inherited from Entity
#method_missing, #respond_to_missing?
Constructor Details
#initialize(value) ⇒ String
Returns a new instance of String.
13 14 15 16 17 |
# File 'lib/csv_plus_plus/language/entities/string.rb', line 13 def initialize(value) super(:string) @value = value.gsub(/^"|"$/, '') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class CSVPlusPlus::Language::Entities::Entity
Instance Attribute Details
#value ⇒ String (readonly)
Returns the current value of value.
9 10 11 |
# File 'lib/csv_plus_plus/language/entities/string.rb', line 9 def value @value end |
Instance Method Details
#==(other) ⇒ boolean
25 26 27 |
# File 'lib/csv_plus_plus/language/entities/string.rb', line 25 def ==(other) super && value == other.value end |
#to_s ⇒ String
20 21 22 |
# File 'lib/csv_plus_plus/language/entities/string.rb', line 20 def to_s "\"#{@value}\"" end |