Class: Dhallish::BuiltinFunction

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

Overview

To be used as Dhallish::Value.val for ruby-defined functions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ BuiltinFunction

Returns a new instance of BuiltinFunction.



361
362
363
# File 'lib/types.rb', line 361

def initialize(&block)
	@block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



360
361
362
# File 'lib/types.rb', line 360

def block
  @block
end

Instance Method Details

#call(arg) ⇒ Object



365
# File 'lib/types.rb', line 365

def call(arg) @block.call arg end