Method: Mooncell::Command::ClassMethods#expose

Defined in:
lib/mooncell/command.rb

#expose(*names) ⇒ 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.

Expose instance variable

Parameters:

  • the (Array<Symbol>)

    variable name to expose

Since:

  • 0.1.0



36
37
38
39
40
41
42
43
44
# File 'lib/mooncell/command.rb', line 36

def expose(*names)
  class_eval do
    names.each do |name|
      attr_reader name unless attr_reader?(name)
    end

    exposures.push(*names)
  end
end