Class: Lexicon::Common::Package::PackageFile

Inherits:
Object
  • Object
show all
Defined in:
lib/lexicon/common/package/package_file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathPathname (readonly)

Returns:

  • (Pathname)


18
19
20
# File 'lib/lexicon/common/package/package_file.rb', line 18

def path
  @path
end

Class Method Details

.new_data(path) ⇒ Object



12
13
14
# File 'lib/lexicon/common/package/package_file.rb', line 12

def new_data(path)
  new(path, type: DATA)
end

.new_structure(path) ⇒ Object



8
9
10
# File 'lib/lexicon/common/package/package_file.rb', line 8

def new_structure(path)
  new(path, type: STRUCTURE)
end

Instance Method Details

#data?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/lexicon/common/package/package_file.rb', line 26

def data?
  type == DATA
end

#structure?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/lexicon/common/package/package_file.rb', line 31

def structure?
  type == STRUCTURE
end

#to_sString

Returns:

  • (String)


21
22
23
# File 'lib/lexicon/common/package/package_file.rb', line 21

def to_s
  path.to_s
end