Class: ActionController::ParamsWrapper::Options

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

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json, #to_h

Constructor Details

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

nodoc


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

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


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def exclude
  @exclude
end

#formatObject

Returns the value of attribute format


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def format
  @format
end

#includeObject

Returns the value of attribute include


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def include
  @include
end

#klassObject

Returns the value of attribute klass


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def klass
  @klass
end

#modelObject

Returns the value of attribute model


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def model
  @model
end

#nameObject

Returns the value of attribute name


78
79
80
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 78

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object


81
82
83
84
85
86
87
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 81

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