Class: Rails::Surrender::Render::Configuration

Inherits:
Object
  • Object
show all
Includes:
InclusionMapperLogic, InstanceLogic
Defined in:
lib/rails/surrender/render/configuration.rb,
lib/rails/surrender/render/configuration/instance_logic.rb,
lib/rails/surrender/render/configuration/inclusion_mapper_logic.rb

Overview

Container for config structure when rendering or generating the inclusion object.

Defined Under Namespace

Modules: InclusionMapperLogic, InstanceLogic Classes: Element

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InstanceLogic

#exclude_locally?, #locally_included_attributes, #locally_included_expands, #nested_ctrl_excludes, #nested_ctrl_includes, #nested_user_excludes, #nested_user_includes

Methods included from InclusionMapperLogic

#expanding_elements

Constructor Details

#initialize(resource_class: nil, reload_resource: false, user_exclude: [], user_include: [], ctrl_exclude: [], ctrl_include: [], history: []) ⇒ Configuration

Returns a new instance of Configuration.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rails/surrender/render/configuration.rb', line 26

def initialize(
  resource_class: nil,
  reload_resource: false,
  user_exclude: [],
  user_include: [],
  ctrl_exclude: [],
  ctrl_include: [],
  history: []
)
  @resource_class = resource_class
  @reload_resource = reload_resource
  @user_exclude = user_exclude.compact
  @user_include = user_include
  @ctrl_exclude = ctrl_exclude.compact
  @ctrl_include = ctrl_include
  @history = history

  validate_user_includes!
end

Instance Attribute Details

#ctrl_excludeObject

Returns the value of attribute ctrl_exclude.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def ctrl_exclude
  @ctrl_exclude
end

#ctrl_includeObject

Returns the value of attribute ctrl_include.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def ctrl_include
  @ctrl_include
end

#historyObject

Returns the value of attribute history.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def history
  @history
end

#reload_resourceObject Also known as: reload_resource?

Returns the value of attribute reload_resource.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def reload_resource
  @reload_resource
end

#resource_classObject

Returns the value of attribute resource_class.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def resource_class
  @resource_class
end

#user_excludeObject

Returns the value of attribute user_exclude.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def user_exclude
  @user_exclude
end

#user_includeObject

Returns the value of attribute user_include.



14
15
16
# File 'lib/rails/surrender/render/configuration.rb', line 14

def user_include
  @user_include
end