Class: Code::Object::Class

Inherits:
Code::Object show all
Defined in:
lib/code/object/class.rb

Constant Summary

Constants inherited from Code::Object

NUMBER_CLASSES

Instance Attribute Summary

Attributes inherited from Code::Object

#raw

Instance Method Summary collapse

Methods inherited from Code::Object

#<=>, #==, as_json, #as_json, call, #code_and_operator, code_and_operator, #code_as_json, code_as_json, code_different, #code_different, #code_equal_equal, code_equal_equal, code_equal_equal_equal, #code_equal_equal_equal, code_exclamation_point, #code_exclamation_point, code_exclusive_range, #code_exclusive_range, code_inclusive_range, #code_inclusive_range, code_new, code_or_operator, #code_or_operator, code_self, #code_self, #code_to_json, code_to_json, falsy?, #falsy?, #hash, inspect, maybe, multi_fetch, #multi_fetch, #nothing?, nothing?, repeat, sig, #sig, #succ, #to_code, to_json, #to_json, to_s, truthy?, #truthy?, |

Constructor Details

#initialize(*args, **_kargs) ⇒ Class

Returns a new instance of Class.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/code/object/class.rb', line 6

def initialize(*args, **_kargs, &)
  @raw =
    if args.first.is_a?(Class)
      args.first.raw
    elsif args.first.is_an?(Object)
      args.first.class
    elsif args.first && args.first < Object
      args.first
    else
      Nothing
    end
end

Instance Method Details

#callObject



19
20
21
# File 'lib/code/object/class.rb', line 19

def call(...)
  raw.call(...)
end