Module: Assertion::DSL::Attribute

Included in:
Guard
Defined in:
lib/assertion/dsl/attribute.rb

Overview

Allows adding aliases to ‘#object` method.

Instance Method Summary collapse

Instance Method Details

#attribute(name) ⇒ undefined

Adds alias to the [#object] method

Parameters:

  • name (#to_sym)

Returns:

  • (undefined)

Raises:

  • (NameError)

    When a given name is either used by instance methods, or reserved by the ‘#state` method to be implemented later.



23
24
25
26
# File 'lib/assertion/dsl/attribute.rb', line 23

def attribute(name)
  __check_attribute__(name)
  alias_method name, :object
end