Class: TestDataTypes

Inherits:
Object show all
Defined in:
lib/swxruby/services/test_data_types.rb

Overview

Data type test service. Run the TestDataTypes.fla to run through all these tests using SWX RPC.

Author:

  • Aral Balkan

Instance Method Summary collapse

Instance Method Details

#test_arrayObject

Returns the array [‘It’, ‘works’]

Author:

  • Aral Balkan



35
36
37
# File 'lib/swxruby/services/test_data_types.rb', line 35

def test_array
	%w(It works)
end

#test_associative_arrayObject

Returns the associative array [‘it’ => ‘works’, ‘number’ => 42]

Author:

  • Aral Balkan



75
76
77
# File 'lib/swxruby/services/test_data_types.rb', line 75

def test_associative_array
	{'it' => 'works', 'number' => 42}
end

#test_falseObject

Returns the boolean false.

Author:

  • Aral Balkan



27
28
29
# File 'lib/swxruby/services/test_data_types.rb', line 27

def test_false
	false
end

#test_floatObject

Returns the float 42.12345.

Author:

  • Aral Balkan



59
60
61
# File 'lib/swxruby/services/test_data_types.rb', line 59

def test_float
	42.12345
end

#test_integerObject

Returns the integer 42.

Author:

  • Aral Balkan



51
52
53
# File 'lib/swxruby/services/test_data_types.rb', line 51

def test_integer
	42
end

#test_nested_arrayObject

Returns the nested array [‘It’, [‘also’], ‘works]

Author:

  • Aral Balkan



43
44
45
# File 'lib/swxruby/services/test_data_types.rb', line 43

def test_nested_array
	['It', ['also'], 'works']
end

#test_nullObject

Returns null.

Author:

  • Aral Balkan



91
92
93
# File 'lib/swxruby/services/test_data_types.rb', line 91

def test_null
	nil
end

#test_objectObject

Returns an instance of the TestTO class with properties prop1: “A string” and prop2: 42.

Author:

  • Aral Balkan



83
84
85
# File 'lib/swxruby/services/test_data_types.rb', line 83

def test_object
	TestTO.new
end

#test_stringObject

Returns the string “It works!”

Author:

  • Aral Balkan



67
68
69
# File 'lib/swxruby/services/test_data_types.rb', line 67

def test_string
	"It works!"
end

#test_trueObject

Returns the boolean true.

Author:

  • Aral Balkan



19
20
21
# File 'lib/swxruby/services/test_data_types.rb', line 19

def test_true
	true
end