Class: Taxii::Messages::PollRequest
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- Taxii::Messages::PollRequest
- Includes:
- Hashie::Extensions::Coercion
- Defined in:
- lib/taxii/messages/poll_request.rb
Instance Method Summary collapse
- #requested_begin ⇒ Object
- #requested_end ⇒ Object
- #requested_info ⇒ Object
- #to_h ⇒ Object
- #to_xml ⇒ Object
Instance Method Details
#requested_begin ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/taxii/messages/poll_request.rb', line 20 def requested_begin if .nil? {} else {'Exclusive_Begin_Timestamp': .strftime(TS_FORMAT)} end end |
#requested_end ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/taxii/messages/poll_request.rb', line 28 def requested_end if .nil? {} else {'Inclusive_End_Timestamp': .strftime(TS_FORMAT)} end end |
#requested_info ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/taxii/messages/poll_request.rb', line 35 def requested_info if subscription_id.nil? {'taxii_11:Poll_Parameters': poll_parameters.to_h} else {'taxii_11:Subscription_ID': subscription_id} end end |
#to_h ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/taxii/messages/poll_request.rb', line 43 def to_h NAMESPACE_ATTRIBUTES.merge({ '@message_id': , '@collection_name': collection_name }).merge(requested_begin) .merge(requested_end) .merge(requested_info) end |
#to_xml ⇒ Object
52 53 54 |
# File 'lib/taxii/messages/poll_request.rb', line 52 def to_xml Gyoku.xml({'taxii_11:Poll_Request': to_h}, key_converter: :none) end |