Skip to content

Request for additional documentation #6

Closed

Description

@brian-kephart

It's unclear how this gem can be applied to alternative approaches to method definition. For example, can ruby2_keywords be applied to the following code?

def self.define_proxy(name)
  define_method name do |*args, &block|
    view_context.send(name, *args, &block)
  end
end

(Code example is from Draper)

Activity

  1. mame commented on Dec 28, 2020

    @mame
    Member

    Thank you for contacting us. I think the following is enough like a normal def definition.

    def self.define_proxy(name)
      define_method name do |*args, &block|
        view_context.send(name, *args, &block)
      end
      ruby2_keywords name
    end

    Do you have any problem about this? I'll be happy to add this to the README.md.

  2. brian-kephart commented on Dec 28, 2020

    @brian-kephart
    Author

    Thank you very much! Your suggestion works well, and I think it would be a good addition to the README.

  3. added a commit that references this issue on Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions