Sha256: 854f8d6c26b1905ddf7b8fae3a90bd19b7a2faea1ca96806917ce217d0c4be9d

Contents?: true

Size: 703 Bytes

Versions: 29

Compression:

Stored size: 703 Bytes

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2019 Eric Crane.  All rights reserved.
#
# An Expression that can be evaluated.
#

module Gloo
  module Expr
    class LBoolean < Gloo::Core::Literal

      #
      # Is the given token a boolean?
      #
      def self.boolean?( token )
        return Gloo::Objs::Boolean.boolean? token
      end

      #
      # Set the value, converting to an boolean.
      #
      def set_value( value )
        @value = Gloo::Objs::Boolean.coerse_to_bool value
      end

      #
      # Get string representation
      #
      def to_s
        return 'false' unless @value

        return @value.to_s
      end

    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
gloo-3.5.0 lib/gloo/expr/l_boolean.rb
gloo-3.4.1 lib/gloo/expr/l_boolean.rb
gloo-3.4.0 lib/gloo/expr/l_boolean.rb
gloo-3.3.0 lib/gloo/expr/l_boolean.rb
gloo-3.2.0 lib/gloo/expr/l_boolean.rb
gloo-3.1.1 lib/gloo/expr/l_boolean.rb
gloo-3.1.0 lib/gloo/expr/l_boolean.rb
gloo-3.0.1 lib/gloo/expr/l_boolean.rb
gloo-3.0.0 lib/gloo/expr/l_boolean.rb
gloo-2.5.0 lib/gloo/expr/l_boolean.rb
gloo-2.4.3 lib/gloo/expr/l_boolean.rb
gloo-2.4.2 lib/gloo/expr/l_boolean.rb
gloo-2.4.1 lib/gloo/expr/l_boolean.rb
gloo-2.4.0 lib/gloo/expr/l_boolean.rb
gloo-2.3.1 lib/gloo/expr/l_boolean.rb
gloo-2.2.0 lib/gloo/expr/l_boolean.rb
gloo-2.1.0 lib/gloo/expr/l_boolean.rb
gloo-2.0.2 lib/gloo/expr/l_boolean.rb
gloo-2.0.1 lib/gloo/expr/l_boolean.rb
gloo-2.0.0 lib/gloo/expr/l_boolean.rb