module AyeCommander::Ivar::ClassMethods

Instance variable related class methods

Public Instance Methods

at() click to toggle source
# File lib/aye_commander/ivar.rb, line 29
def at
  ::AyeCommander::Ivar::AT
end
define_missing_reader(reader) click to toggle source

Adds the received reader to the class. It prefers using 'uses' it available (command), but will use attr_reader if it isn't (result).

# File lib/aye_commander/ivar.rb, line 13
def define_missing_reader(reader)
  respond_to?(:uses) ? uses(reader) : attr_reader(reader)
end
eq() click to toggle source
# File lib/aye_commander/ivar.rb, line 33
def eq
  ::AyeCommander::Ivar::EQ
end
to_ivar(name) click to toggle source

Transforms the received name to instance variable form Eg: command -> @command

# File lib/aye_commander/ivar.rb, line 19
def to_ivar(name)
  name[0] == at ? name.to_sym : "@#{name}".to_sym
end
to_nvar(name) click to toggle source

Transforms the received name to normal variable form Eg: @command -> command

# File lib/aye_commander/ivar.rb, line 25
def to_nvar(name)
  name[0] == at ? name[1..-1].to_sym : name.to_sym
end