Class: Partializer::Partial
- Inherits:
-
Object
- Object
- Partializer::Partial
- Defined in:
- lib/partializer/partial.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ns ⇒ Object
readonly
Returns the value of attribute ns.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, name) ⇒ Partial
constructor
A new instance of Partial.
- #to_partial_path ⇒ Object
- #view_path ⇒ Object
Constructor Details
#initialize(path, name) ⇒ Partial
Returns a new instance of Partial.
5 6 7 8 |
# File 'lib/partializer/partial.rb', line 5 def initialize path, name @path = path unless path.blank? self.name = name end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/partializer/partial.rb', line 3 def action @action end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/partializer/partial.rb', line 3 def name @name end |
#ns ⇒ Object (readonly)
Returns the value of attribute ns.
3 4 5 |
# File 'lib/partializer/partial.rb', line 3 def ns @ns end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/partializer/partial.rb', line 3 def path @path end |
Instance Method Details
#to_partial_path ⇒ Object
25 26 27 |
# File 'lib/partializer/partial.rb', line 25 def to_partial_path view_path.gsub('.', '/') end |
#view_path ⇒ Object
21 22 23 |
# File 'lib/partializer/partial.rb', line 21 def view_path [ns, action, path, name].compact.join('/') end |