Class: Dhall::Builtins::Natural_odd

Inherits:
Dhall::Builtin show all
Defined in:
lib/dhall/builtins.rb

Instance Method Summary collapse

Methods inherited from Dhall::Builtin

#as_json, #unfill

Methods inherited from Expression

#&, #*, #+, #as_dhall, #cache_key, #concat, decode, #deep_merge, #deep_merge_type, #dhall_eq, #digest, #fetch, #fusion, #merge, #normalize, #resolve, #shift, #slice, #substitute, #to_cbor, #to_proc, #to_s, #|

Instance Method Details

#call(nat) ⇒ Object



157
158
159
160
161
162
163
# File 'lib/dhall/builtins.rb', line 157

def call(nat)
	if nat.is_a?(Dhall::Natural)
		Dhall::Bool.new(value: nat.odd?)
	else
		super
	end
end