Class: Code::Object::Parameter
Constant Summary
Constants inherited
from Code::Object
NUMBER_CLASSES
Instance Attribute Summary
#methods, #raw
Instance Method Summary
collapse
Methods inherited from Dictionary
#<=>, #call, #code_any?, #code_clear, #code_compact, #code_compact!, #code_deep_duplicate, #code_delete, #code_delete_if, #code_delete_unless, #code_dig, #code_each, #code_empty?, #code_except, #code_fetch, #code_fetch_values, #code_flatten, #code_get, #code_has_key?, #code_has_value?, #code_invert, #code_keep_if, #code_keep_unless, #code_key, #code_keys, #code_merge, #code_merge!, #code_select, #code_select!, #code_set, #code_size, #code_to_context, #code_to_query, #code_transform_values, #code_values, #initialize
code_new, #code_new, #initialize, maybe, #name, repeat, |
#<=>, #==, #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_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?
Instance Method Details
74
75
76
|
# File 'lib/code/object/parameter.rb', line 74
def block?
code_block?.truthy?
end
|
#code_block? ⇒ Boolean
26
27
28
|
# File 'lib/code/object/parameter.rb', line 26
def code_block?
Boolean.new(code_get(:block?))
end
|
#code_default ⇒ Object
42
43
44
|
# File 'lib/code/object/parameter.rb', line 42
def code_default
code_get(:default).to_code
end
|
#code_keyword? ⇒ Boolean
14
15
16
|
# File 'lib/code/object/parameter.rb', line 14
def code_keyword?
Boolean.new(code_get(:keyword?))
end
|
#code_keyword_splat? ⇒ Boolean
22
23
24
|
# File 'lib/code/object/parameter.rb', line 22
def code_keyword_splat?
Boolean.new(code_get(:keyword_splat?))
end
|
#code_name ⇒ Object
6
7
8
|
# File 'lib/code/object/parameter.rb', line 6
def code_name
String.new(code_get(:name))
end
|
#code_optional? ⇒ Boolean
38
39
40
|
# File 'lib/code/object/parameter.rb', line 38
def code_optional?
code_default.code_truthy?
end
|
#code_regular? ⇒ Boolean
10
11
12
|
# File 'lib/code/object/parameter.rb', line 10
def code_regular?
Boolean.new(code_get(:regular?))
end
|
#code_regular_splat? ⇒ Boolean
18
19
20
|
# File 'lib/code/object/parameter.rb', line 18
def code_regular_splat?
Boolean.new(code_get(:regular_splat?))
end
|
#code_required? ⇒ Boolean
34
35
36
|
# File 'lib/code/object/parameter.rb', line 34
def code_required?
code_default.code_falsy?
end
|
#code_spread? ⇒ Boolean
30
31
32
|
# File 'lib/code/object/parameter.rb', line 30
def code_spread?
Boolean.new(code_get(:spread?))
end
|
58
59
60
|
# File 'lib/code/object/parameter.rb', line 58
def keyword?
code_keyword?.truthy?
end
|
#keyword_splat? ⇒ Boolean
66
67
68
|
# File 'lib/code/object/parameter.rb', line 66
def keyword_splat?
code_keyword_splat?.truthy?
end
|
50
51
52
|
# File 'lib/code/object/parameter.rb', line 50
def optional?
code_optional?.truthy?
end
|
54
55
56
|
# File 'lib/code/object/parameter.rb', line 54
def regular?
code_regular?.truthy?
end
|
#regular_splat? ⇒ Boolean
62
63
64
|
# File 'lib/code/object/parameter.rb', line 62
def regular_splat?
code_regular_splat?.truthy?
end
|
46
47
48
|
# File 'lib/code/object/parameter.rb', line 46
def required?
code_required?.truthy?
end
|
70
71
72
|
# File 'lib/code/object/parameter.rb', line 70
def spread?
code_spread?.truthy?
end
|