Class: Partializer::Partial

Inherits:
Object
  • Object
show all
Defined in:
lib/partializer/partial.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionObject (readonly)

Returns the value of attribute action.



3
4
5
# File 'lib/partializer/partial.rb', line 3

def action
  @action
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/partializer/partial.rb', line 3

def name
  @name
end

#nsObject (readonly)

Returns the value of attribute ns.



3
4
5
# File 'lib/partializer/partial.rb', line 3

def ns
  @ns
end

#pathObject

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_pathObject



25
26
27
# File 'lib/partializer/partial.rb', line 25

def to_partial_path
  view_path.gsub('.', '/')
end

#view_pathObject



21
22
23
# File 'lib/partializer/partial.rb', line 21

def view_path
  [ns, action, path, name].compact.join('/')
end