Class: SexyJSONSchemas::Properties::AnonymousObject

Inherits:
Object
  • Object
show all
Defined in:
lib/sexy_json_schemas/properties/anonymous_object.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Object

#any_property, #array_property, #boolean_property, #integer_property, #null_property, #number_property, #object_property, #properties, property_methods, #ref_property, #string_property, #type, #union_property

Methods inherited from Base

#type

Constructor Details

#initializeAnonymousObject

Returns a new instance of AnonymousObject.



4
5
6
# File 'lib/sexy_json_schemas/properties/anonymous_object.rb', line 4

def initialize
  super(nil)
end

Instance Method Details

#as_jsonObject



8
9
10
11
12
# File 'lib/sexy_json_schemas/properties/anonymous_object.rb', line 8

def as_json
  @properties.inject({}) do |acc, property|
    acc.merge(property.as_json)
  end
end