Sha256: 9406cb51d0b15ec973dbd33005621b6f4c2d44c0146044716bc48fb881a2bd40

Contents?: true

Size: 1.16 KB

Versions: 18

Compression:

Stored size: 1.16 KB

Contents

def assign_locals_from(assigns)
  return assign_locals_from(assigns) if self.class.ensure_needs_methods_are_valid!

  @_fortitude_raw_assigns = assigns
  @_fortitude_raw_assigns = @_fortitude_raw_assigns.delete_if { |k,v| ! self.class.is_valid_ruby_method_name?(k) } # :if extra_assigns == :use
  @_fortitude_default_assigns = { }
  the_needs = needs_as_hash
  missing = [ ]
  have_missing = false

  @_fortitude_extra_assigns = assigns.symbolize_keys          # :if [ :error, :use ].include?(extra_assigns)

  #{needs_text}

  if @_fortitude_extra_assigns.size > 0                       # :if extra_assigns == :error
    raise Fortitude::Errors::ExtraAssigns.new(self, @_fortitude_extra_assigns) # :if extra_assigns == :error
  end                                                         # :if extra_assigns == :error

  @_fortitude_extra_assigns.each do |key, value|              # :if extra_assigns == :use
    instance_variable_set(instance_variable_name_for_need(key), value) # :if extra_assigns == :use
  end                                                         # :if extra_assigns == :use

  raise Fortitude::Errors::MissingNeed.new(self, missing, assigns) if have_missing
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fortitude-0.9.6-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.6 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.5-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.5 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.4-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.4 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.3-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.3 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.2-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.2 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.1-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.1 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.0-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.9.0 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.0.10-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.0.10 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.0.9-java lib/fortitude/method_templates/assign_locals_from_template.rb.smpl
fortitude-0.0.9 lib/fortitude/method_templates/assign_locals_from_template.rb.smpl