Class: ActivePath::ViewInjection::Configuration::Attachment
- Inherits:
-
Object
- Object
- ActivePath::ViewInjection::Configuration::Attachment
- Defined in:
- lib/active_path/view_injection/configuration/attachment.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#partial ⇒ Object
readonly
Returns the value of attribute partial.
Instance Method Summary collapse
-
#initialize(partial) ⇒ Attachment
constructor
A new instance of Attachment.
- #when(condition = nil, &block) ⇒ Object
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
#conditions ⇒ Object (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 |
#partial ⇒ Object (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 |