Class: ActivePath::ViewInjection::Configuration::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/active_path/view_injection/configuration/attachment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(partial) ⇒ Attachment

Returns a new instance of Attachment.



7
8
9
10
# File 'lib/active_path/view_injection/configuration/attachment.rb', line 7

def initialize(partial)
  @partial = partial
  @conditions = []
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



5
6
7
# File 'lib/active_path/view_injection/configuration/attachment.rb', line 5

def conditions
  @conditions
end

#partialObject (readonly)

Returns the value of attribute partial.



5
6
7
# File 'lib/active_path/view_injection/configuration/attachment.rb', line 5

def partial
  @partial
end

Instance Method Details

#when(condition = nil, &block) ⇒ Object



12
13
14
15
# File 'lib/active_path/view_injection/configuration/attachment.rb', line 12

def when(condition = nil, &block)
  @conditions << (condition || block)
  self
end