Class: Jast::Generator
- Inherits:
-
Object
- Object
- Jast::Generator
- Defined in:
- lib/jast.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#base_path ⇒ Object
Returns the value of attribute base_path.
-
#definitions_path ⇒ Object
Returns the value of attribute definitions_path.
Instance Method Summary collapse
-
#initialize(api_version: 1, base_path: nil) ⇒ Generator
constructor
A new instance of Generator.
- #render_schemas(name, properties, required) ⇒ Object
Constructor Details
#initialize(api_version: 1, base_path: nil) ⇒ Generator
Returns a new instance of Generator.
8 9 10 11 |
# File 'lib/jast.rb', line 8 def initialize api_version: 1, base_path: nil @api_version = api_version @base_path = base_path.nil? ? "spec/support/api/v#{api_version}/schemas/" : base_path end |
Instance Attribute Details
#api_version ⇒ Object
Returns the value of attribute api_version.
6 7 8 |
# File 'lib/jast.rb', line 6 def api_version @api_version end |
#base_path ⇒ Object
Returns the value of attribute base_path.
6 7 8 |
# File 'lib/jast.rb', line 6 def base_path @base_path end |
#definitions_path ⇒ Object
Returns the value of attribute definitions_path.
6 7 8 |
# File 'lib/jast.rb', line 6 def definitions_path @definitions_path end |
Instance Method Details
#render_schemas(name, properties, required) ⇒ Object
13 14 15 16 |
# File 'lib/jast.rb', line 13 def render_schemas name, properties, required schema_renderer = Jast::SchemaRenderer.new name, base_path schema_renderer.render_resource properties, required end |