Class: Valise::Set::PrefixesDecorator

Inherits:
Decorator show all
Defined in:
lib/valise/set/extensions-decorator.rb

Constant Summary

Constants inherited from Valise::Set

ALL_FILES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Decorator

#merge_diff, #search_roots, #serialization

Methods inherited from Valise::Set

#+, #[], #add_handler, #add_merge_handler, #add_search_root, #add_serialization_handler, #below, #cached, #clean_pattern, #contents, #default_mappings, #define, define, #depth_of, #each, #exts, #files, #find, #glob, #handle_templates, #handler_lists, #merge_diff_for, #merge_handlers, #not_above, #pfxs, #populate, #prepend_search_root, #reverse, #serialization_for, #stemmed, #sub_set, #templates, #to_s, #transform

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(set) ⇒ PrefixesDecorator

Returns a new instance of PrefixesDecorator.



27
28
29
30
# File 'lib/valise/set/extensions-decorator.rb', line 27

def initialize(set)
  super
  @prefixes = []
end

Instance Attribute Details

#prefixesObject

Returns the value of attribute prefixes.



31
32
33
# File 'lib/valise/set/extensions-decorator.rb', line 31

def prefixes
  @prefixes
end

Instance Method Details

#get(path) ⇒ Object



37
38
39
# File 'lib/valise/set/extensions-decorator.rb', line 37

def get(path)
  set.get(path).exts(*prefixes)
end

#inspectObject



33
34
35
# File 'lib/valise/set/extensions-decorator.rb', line 33

def inspect
  "#{prefixes.inspect}x#{set.inspect}"
end