Class: Literal::Tuple

Inherits:
Object
  • Object
show all
Defined in:
lib/literal/tuple.rb

Defined Under Namespace

Classes: Generic

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, types) ⇒ Tuple

Returns a new instance of Tuple.



54
55
56
57
# File 'lib/literal/tuple.rb', line 54

def initialize(values, types)
	@__values__ = values
	@__types__ = types
end

Instance Attribute Details

#__types__Object (readonly)

Returns the value of attribute __types__.



63
64
65
# File 'lib/literal/tuple.rb', line 63

def __types__
  @__types__
end

#__values__Object (readonly)

Returns the value of attribute __values__.



63
64
65
# File 'lib/literal/tuple.rb', line 63

def __values__
  @__values__
end

Instance Method Details

#==(other) ⇒ Object



65
66
67
# File 'lib/literal/tuple.rb', line 65

def ==(other)
	(Literal::Tuple === other) && (@__values__ == other.__values__)
end

#[](index) ⇒ Object



69
70
71
# File 'lib/literal/tuple.rb', line 69

def [](index)
	@__values__[index]
end

#inspectObject



59
60
61
# File 'lib/literal/tuple.rb', line 59

def inspect
	"Literal::Tuple(#{@__types__.map(&:inspect).join(', ')})#{@__values__.inspect}"
end