Method: Class#class_inheritable_accessor

Defined in:
lib/wukong/extensions/class.rb

#class_inheritable_accessor(*syms) ⇒ Array[#to_s]

Defines class-level inheritable attribute accessor. Attributes are available to subclasses, each subclass has a copy of parent’s attribute.

Parameters:

  • *syms (Array[*#to_s, Hash{:instance_writer => Boolean}])

    Array of attributes to define inheritable accessor for.

  • syms (Hash)

    a customizable set of options

Options Hash (*syms):

  • :instance_writer (Boolean)

    if true, instance-level inheritable attribute writer is defined.

Returns:

  • (Array[#to_s])

    An Array of attributes turned into inheritable accessors.



178
179
180
181
# File 'lib/wukong/extensions/class.rb', line 178

def class_inheritable_accessor(*syms)
  class_inheritable_reader(*syms)
  class_inheritable_writer(*syms)
end