Class: Jewel::Gem::Root

Inherits:
Pathname
  • Object
show all
Defined in:
lib/jewel/gem/root.rb

Overview

A Pathname that allows subdirectory access through method chaining.

Author:

  • Matheus Afonso Martins Moreira

Since:

  • 0.0.5

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *arguments, &block) ⇒ Jewel::Gem::Root

Joins the name of the missing method and all arguments with this Pathname.

Returns:

Since:

  • 0.0.5



16
17
18
19
20
# File 'lib/jewel/gem/root.rb', line 16

def method_missing(method_name, *arguments, &block)
  arguments.unshift method_name.to_s
  pathname = join *arguments
  self.class.new pathname
end