Module: Synchronisable::DSL::Macro::ClassMethods Private

Defined in:
lib/synchronisable/dsl/macro.rb

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.

Instance Method Summary collapse

Instance Method Details

#attribute(*attrs, options) ⇒ Object #attribute(*attrs) ⇒ 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.

Defines a new attribute.

Overloads:

  • #attribute(*attrs, options) ⇒ Object

    Parameters:

    • attrs (Array)

      attributes

    • options (Hash)

    Options Hash (options):

    • :default (Object)

      default value, procs & lambdas are lazily evaluated

    • :converter (Lambda)

      method that will be lazily applied to the source value in order to convert it to the desired type


68
69
70
# File 'lib/synchronisable/dsl/macro.rb', line 68

def attribute(*args)
  define_expressions(Attribute, args)
end

#inherited(subclass) ⇒ 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.


50
51
52
53
# File 'lib/synchronisable/dsl/macro.rb', line 50

def inherited(subclass)
  super
  class_attributes[subclass] = Hash[class_attributes[self].map { |k, v| [k, v.clone] }]
end

#method(*attrs, options) ⇒ Object #method(*attrs) ⇒ 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.

Defines a new method.

Overloads:

  • #method(*attrs, options) ⇒ Object

    Parameters:

    • attrs (Array)

      attributes

    • options (Hash)

    Options Hash (options):

    • :default (Object)

      default value, procs & lambdas are lazily evaluated


82
83
84
# File 'lib/synchronisable/dsl/macro.rb', line 82

def method(*args)
  define_expressions(Method, args)
end