File: value/core/atom/symbol.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: Umu#6
  module: Value#8
  module: Core#10
has properties
function: make_symbol / 1 #73
  module: Atom#12
  class: Symbol#14
inherits from
  Abstract ( Umu::Value::Core::Atom )
has properties
method: initialize / 1 #15
method: to_s #22
method: meth_to_string / 3 #27

Class Hierarchy

Code

   1  # coding: utf-8
   2  # frozen_string_literal: true
   3 
   4 
   5 
   6  module Umu
   7 
   8  module Value
   9 
  10  module Core
  11 
  12  module Atom
  13 
  14  class Symbol < Abstract
  15      def initialize(val)
  16          ASSERT.kind_of val, ::Symbol
  17 
  18          super
  19      end
  20 
  21 
  22      def to_s
  23          '@' + self.val.to_s
  24      end
  25 
  26 
  27      def meth_to_string(_loc, _env, _event)
  28          VC.make_string self.val.to_s
  29      end
  30 
  31 
  32      define_instance_method(
  33          :meth_is_less_than,
  34          :'<', [],
  35          [self], VCA::Bool
  36      )
  37 
  38 
  39      define_instance_method(
  40          :meth_is_greater_than,
  41          :'>', [],
  42          [self], VCA::Bool
  43      )
  44 
  45 
  46      define_instance_method(
  47          :meth_is_less_equal,
  48          :'<=', [],
  49          [self], VCA::Bool
  50      )
  51 
  52 
  53      define_instance_method(
  54          :meth_is_greater_equal,
  55          :'>=', [],
  56          [self], VCA::Bool
  57      )
  58 
  59 
  60      define_instance_method(
  61          :meth_compare,
  62          :'<=>', [],
  63          [self], VCAN::Int
  64      )
  65  end
  66  Symbol.freeze
  67 
  68  end # Umu::Value::Core::Atom
  69 
  70 
  71  module_function
  72 
  73      def make_symbol(val)
  74          ASSERT.kind_of val, ::Symbol
  75 
  76          Atom::Symbol.new(val).freeze
  77      end
  78 
  79  end # Umu::Value::Core
  80 
  81  end # Umu::Value
  82 
  83  end # Umu