Class: ParamsReady::Parameter::TupleParameter

Inherits:
Parameter show all
Includes:
Marshaller::ParameterModule, ArrayParameter::ArrayLike
Defined in:
lib/params_ready/parameter/tuple_parameter.rb

Instance Attribute Summary

Attributes inherited from AbstractParameter

#definition

Instance Method Summary collapse

Methods included from Marshaller::ParameterModule

#marshal

Methods included from ArrayParameter::ArrayLike

#[], #[]=

Methods included from ComplexParameter

#update_child

Methods inherited from Parameter

#allows_undefined?, #definite_default?, #eligible_for_output?, #find_in_hash, #format, #format_self_permitted, #freeze, #hash, #hash_key, #initialize, #inspect_content, #is_default?, #is_definite?, #is_nil?, #is_undefined?, #memo, #memo!, #nil_default?, #populate_other, #set_from_input, #set_value, #to_hash_if_eligible, #unwrap, #unwrap_or, #wrap_output

Methods inherited from AbstractParameter

#==, #dup, #initialize, #inspect, intent_for_children, #match?, #populate, #to_hash, #update_if_applicable, #update_in

Methods included from Extensions::Freezer

#freeze_variable, #freeze_variables, #variables_to_freeze

Methods included from FromHash

#set_from_hash

Methods included from Extensions::Freezer::InstanceMethods

#freeze

Constructor Details

This class inherits a constructor from ParamsReady::Parameter::Parameter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/params_ready/parameter/tuple_parameter.rb', line 24

def method_missing(name, *args)
  integer = ordinal_to_integer(name)
  if integer.nil?
    super
  else
    self[integer - 1]
  end
end

Instance Method Details

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/params_ready/parameter/tuple_parameter.rb', line 33

def respond_to_missing?(name, include_private = false)
  return true unless ordinal_to_integer(name).nil?
  super
end