Class: Code::Object

Inherits:
Object show all
Extended by:
Concerns::Shared
Includes:
Concerns::Shared
Defined in:
lib/code/object.rb,
lib/code/object/code.rb,
lib/code/object/date.rb,
lib/code/object/html.rb,
lib/code/object/http.rb,
lib/code/object/json.rb,
lib/code/object/list.rb,
lib/code/object/smtp.rb,
lib/code/object/time.rb,
lib/code/object/class.rb,
lib/code/object/range.rb,
lib/code/object/global.rb,
lib/code/object/number.rb,
lib/code/object/string.rb,
lib/code/object/base_64.rb,
lib/code/object/boolean.rb,
lib/code/object/context.rb,
lib/code/object/decimal.rb,
lib/code/object/integer.rb,
lib/code/object/nothing.rb,
lib/code/object/duration.rb,
lib/code/object/function.rb,
lib/code/object/parameter.rb,
lib/code/object/dictionary.rb,
lib/code/object/identifier_list.rb

Defined Under Namespace

Classes: Base64, Boolean, Class, Code, Context, Date, Decimal, Dictionary, Duration, Function, Global, Html, Http, IdentifierList, Integer, Json, List, Nothing, Number, Parameter, Range, Smtp, String, Time

Constant Summary collapse

NUMBER_CLASSES =
[
  Integer,
  Decimal,
  String,
  ::Integer,
  ::Float,
  ::String,
  ::BigDecimal
].freeze

Instance Attribute Summary

Attributes included from Concerns::Shared

#methods, #raw

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Shared

<=>, ==, as_json, call, code_and, code_as_json, code_compare, code_deep_duplicate, code_different, code_duplicate, code_equal, code_exclamation_mark, code_exclusive_range, code_falsy?, code_fetch, code_fetch, code_get, code_get, code_greater, code_greater_or_equal, code_inclusive_range, code_inspect, code_less, code_less_or_equal, code_methods, code_name, code_nothing?, code_or, code_self, code_set, code_set, code_something?, code_strict_different, code_strict_equal, code_to_boolean, code_to_class, code_to_date, code_to_decimal, code_to_dictionary, code_to_duration, code_to_integer, code_to_json, code_to_list, code_to_nothing, code_to_parameter, code_to_range, code_to_string, code_to_time, code_truthy?, eql?, falsy?, hash, inspect, multi_fetch, nothing?, sig, something?, succ, to_code, to_i, to_json, to_s, truthy?

Constructor Details

#initializeObject

Returns a new instance of Object.



18
19
# File 'lib/code/object.rb', line 18

def initialize(...)
end

Class Method Details

.code_new(*args) ⇒ Object



33
34
35
# File 'lib/code/object.rb', line 33

def self.code_new(*args)
  new(*args)
end

.maybeObject



21
22
23
# File 'lib/code/object.rb', line 21

def self.maybe
  Type::Maybe.new(self)
end

.repeat(minimum = 0, maximum = nil) ⇒ Object



25
26
27
# File 'lib/code/object.rb', line 25

def self.repeat(minimum = 0, maximum = nil)
  Type::Repeat.new(self, minimum: minimum, maximum: maximum)
end

.|(other) ⇒ Object



29
30
31
# File 'lib/code/object.rb', line 29

def self.|(other)
  Type::Or.new(self, other)
end

Instance Method Details

#code_new(*args) ⇒ Object



41
42
43
# File 'lib/code/object.rb', line 41

def code_new(*args)
  self.class.code_new(*args)
end

#nameObject



37
38
39
# File 'lib/code/object.rb', line 37

def name
  self.class.name
end