Class: HMap::HeaderEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/hmap/xc/header_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, extra_keys, type) ⇒ HeaderEntry

Returns a new instance of HeaderEntry.



5
6
7
8
9
# File 'lib/hmap/xc/header_entry.rb', line 5

def initialize(path, extra_keys, type)
  @path = path
  @extra_keys = extra_keys
  @type = type
end

Instance Attribute Details

#extra_keysObject (readonly)

Returns the value of attribute extra_keys.



3
4
5
# File 'lib/hmap/xc/header_entry.rb', line 3

def extra_keys
  @extra_keys
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/hmap/xc/header_entry.rb', line 3

def path
  @path
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/hmap/xc/header_entry.rb', line 3

def type
  @type
end

Instance Method Details

#full_module_buckets(moudle_name) ⇒ Object



23
24
25
26
27
28
# File 'lib/hmap/xc/header_entry.rb', line 23

def full_module_buckets(moudle_name)
  h_name = File.basename(path)
  h_dir = File.dirname(path)
  module_k = "#{moudle_name}/#{h_name}"
  { module_k => ["#{h_dir}/", h_name] }
end

#full_module_buckets_extra(moudle_name) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/hmap/xc/header_entry.rb', line 48

def full_module_buckets_extra(moudle_name)
  h_name = File.basename(path)
  h_dir = File.dirname(path)
  module_k = "#{moudle_name}/#{h_name}"
  buckets = {}
  buckets[module_k] = ["#{h_dir}/", h_name] unless extra_keys.include?(module_k)
  extra_keys.each { |key| buckets[key] = ["#{h_dir}/", h_name] }
  buckets
end

#module_buckets(moudle_name) ⇒ Object



17
18
19
20
21
# File 'lib/hmap/xc/header_entry.rb', line 17

def module_buckets(moudle_name)
  h_name = File.basename(path)
  module_p = "#{moudle_name}/"
  { h_name => [module_p, h_name] }
end

#module_buckets_extra(moudle_name) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/hmap/xc/header_entry.rb', line 39

def module_buckets_extra(moudle_name)
  h_name = File.basename(path)
  module_p = "#{moudle_name}/"
  buckets = {}
  buckets[h_name] = [module_p, h_name] unless extra_keys.include?(h_name)
  extra_keys.each { |key| buckets[key] = [module_p, h_name] }
  buckets
end

#project_bucketsObject



11
12
13
14
15
# File 'lib/hmap/xc/header_entry.rb', line 11

def project_buckets
  h_name = File.basename(path)
  h_dir = File.dirname(path)
  { h_name => ["#{h_dir}/", h_name] }
end

#project_buckets_extraObject



30
31
32
33
34
35
36
37
# File 'lib/hmap/xc/header_entry.rb', line 30

def project_buckets_extra
  h_name = File.basename(path)
  h_dir = File.dirname(path)
  buckets = {}
  buckets[h_name] = ["#{h_dir}/", h_name] unless extra_keys.include?(h_name)
  extra_keys.each { |key| buckets[key] = ["#{h_dir}/", h_name] }
  buckets
end