module Autostruct::Mixin

Public Instance Methods

autostruct!(caller_binding) click to toggle source
# File lib/autostruct/mixin.rb, line 7
def autostruct!(caller_binding)
  m = eval("method(__method__)", caller_binding)

  caller_parameters = m.parameters.each.with_object({}) do |(_t, name), p|
    p[name.intern] = caller_binding.local_variable_get(name)
  end

  receive(caller_parameters)
end