Class: ActionView::Resolver::Path

Inherits:
String
  • Object
show all
Defined in:
lib/action_view/template/resolver.rb

Overview

Keeps all information about view path and builds virtual path.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, prefix, partial, virtual) ⇒ Path

Returns a new instance of Path.



22
23
24
25
# File 'lib/action_view/template/resolver.rb', line 22

def initialize(name, prefix, partial, virtual)
  @name, @prefix, @partial = name, prefix, partial
  super(virtual)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/action_view/template/resolver.rb', line 12

def name
  @name
end

#partialObject (readonly) Also known as: partial?

Returns the value of attribute partial.



12
13
14
# File 'lib/action_view/template/resolver.rb', line 12

def partial
  @partial
end

#prefixObject (readonly)

Returns the value of attribute prefix.



12
13
14
# File 'lib/action_view/template/resolver.rb', line 12

def prefix
  @prefix
end

#virtualObject (readonly)

Returns the value of attribute virtual.



12
13
14
# File 'lib/action_view/template/resolver.rb', line 12

def virtual
  @virtual
end

Class Method Details

.build(name, prefix, partial) ⇒ Object



15
16
17
18
19
20
# File 'lib/action_view/template/resolver.rb', line 15

def self.build(name, prefix, partial)
  virtual = ""
  virtual << "#{prefix}/" unless prefix.empty?
  virtual << (partial ? "_#{name}" : name)
  new name, prefix, partial, virtual
end