Class: Jekyll::Archimate::ArchimateIndexGenerator
- Inherits:
-
Object
- Object
- Jekyll::Archimate::ArchimateIndexGenerator
- Defined in:
- lib/jekyll/archimate/archimate_index_generator.rb
Instance Attribute Summary collapse
-
#archimate_file ⇒ Object
readonly
Returns the value of attribute archimate_file.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(site, archimate_file) ⇒ ArchimateIndexGenerator
constructor
A new instance of ArchimateIndexGenerator.
- #model ⇒ Object
Constructor Details
#initialize(site, archimate_file) ⇒ ArchimateIndexGenerator
Returns a new instance of ArchimateIndexGenerator.
9 10 11 12 13 |
# File 'lib/jekyll/archimate/archimate_index_generator.rb', line 9 def initialize(site, archimate_file) @site = site @archimate_file = archimate_file @name = "index.json" end |
Instance Attribute Details
#archimate_file ⇒ Object (readonly)
Returns the value of attribute archimate_file.
7 8 9 |
# File 'lib/jekyll/archimate/archimate_index_generator.rb', line 7 def archimate_file @archimate_file end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
6 7 8 |
# File 'lib/jekyll/archimate/archimate_index_generator.rb', line 6 def site @site end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/archimate/archimate_index_generator.rb', line 15 def generate ConditionalFile.new( site, File.dirname(archimate_file.relative_path), @name, archimate_file ).write(JSON.generate(UnifiedModel.new(model).to_h)) end |
#model ⇒ Object
24 25 26 |
# File 'lib/jekyll/archimate/archimate_index_generator.rb', line 24 def model @model ||= ArchimateCache.instance.model(archimate_file) end |