Class: Rafflesia::ObjectJsonInspectData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::ObjectJsonInspectData
- Defined in:
- lib/rafflesia/objects/object_json_inspect_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ content_type: :content_type, diagnostics: :diagnostics, element_count: :element_count, elements: :elements, field_count: :field_count, fields: :fields, is_truncated: :is_truncated, json_type: :json_type, max_children: :max_children, object_id: :object_id, sha256: :sha_256, size_bytes: :size_bytes }.freeze
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#diagnostics ⇒ Object
Returns the value of attribute diagnostics.
-
#element_count ⇒ Object
Returns the value of attribute element_count.
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#field_count ⇒ Object
Returns the value of attribute field_count.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
-
#json_type ⇒ Object
Returns the value of attribute json_type.
-
#max_children ⇒ Object
Returns the value of attribute max_children.
-
#object_id ⇒ Object
Returns the value of attribute object_id.
-
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
-
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
Instance Method Summary collapse
-
#initialize(json) ⇒ ObjectJsonInspectData
constructor
A new instance of ObjectJsonInspectData.
Constructor Details
#initialize(json) ⇒ ObjectJsonInspectData
Returns a new instance of ObjectJsonInspectData.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 37 def initialize(json) super() hash = self.class.normalize(json) @content_type = hash[:content_type] @diagnostics = hash[:diagnostics] ? Rafflesia::ObjectReadDiagnostics.new(hash[:diagnostics]) : nil @element_count = hash[:element_count] @elements = (hash[:elements] || []).map { |item| item ? Rafflesia::ObjectJsonFieldSummary.new(item) : nil } @field_count = hash[:field_count] @fields = (hash[:fields] || []).map { |item| item ? Rafflesia::ObjectJsonFieldSummary.new(item) : nil } @is_truncated = hash[:is_truncated] @json_type = hash[:json_type] @max_children = hash[:max_children] @object_id = hash[:object_id] @sha_256 = hash[:sha256] @size_bytes = hash[:size_bytes] end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def content_type @content_type end |
#diagnostics ⇒ Object
Returns the value of attribute diagnostics.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def diagnostics @diagnostics end |
#element_count ⇒ Object
Returns the value of attribute element_count.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def element_count @element_count end |
#elements ⇒ Object
Returns the value of attribute elements.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def elements @elements end |
#field_count ⇒ Object
Returns the value of attribute field_count.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def field_count @field_count end |
#fields ⇒ Object
Returns the value of attribute fields.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def fields @fields end |
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def is_truncated @is_truncated end |
#json_type ⇒ Object
Returns the value of attribute json_type.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def json_type @json_type end |
#max_children ⇒ Object
Returns the value of attribute max_children.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def max_children @max_children end |
#object_id ⇒ Object
Returns the value of attribute object_id.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def object_id @object_id end |
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def sha_256 @sha_256 end |
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
23 24 25 |
# File 'lib/rafflesia/objects/object_json_inspect_data.rb', line 23 def size_bytes @size_bytes end |