Class: Avrodrome::Schema
- Inherits:
-
Object
- Object
- Avrodrome::Schema
- Defined in:
- lib/avrodrome/schema.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(body:, id:, version:, name:) ⇒ Schema
constructor
A new instance of Schema.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(body:, id:, version:, name:) ⇒ Schema
Returns a new instance of Schema.
5 6 7 8 9 10 |
# File 'lib/avrodrome/schema.rb', line 5 def initialize(body:, id:, version:, name:) @body = body @id = id @version = version @name = name end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/avrodrome/schema.rb', line 3 def body @body end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/avrodrome/schema.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/avrodrome/schema.rb', line 3 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/avrodrome/schema.rb', line 3 def version @version end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/avrodrome/schema.rb', line 12 def to_hash { subject: name, version: version, id: id, schema: body.to_s } end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/avrodrome/schema.rb', line 21 def to_json to_hash.to_json end |