class TestML::Str
Public Class Methods
new(str)
click to toggle source
# File lib/testml/runtime.rb, line 409 def initialize(str) @value = str.to_s end
Public Instance Methods
bool()
click to toggle source
# File lib/testml/runtime.rb, line 418 def bool !@value.empty? ? TestML::Constant::True : TestML::Constant::False end
list()
click to toggle source
# File lib/testml/runtime.rb, line 421 def list TestML::List.new(@value.split //) end
num()
click to toggle source
# File lib/testml/runtime.rb, line 415 def num TestML::Num.new(@value =~ /^-?\d+(?:\.\d+)$/ ? $1.to_i : 0) end
str()
click to toggle source
# File lib/testml/runtime.rb, line 412 def str self end