Module: Synonyms

Included in:
Splunk::ReadOnlyCollection, Splunk::ReadOnlyEntity
Defined in:
lib/splunk-sdk-ruby/synonyms.rb

Overview

Easy creation of synonyms for methods.

To make it easy to create Ruby’s synonym sets (such as has_key?/include?/member?/etc. on Hash), we provide a mixin Synonyms with one method, synonym. synonym defines a new method named by its first parameter, with the same behavior as the method named by its second parameter.

Example:

require 'synonyms'

class A
  extend Synonyms
  def f(...) ... end
  synonym "g" "f"