Class: Code::Object
- 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
Direct Known Subclasses
Base64, Boolean, Class, Code, Date, Dictionary, Duration, Function, Global, Html, Http, Json, List, Nothing, Number, Range, String, Time
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
Class Method Summary collapse
- .code_new(*args) ⇒ Object
- .maybe ⇒ Object
- .repeat(minimum = 0, maximum = nil) ⇒ Object
- .|(other) ⇒ Object
Instance Method Summary collapse
- #code_new(*args) ⇒ Object
-
#initialize ⇒ Object
constructor
A new instance of Object.
- #name ⇒ Object
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
#initialize ⇒ Object
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 |
.maybe ⇒ Object
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 |