Class: Retab::PartialSchema

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/schemas/partial_schema.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  created_at: :created_at,
  json_schema: :json_schema,
  strict: :strict
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ PartialSchema

Returns a new instance of PartialSchema.



21
22
23
24
25
26
27
# File 'lib/retab/schemas/partial_schema.rb', line 21

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @created_at = hash[:created_at]
  @json_schema = hash[:json_schema] || {}
  @strict = hash[:strict]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



15
16
17
# File 'lib/retab/schemas/partial_schema.rb', line 15

def created_at
  @created_at
end

#json_schemaObject

Returns the value of attribute json_schema.



15
16
17
# File 'lib/retab/schemas/partial_schema.rb', line 15

def json_schema
  @json_schema
end

#objectObject

Returns the value of attribute object.



15
16
17
# File 'lib/retab/schemas/partial_schema.rb', line 15

def object
  @object
end

#strictObject

Returns the value of attribute strict.



15
16
17
# File 'lib/retab/schemas/partial_schema.rb', line 15

def strict
  @strict
end