Class: RuboCop::Schema::CopSchema
- Inherits:
-
Object
- Object
- RuboCop::Schema::CopSchema
- Includes:
- Helpers
- Defined in:
- lib/rubocop/schema/cop_schema.rb
Constant Summary collapse
- KNOWN_TYPES =
{ 'boolean' => 'boolean', 'integer' => 'integer', 'array' => 'array', 'string' => 'string', 'float' => 'number' }.freeze
Instance Method Summary collapse
- #as_json ⇒ Object (also: #to_h)
- #freeze ⇒ Object
-
#initialize(info) ⇒ CopSchema
constructor
A new instance of CopSchema.
Methods included from Helpers
#boolean, #deep_dup, #deep_merge, #http_get, #strip_html, #template, templates
Constructor Details
#initialize(info) ⇒ CopSchema
Returns a new instance of CopSchema.
17 18 19 20 21 |
# File 'lib/rubocop/schema/cop_schema.rb', line 17 def initialize(info) @info = info.dup.freeze @json = template('cop_schema') generate end |
Instance Method Details
#as_json ⇒ Object Also known as: to_h
23 24 25 |
# File 'lib/rubocop/schema/cop_schema.rb', line 23 def as_json @json end |
#freeze ⇒ Object
29 30 31 32 |
# File 'lib/rubocop/schema/cop_schema.rb', line 29 def freeze @json.freeze super end |