Class: HMap::HeaderEntry
- Inherits:
-
Object
- Object
- HMap::HeaderEntry
- Defined in:
- lib/hmap/xc/header_entry.rb
Instance Attribute Summary collapse
-
#extra_keys ⇒ Object
readonly
Returns the value of attribute extra_keys.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #full_module_buckets(moudle_name) ⇒ Object
- #full_module_buckets_extra(moudle_name) ⇒ Object
-
#initialize(path, extra_keys, type) ⇒ HeaderEntry
constructor
A new instance of HeaderEntry.
- #module_buckets(moudle_name) ⇒ Object
- #module_buckets_extra(moudle_name) ⇒ Object
- #project_buckets ⇒ Object
- #project_buckets_extra ⇒ Object
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_keys ⇒ Object (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 |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/hmap/xc/header_entry.rb', line 3 def path @path end |
#type ⇒ Object (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_buckets ⇒ Object
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_extra ⇒ Object
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 |