Class: Code::Object::Parameter
Constant Summary
Constants inherited
from Code::Object
NUMBER_CLASSES
Instance Attribute Summary
#methods, #raw
Instance Method Summary
collapse
code_new, #code_new, maybe, #name, repeat, |
#<=>, #==, #as_json, #call, #code_and, #code_as_json, #code_deep_duplicate, #code_different, #code_duplicate, #code_equal_equal, #code_equal_equal_equal, #code_exclamation_point, #code_exclusive_range, #code_falsy?, #code_fetch, code_fetch, #code_get, code_get, #code_inclusive_range, #code_inspect, #code_methods, #code_or, #code_self, #code_set, code_set, #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, #succ, #to_code, #to_json, #to_s, #truthy?
Constructor Details
#initialize(*args, **_kargs, &_block) ⇒ Parameter
6
7
8
|
# File 'lib/code/object/parameter.rb', line 6
def initialize(*args, **_kargs, &_block)
self.raw = Dictionary.new(args.first)
end
|
Instance Method Details
#code_default ⇒ Object
30
31
32
|
# File 'lib/code/object/parameter.rb', line 30
def code_default
Code.new(raw.code_get(:default))
end
|
#code_evaluate ⇒ Object
34
35
36
|
# File 'lib/code/object/parameter.rb', line 34
def code_evaluate(...)
code_default.code_evaluate(...)
end
|
#code_keyword? ⇒ Boolean
18
19
20
|
# File 'lib/code/object/parameter.rb', line 18
def code_keyword?
Boolean.new(raw.code_get(:keyword?))
end
|
#code_keyword_splat? ⇒ Boolean
26
27
28
|
# File 'lib/code/object/parameter.rb', line 26
def code_keyword_splat?
Boolean.new(raw.code_get(:keyword_splat?))
end
|
#code_name ⇒ Object
10
11
12
|
# File 'lib/code/object/parameter.rb', line 10
def code_name
String.new(raw.code_get(:name))
end
|
#code_regular? ⇒ Boolean
14
15
16
|
# File 'lib/code/object/parameter.rb', line 14
def code_regular?
Boolean.new(raw.code_get(:regular?))
end
|
#code_regular_splat? ⇒ Boolean
22
23
24
|
# File 'lib/code/object/parameter.rb', line 22
def code_regular_splat?
Boolean.new(raw.code_get(:regular_splat?))
end
|
42
43
44
|
# File 'lib/code/object/parameter.rb', line 42
def keyword?
code_keyword?.truthy?
end
|
#keyword_splat? ⇒ Boolean
50
51
52
|
# File 'lib/code/object/parameter.rb', line 50
def keyword_splat?
code_keyword_splat?.truthy?
end
|
38
39
40
|
# File 'lib/code/object/parameter.rb', line 38
def regular?
code_regular?.truthy?
end
|
#regular_splat? ⇒ Boolean
46
47
48
|
# File 'lib/code/object/parameter.rb', line 46
def regular_splat?
code_regular_splat?.truthy?
end
|