Module: Fsck

Included in:
Object
Defined in:
lib/fsck.rb,
lib/fsck/version.rb

Constant Summary collapse

VERSION =
"0.0.5"

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/fsck.rb', line 2

def method_missing(method_name, *args, &block)
  fscked_method = __fsck_method__(method_name)

  if fscked_method
    target = singleton_methods.include?(fscked_method) ? singleton_class : self.class
    target.class_exec { alias_method(method_name, fscked_method) }
    send(method_name, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fsck.rb', line 14

def respond_to_missing?(method_name, include_private = false)
  !!__fsck_method__(method_name)
end