Class: ActionView::Resolver::Path
- Inherits:
-
Object
- Object
- ActionView::Resolver::Path
- Defined in:
- lib/action_view/template/resolver.rb
Overview
Keeps all information about view path and builds virtual path.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#partial ⇒ Object
(also: #partial?)
readonly
Returns the value of attribute partial.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#virtual ⇒ Object
readonly
Returns the value of attribute virtual.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, prefix, partial, virtual) ⇒ Path
constructor
A new instance of Path.
- #to_str ⇒ Object (also: #to_s)
Constructor Details
#initialize(name, prefix, partial, virtual) ⇒ Path
Returns a new instance of Path.
25 26 27 28 29 30 |
# File 'lib/action_view/template/resolver.rb', line 25 def initialize(name, prefix, partial, virtual) @name = name @prefix = prefix @partial = partial @virtual = virtual end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/action_view/template/resolver.rb', line 15 def name @name end |
#partial ⇒ Object (readonly) Also known as: partial?
Returns the value of attribute partial.
15 16 17 |
# File 'lib/action_view/template/resolver.rb', line 15 def partial @partial end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
15 16 17 |
# File 'lib/action_view/template/resolver.rb', line 15 def prefix @prefix end |
#virtual ⇒ Object (readonly)
Returns the value of attribute virtual.
15 16 17 |
# File 'lib/action_view/template/resolver.rb', line 15 def virtual @virtual end |
Class Method Details
.build(name, prefix, partial) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/action_view/template/resolver.rb', line 18 def self.build(name, prefix, partial) virtual = "".dup virtual << "#{prefix}/" unless prefix.empty? virtual << (partial ? "_#{name}" : name) new name, prefix, partial, virtual end |
Instance Method Details
#to_str ⇒ Object Also known as: to_s
32 33 34 |
# File 'lib/action_view/template/resolver.rb', line 32 def to_str @virtual end |