Class: Code::Object::Parameter

Inherits:
Dictionary show all
Defined in:
lib/code/object/parameter.rb

Constant Summary

Constants inherited from Code::Object

NUMBER_CLASSES

Instance Attribute Summary

Attributes included from Concerns::Shared

#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

Methods inherited from Code::Object

code_new, #code_new, #initialize, maybe, #name, repeat, |

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_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

This class inherits a constructor from Code::Object::Dictionary

Instance Method Details

#block?Boolean

Returns:



74
75
76
# File 'lib/code/object/parameter.rb', line 74

def block?
  code_block?.truthy?
end

#code_block?Boolean

Returns:



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

def code_block?
  Boolean.new(code_get(:block?))
end

#code_defaultObject



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

def code_default
  code_get(:default).to_code
end

#code_keyword?Boolean

Returns:



14
15
16
# File 'lib/code/object/parameter.rb', line 14

def code_keyword?
  Boolean.new(code_get(:keyword?))
end

#code_keyword_splat?Boolean

Returns:



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

def code_keyword_splat?
  Boolean.new(code_get(:keyword_splat?))
end

#code_nameObject



6
7
8
# File 'lib/code/object/parameter.rb', line 6

def code_name
  String.new(code_get(:name))
end

#code_optional?Boolean

Returns:



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

def code_optional?
  code_default.code_truthy?
end

#code_regular?Boolean

Returns:



10
11
12
# File 'lib/code/object/parameter.rb', line 10

def code_regular?
  Boolean.new(code_get(:regular?))
end

#code_regular_splat?Boolean

Returns:



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

Returns:



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

def code_required?
  code_default.code_falsy?
end

#code_spread?Boolean

Returns:



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

def code_spread?
  Boolean.new(code_get(:spread?))
end

#keyword?Boolean

Returns:



58
59
60
# File 'lib/code/object/parameter.rb', line 58

def keyword?
  code_keyword?.truthy?
end

#keyword_splat?Boolean

Returns:



66
67
68
# File 'lib/code/object/parameter.rb', line 66

def keyword_splat?
  code_keyword_splat?.truthy?
end

#optional?Boolean

Returns:



50
51
52
# File 'lib/code/object/parameter.rb', line 50

def optional?
  code_optional?.truthy?
end

#regular?Boolean

Returns:



54
55
56
# File 'lib/code/object/parameter.rb', line 54

def regular?
  code_regular?.truthy?
end

#regular_splat?Boolean

Returns:



62
63
64
# File 'lib/code/object/parameter.rb', line 62

def regular_splat?
  code_regular_splat?.truthy?
end

#required?Boolean

Returns:



46
47
48
# File 'lib/code/object/parameter.rb', line 46

def required?
  code_required?.truthy?
end

#spread?Boolean

Returns:



70
71
72
# File 'lib/code/object/parameter.rb', line 70

def spread?
  code_spread?.truthy?
end