Class: ActionController::ParamsWrapper::Options

Inherits:
Struct
  • Object
show all
Includes:
Mutex_m
Defined in:
lib/action_controller/metal/params_wrapper.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, format, include, exclude, klass, model) ⇒ Options

:nodoc:



100
101
102
103
104
# File 'lib/action_controller/metal/params_wrapper.rb', line 100

def initialize(name, format, include, exclude, klass, model) # :nodoc:
  super
  @include_set = include
  @name_set    = name
end

Instance Attribute Details

#excludeObject

Returns the value of attribute exclude

Returns:

  • (Object)

    the current value of exclude



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def exclude
  @exclude
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def format
  @format
end

#includeObject

Returns the value of attribute include

Returns:

  • (Object)

    the current value of include



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def include
  @include
end

#klassObject

Returns the value of attribute klass

Returns:

  • (Object)

    the current value of klass



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def klass
  @klass
end

#modelObject

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def model
  @model
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



89
90
91
# File 'lib/action_controller/metal/params_wrapper.rb', line 89

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/action_controller/metal/params_wrapper.rb', line 92

def self.from_hash(hash)
  name    = hash[:name]
  format  = Array(hash[:format])
  include = hash[:include] && Array(hash[:include]).collect(&:to_s)
  exclude = hash[:exclude] && Array(hash[:exclude]).collect(&:to_s)
  new name, format, include, exclude, nil, nil
end