Class: Dhallish::Union

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_label, init_val, type) ⇒ Union

Returns a new instance of Union.



343
344
345
346
347
# File 'lib/types.rb', line 343

def initialize(init_label, init_val, type)
	@init_label = init_label
	@init_val = init_val
	@type = type
end

Instance Attribute Details

#init_labelObject

Returns the value of attribute init_label.



339
340
341
# File 'lib/types.rb', line 339

def init_label
  @init_label
end

#init_valObject

Returns the value of attribute init_val.



340
341
342
# File 'lib/types.rb', line 340

def init_val
  @init_val
end

#typeObject

Returns the value of attribute type.



341
342
343
# File 'lib/types.rb', line 341

def type
  @type
end

Instance Method Details

#select(label) ⇒ Object



349
350
351
352
353
354
355
# File 'lib/types.rb', line 349

def select(label)
	if label == @init_label
		@init_val
	else
		nil
	end
end