Class: Synvert::Core::NodeQuery::Compiler::String

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/synvert/core/node_query/compiler/string.rb

Overview

String represents a ruby string value.

Constant Summary

Constants included from Comparable

Comparable::ARRAY_VALID_OPERATORS, Comparable::NUMBER_VALID_OPERATORS, Comparable::REGEXP_VALID_OPERATORS, Comparable::SIMPLE_VALID_OPERATORS, Comparable::STRING_VALID_OPERATORS

Instance Method Summary collapse

Methods included from Comparable

#actual_value, #expected_value, #match?, #valid_operator?

Constructor Details

#initialize(value:) ⇒ String

Initialize a String.

Parameters:

  • value (String)

    the string value



10
11
12
# File 'lib/synvert/core/node_query/compiler/string.rb', line 10

def initialize(value:)
  @value = value
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/synvert/core/node_query/compiler/string.rb', line 19

def to_s
  "\"#{@value}\""
end

#valid_operatorsObject

Get valid operators.



15
16
17
# File 'lib/synvert/core/node_query/compiler/string.rb', line 15

def valid_operators
  STRING_VALID_OPERATORS
end