Module: Sinclair::MethodDefinition::InstanceMethodDefinition Private
- Defined in:
- lib/sinclair/method_definition/instance_method_definition.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Module responsible for building instance method definitions
Class Method Summary collapse
-
.from(name, code = nil, **options, &block) ⇒ Object
private
Returns an instance method definition.
Class Method Details
.from(name, code = nil, **options, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns an instance method definition
When block is given returns an instance of Sinclair::MethodDefinition::InstanceBlockDefinition, and when not, returns Sinclair::MethodDefinition::InstanceStringDefinition
39 40 41 42 43 44 45 |
# File 'lib/sinclair/method_definition/instance_method_definition.rb', line 39 def self.from(name, code = nil, **, &block) if block InstanceBlockDefinition.new(name, **, &block) else InstanceStringDefinition.new(name, code, **) end end |