Class: DBEventMessageContext
- Inherits:
-
Thrift::Union
- Object
- Thrift::Union
- DBEventMessageContext
- Includes:
- Thrift::Struct_Union
- Defined in:
- lib/db_event_model_types.rb
Constant Summary collapse
- PUBLISHER =
1
- SUBSCRIBER =
2
- FIELDS =
{ PUBLISHER => {:type => ::Thrift::Types::STRUCT, :name => 'publisher', :class => ::DBEventPublisher, :optional => true}, SUBSCRIBER => {:type => ::Thrift::Types::STRUCT, :name => 'subscriber', :class => ::DBEventSubscriber, :optional => true} }
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.publisher(val) ⇒ Object
104 105 106 |
# File 'lib/db_event_model_types.rb', line 104 def publisher(val) DBEventMessageContext.new(:publisher, val) end |
.subscriber(val) ⇒ Object
108 109 110 |
# File 'lib/db_event_model_types.rb', line 108 def subscriber(val) DBEventMessageContext.new(:subscriber, val) end |
Instance Method Details
#struct_fields ⇒ Object
121 |
# File 'lib/db_event_model_types.rb', line 121 def struct_fields; FIELDS; end |
#validate ⇒ Object
123 124 125 |
# File 'lib/db_event_model_types.rb', line 123 def validate raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? end |