Class: SexyJSONSchemas::Properties::Ref
- Defined in:
- lib/sexy_json_schemas/properties/ref.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(name, schema, options = {}) ⇒ Ref
constructor
A new instance of Ref.
Methods inherited from Base
Constructor Details
#initialize(name, schema, options = {}) ⇒ Ref
Returns a new instance of Ref.
4 5 6 7 |
# File 'lib/sexy_json_schemas/properties/ref.rb', line 4 def initialize(name, schema, = {}) super(name, ) @schema = schema end |
Instance Method Details
#as_json ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/sexy_json_schemas/properties/ref.rb', line 9 def as_json json = { "$ref" => @schema } if @options[:description] json['description'] = @options[:description] end json end |