Module: Fortitude::Widget::Needs

Extended by:
ActiveSupport::Concern
Included in:
Fortitude::Widget
Defined in:
lib/fortitude/widget/needs.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

REQUIRED_NEED =

INTERNAL USE ONLY

Object.new
NOT_PRESENT_NEED =

INTERNAL USE ONLY

Object.new

Instance Method Summary collapse

Instance Method Details

#assign_locals_from(assigns) ⇒ Object



153
154
155
156
# File 'lib/fortitude/widget/needs.rb', line 153

def assign_locals_from(assigns)
  self.class.ensure_needs_methods_are_valid!
  assign_locals_from(assigns)
end

#assignsObject

PUBLIC API



179
180
181
182
183
184
185
186
# File 'lib/fortitude/widget/needs.rb', line 179

def assigns
  @_fortitude_assigns_proxy ||= begin
    keys = needs_as_hash.keys
    keys |= (@_fortitude_raw_assigns.keys.map(&:to_sym)) if self.class.extra_assigns == :use

    Fortitude::Support::AssignsProxy.new(self, keys)
  end
end

#instance_variable_name_for_need(need) ⇒ Object

INTERNAL USE ONLY



164
165
166
# File 'lib/fortitude/widget/needs.rb', line 164

def instance_variable_name_for_need(need)
  self.class.instance_variable_name_for_need(need)
end

#my_needs_as_hashObject

INTERNAL USE ONLY



174
175
176
# File 'lib/fortitude/widget/needs.rb', line 174

def my_needs_as_hash
  @_fortitude_my_needs_as_hash ||= self.class.my_needs_as_hash
end

#needs_as_hashObject

INTERNAL USE ONLY



169
170
171
# File 'lib/fortitude/widget/needs.rb', line 169

def needs_as_hash
  @_fortitude_needs_as_hash ||= self.class.needs_as_hash
end

#shared_variablesObject

PUBLIC API



159
160
161
# File 'lib/fortitude/widget/needs.rb', line 159

def shared_variables
  @_fortitude_rendering_context.instance_variable_set
end

#widget_extra_assignsObject

INTERNAL USE ONLY



189
190
191
# File 'lib/fortitude/widget/needs.rb', line 189

def widget_extra_assigns
  (@_fortitude_extra_assigns || { })
end