Class: BigResources::TreeHierarchyType

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/big_resources/model/hierarchy_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.file_type_name(file_name) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/big_resources/model/hierarchy_type.rb', line 20

def self.file_type_name(file_name)
  if file_name == "file"
    "file"
  elsif file_name == "directory"
    "directory"
  end
end

.type(file_name) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/big_resources/model/hierarchy_type.rb', line 12

def self.type(file_name)
  if file_name == "file"
    FILE
  elsif file_name == "directory"
    DIRECTORY
  end
end

Instance Method Details

#each {|'file'| ... } ⇒ Object

Yields:

  • ('file')


7
8
9
10
# File 'lib/big_resources/model/hierarchy_type.rb', line 7

def each
  yield 'file'
  yield 'directory'
end