Class: Valise::Stack::SingleExtensionDecorator
- Inherits:
-
Decorator
- Object
- Valise::Stack
- Decorator
- Valise::Stack::SingleExtensionDecorator
- Defined in:
- lib/valise/stack/extensions-decorator.rb
Instance Attribute Summary
Attributes inherited from Valise::Stack
Instance Method Summary collapse
-
#initialize(stack, lead_decco, ext) ⇒ SingleExtensionDecorator
constructor
A new instance of SingleExtensionDecorator.
- #inspect ⇒ Object
- #reget(root) ⇒ Object
- #segments ⇒ Object
Methods inherited from Decorator
#each, #rel_path, #sub_stack, #valise
Methods inherited from Valise::Stack
#below, #depth_of, #diffed, #dump_load, #each, #exts, #find, #item_for, #merge_diff, #merged, #not_above, #pfxs, #raw_find, #rel_path, #reverse
Methods included from ItemEnum
Methods included from Unpath
#clean_pathname, #containing_workspace, #current_directory, #file_from_backtrace, #from_here, #make_pathname, #starting_directory, #up_to, #up_until
Constructor Details
#initialize(stack, lead_decco, ext) ⇒ SingleExtensionDecorator
Returns a new instance of SingleExtensionDecorator.
35 36 37 38 39 40 41 42 |
# File 'lib/valise/stack/extensions-decorator.rb', line 35 def initialize(stack, lead_decco, ext) super(stack) @leader = lead_decco @ext = ext dir, file = *(stack.segments.split.map(&:to_s)) @segments = make_pathname([dir, (file.to_s + ext)]) end |
Instance Method Details
#inspect ⇒ Object
44 45 46 |
# File 'lib/valise/stack/extensions-decorator.rb', line 44 def inspect @stack.inspect + @ext end |
#reget(root) ⇒ Object
52 53 54 |
# File 'lib/valise/stack/extensions-decorator.rb', line 52 def reget(root) @leader.reget(root) end |
#segments ⇒ Object
48 49 50 |
# File 'lib/valise/stack/extensions-decorator.rb', line 48 def segments @segments end |