Class: Twostroke::Runtime::Types::String

Inherits:
Primitive show all
Defined in:
lib/twostroke/runtime/types/string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Value

#has_instance

Constructor Details

#initialize(string) ⇒ String

Returns a new instance of String.



4
5
6
# File 'lib/twostroke/runtime/types/string.rb', line 4

def initialize(string)
  @string = string
end

Instance Attribute Details

#stringObject (readonly)

Returns the value of attribute string.



3
4
5
# File 'lib/twostroke/runtime/types/string.rb', line 3

def string
  @string
end

Instance Method Details

#===(other) ⇒ Object



12
13
14
# File 'lib/twostroke/runtime/types/string.rb', line 12

def ===(other)
  other.is_a?(String) && string == other.string
end

#to_rubyObject



8
9
10
# File 'lib/twostroke/runtime/types/string.rb', line 8

def to_ruby
  string
end

#typeofObject



16
17
18
# File 'lib/twostroke/runtime/types/string.rb', line 16

def typeof
  "string"
end