Class: ActionView::Resolver::Path
- Defined in:
- actionpack/lib/action_view/template/resolver.rb
Overview
Keeps all information about view path and builds virtual path.
Constant Summary
Constants inherited from String
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.
Methods inherited from String
#acts_like_string?, #as_json, #at, #blank?, #camelize, #classify, #constantize, #dasherize, #deconstantize, #demodulize, #encode_json, #encoding_aware?, #exclude?, #first, #foreign_key, #from, #html_safe, #humanize, #inquiry, #is_utf8?, #last, #mb_chars, #ord, #parameterize, #pluralize, #safe_constantize, #singularize, #squish, #squish!, #strip_heredoc, #tableize, #titleize, #to, #to_date, #to_datetime, #to_time, #truncate, #underscore
Constructor Details
#initialize(name, prefix, partial, virtual) ⇒ Path
Returns a new instance of Path.
21 22 23 24 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 21 def initialize(name, prefix, partial, virtual) @name, @prefix, @partial = name, prefix, partial super(virtual) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name
11 12 13 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 11 def name @name end |
#partial ⇒ Object (readonly) Also known as: partial?
Returns the value of attribute partial
11 12 13 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 11 def partial @partial end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix
11 12 13 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 11 def prefix @prefix end |
#virtual ⇒ Object (readonly)
Returns the value of attribute virtual
11 12 13 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 11 def virtual @virtual end |
Class Method Details
.build(name, prefix, partial) ⇒ Object
14 15 16 17 18 19 |
# File 'actionpack/lib/action_view/template/resolver.rb', line 14 def self.build(name, prefix, partial) virtual = "" virtual << "#{prefix}/" unless prefix.empty? virtual << (partial ? "_#{name}" : name) new name, prefix, partial, virtual end |