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


155
156
157
158
# File 'lib/fortitude/widget/needs.rb', line 155

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

#assignsObject

PUBLIC API


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

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


166
167
168
# File 'lib/fortitude/widget/needs.rb', line 166

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

#my_needs_as_hashObject

INTERNAL USE ONLY


176
177
178
# File 'lib/fortitude/widget/needs.rb', line 176

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

#needs_as_hashObject

INTERNAL USE ONLY


171
172
173
# File 'lib/fortitude/widget/needs.rb', line 171

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

#shared_variablesObject

PUBLIC API


161
162
163
# File 'lib/fortitude/widget/needs.rb', line 161

def shared_variables
  @_fortitude_rendering_context.instance_variable_set
end

#widget_extra_assignsObject

INTERNAL USE ONLY


191
192
193
# File 'lib/fortitude/widget/needs.rb', line 191

def widget_extra_assigns
  (@_fortitude_extra_assigns || { })
end