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}"
  [BucketStr.new(module_k, "#{h_dir}/", h_name)]
end

#full_module_buckets_extra(moudle_name) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/hmap/xc/header_entry.rb', line 46

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 << BucketStr.new(module_k, "#{h_dir}/", h_name) unless extra_keys.include?(module_k)
  buckets + extra_keys.map { |key| BucketStr.new(key, "#{h_dir}/", h_name) }
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}/"
  [BucketStr.new(h_name, module_p, h_name)]
end

#module_buckets_extra(moudle_name) ⇒ Object



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

def module_buckets_extra(moudle_name)
  h_name = File.basename(path)
  module_p = "#{moudle_name}/"
  buckets = []
  buckets << BucketStr.new(h_name, module_p, h_name) unless extra_keys.include?(h_name)
  buckets + extra_keys.map { |key| BucketStr.new(key, module_p, h_name) }
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)
  [BucketStr.new(h_name, "#{h_dir}/", h_name)]
end

#project_buckets_extraObject



30
31
32
33
34
35
36
# 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 << BucketStr.new(h_name, "#{h_dir}/", h_name) unless extra_keys.include?(h_name)
  buckets + extra_keys.map { |key| BucketStr.new(key, "#{h_dir}/", h_name) }
end