Module: Rails::Paths::PathParent

Included in:
Path, Root
Defined in:
lib/rails/paths.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rails/paths.rb', line 8

def method_missing(id, *args)
  name = id.to_s

  if name =~ /^(.*)=$/ || args.any?
    @children[$1 || name] = Path.new(@root, *args)
  elsif path = @children[name]
    path
  else
    super
  end
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



6
7
8
# File 'lib/rails/paths.rb', line 6

def children
  @children
end