Module: Sinclair::MethodDefinition::ClassMethodDefinition Private
- Defined in:
- lib/sinclair/method_definition/class_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 class 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 InstanceBlockDefinition, and when not, returns InstanceStringDefinition
41 42 43 44 45 46 47 |
# File 'lib/sinclair/method_definition/class_method_definition.rb', line 41 def self.from(name, code = nil, **, &block) if block ClassBlockDefinition.new(name, **, &block) else ClassStringDefinition.new(name, code, **) end end |