Class: RabbitFeed::EventDefinitions::Field
- Inherits:
-
Object
- Object
- RabbitFeed::EventDefinitions::Field
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/rabbit_feed/event_definitions.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, definition) ⇒ Field
constructor
A new instance of Field.
- #schema ⇒ Object
Constructor Details
#initialize(name, type, definition) ⇒ Field
Returns a new instance of Field.
9 10 11 12 13 14 |
# File 'lib/rabbit_feed/event_definitions.rb', line 9 def initialize(name, type, definition) @name = name @type = type @definition = definition validate! end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
6 7 8 |
# File 'lib/rabbit_feed/event_definitions.rb', line 6 def definition @definition end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/rabbit_feed/event_definitions.rb', line 6 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/rabbit_feed/event_definitions.rb', line 6 def type @type end |
Instance Method Details
#schema ⇒ Object
16 17 18 |
# File 'lib/rabbit_feed/event_definitions.rb', line 16 def schema { name: name, type: type, doc: definition } end |