lib/unit-ruby/util/api_resource.rb
# Represents this resource for serialization (create/update)
#
# @return [Hash] Representation of this object as JSONAPI object
Represents this resource for serialization (create/update)
Represents this resource for serialization ( create / update )
def as_json_api
        self.class.schema.attributes.each_with_object({}) do |schema_attribute, h|
          next if schema_attribute.readonly
          val = send(schema_attribute.name)
          val = val.as_json_api if val.respond_to? :as_json_api
          h[schema_attribute.name] = val
        end
      end
def as_json_api self . class . schema . attributes . each_with_object ( { } ) do | schema_attribute , h | next if schema_attribute . readonly val = send ( schema_attribute . name ) val = val . as_json_api if val . respond_to? :as_json_api h [ schema_attribute . name ] = val end end
Represents this resource for serialization (create/update)
Represents this resource for serialization ( create / update )
# serialize the value if it is a complex type
Representation of this object as JSONAPI object
Representation of this object as JSONAPI object
Hash