Class: Envandle::History

Inherits:
Object
  • Object
show all
Defined in:
lib/envandle/history.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



11
12
13
# File 'lib/envandle/history.rb', line 11

def method_missing(name, *args, &block)
  add_argset name, *args, &block
end

Instance Method Details

#add_argset(name, *args, &block) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/envandle/history.rb', line 15

def add_argset(name, *args, &block)
  a = [name, *args]
  argsets << a
  if block
    h = History.new
    block.call h
    a << h.argsets
  end
end

#argsetsObject



7
8
9
# File 'lib/envandle/history.rb', line 7

def argsets
  @argsets ||= []
end

#gem(*args) ⇒ Object



25
26
27
# File 'lib/envandle/history.rb', line 25

def gem(*args)
  add_argset :gem, *args
end

#receiverObject



3
4
5
# File 'lib/envandle/history.rb', line 3

def receiver
  self
end