Method: Mtree::FileSpecification#initialize

Defined in:
lib/mtree/file_specification.rb

#initialize(filename, attributes = {}) ⇒ FileSpecification

Returns a new instance of FileSpecification.



22
23
24
25
26
27
28
29
30
31
# File 'lib/mtree/file_specification.rb', line 22

def initialize(filename, attributes = {})
  @filename = filename
  @relative_path = filename
  if (invalid_keys = attributes.keys - VALID_ATTRIBUTES) != []
    raise "Unsupported attribute: #{invalid_keys.first}"
  end

  @attributes = attributes
  @children = []
end