Module: Finitio::Syntax::Literal::Boolean

Includes:
Finitio::Syntax::Literal
Defined in:
lib/finitio/syntax/literal/boolean.rb

Constant Summary collapse

TRUE =
"true".freeze
FALSE =
"false".freeze

Instance Method Summary collapse

Methods included from Finitio::Syntax::Literal

#to_ruby

Methods included from Node

included, #metadata, #resolve_ruby_const, #unique_names!

Instance Method Details

#valueObject



10
11
12
13
14
15
16
17
# File 'lib/finitio/syntax/literal/boolean.rb', line 10

def value
  case to_str.strip
  when TRUE  then true
  when FALSE then false
  else
    raise "Unexpected boolean literal `#{to_str}`"
  end
end