Class: Tuple

Inherits:
Array show all
Defined in:
lib/dsl/python/types/tuple.rb

Instance Method Summary collapse

Methods inherited from Array

#__, #__add__, #__getitem__, #__len__, #__sizeof__, #__str__, #append

Instance Method Details

#to_aryObject



11
12
13
# File 'lib/dsl/python/types/tuple.rb', line 11

def to_ary
  to_a
end

#to_sObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/dsl/python/types/tuple.rb', line 15

def to_s
  items = self.map do
    if _1.is_a?(String)
      "'#{_1}'"
    else
      _1
    end
  end
  "(#{items.join(", ")})"
end