Class: LittleGhost::CodeMode::Ruby::Catalog
- Inherits:
-
CodeMode::Catalog
- Object
- CodeMode::Catalog
- LittleGhost::CodeMode::Ruby::Catalog
- Defined in:
- lib/little_ghost/code_mode/ruby/catalog.rb
Overview
:nodoc:
Constant Summary collapse
- RESERVED_METHODS =
%w[call parallel exec wait stop text finish all_tools].freeze
Instance Method Summary collapse
- #declarations ⇒ Object
- #host_definitions ⇒ Object
-
#initialize(specifications) ⇒ Catalog
constructor
A new instance of Catalog.
Constructor Details
#initialize(specifications) ⇒ Catalog
Returns a new instance of Catalog.
11 12 13 |
# File 'lib/little_ghost/code_mode/ruby/catalog.rb', line 11 def initialize(specifications) super(specifications, normalize: method(:normalize), reserved: RESERVED_METHODS) end |
Instance Method Details
#declarations ⇒ Object
15 16 17 |
# File 'lib/little_ghost/code_mode/ruby/catalog.rb', line 15 def declarations definitions.map { |definition| render_tool(definition.fetch("specification")) }.join("\n\n") end |
#host_definitions ⇒ Object
19 20 21 |
# File 'lib/little_ghost/code_mode/ruby/catalog.rb', line 19 def host_definitions definitions.map { |definition| JSON.parse(JSON.generate(definition.fetch("specification"))) } end |