Class: TapRep::Schema
- Inherits:
-
Object
- Object
- TapRep::Schema
- Defined in:
- lib/schema.rb
Overview
Models a JSON Schema required for Singer taps
Defined Under Namespace
Classes: Types
Instance Attribute Summary collapse
-
#key_property ⇒ Object
readonly
Returns the value of attribute key_property.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(stream, key_property) ⇒ Schema
constructor
A new instance of Schema.
- #properties ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(stream, key_property) ⇒ Schema
Returns a new instance of Schema.
9 10 11 12 |
# File 'lib/schema.rb', line 9 def initialize(stream, key_property) @stream = stream @key_property = key_property end |
Instance Attribute Details
#key_property ⇒ Object (readonly)
Returns the value of attribute key_property.
7 8 9 |
# File 'lib/schema.rb', line 7 def key_property @key_property end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
7 8 9 |
# File 'lib/schema.rb', line 7 def stream @stream end |
Instance Method Details
#properties ⇒ Object
50 51 52 |
# File 'lib/schema.rb', line 50 def properties @properties ||= {} end |
#to_hash ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/schema.rb', line 54 def to_hash { type: :SCHEMA, stream: stream, key_properties: [key_property], schema: { properties: properties } } end |