Class: Code::Object
- Inherits:
-
Object
show all
- Extended by:
- Concerns::Shared
- Includes:
- Concerns::Shared
- Defined in:
- lib/code/object.rb,
lib/code/object/url.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/cryptography.rb,
lib/code/object/identifier_list.rb
Direct Known Subclasses
Base64, Boolean, Class, Code, Cryptography, Date, Dictionary, Duration, Function, Global, Html, Http, Json, List, Nothing, Number, Range, String, Time, Url
Defined Under Namespace
Classes: Base64, Boolean, Class, Code, Context, Cryptography, Date, Decimal, Dictionary, Duration, Function, Global, Html, Http, IdentifierList, Integer, Json, List, Nothing, Number, Parameter, Range, Smtp, String, Time, Url
Constant Summary
collapse
- NUMBER_CLASSES =
[
Integer,
Decimal,
String,
::Integer,
::Float,
::String,
::BigDecimal
].freeze
Instance Attribute Summary
#methods, #raw
Class Method Summary
collapse
Instance Method Summary
collapse
<=>, ==, as_json, blank?, call, code_and, code_as_json, code_blank?, 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_presence, code_presence_in, code_present?, 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?, present?, sig, something?, succ, to_code, to_i, to_json, to_s, truthy?
Constructor Details
#initialize ⇒ 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
|
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
|
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
|
37
38
39
|
# File 'lib/code/object.rb', line 37
def name
self.class.name
end
|