Module: Unparser::AbstractType::AbstractMethodDeclarations

Defined in:
lib/unparser/abstract_type.rb

Instance Method Summary collapse

Instance Method Details

#abstract_method(*names) ⇒ self

Create abstract instance methods

Examples:

class Foo
  include AbstractType

  # Create an abstract instance method
  abstract_method :some_method
end

Parameters:

  • names (Array<#to_s>)

Returns:

  • (self)


64
65
66
67
# File 'lib/unparser/abstract_type.rb', line 64

def abstract_method(*names)
  names.each(&method(:create_abstract_instance_method))
  self
end

#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)


84
85
86
87
# File 'lib/unparser/abstract_type.rb', line 84

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