Method: AbstractType::AbstractMethodDeclarations#abstract_singleton_method

Defined in:
lib/abstract_type.rb

#abstract_singleton_method(*names) ⇒ self

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.

Create abstract singleton methods

Examples:

class Foo
  include AbstractType

  # Create an abstract instance method
  abstract_singleton_method :some_method
end

Parameters:

  • names (Array<#to_s>)

Returns:

  • (self)


81
82
83
84
# File 'lib/abstract_type.rb', line 81

def abstract_singleton_method(*names)
  names.each(&method(:create_abstract_singleton_method))
  self
end