Class: V2Intuity::Streams::Stream
- Inherits:
-
Object
- Object
- V2Intuity::Streams::Stream
- Defined in:
- lib/v2_intuity/streams/stream.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#resource_filters ⇒ Object
Returns the value of attribute resource_filters.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#stream_id ⇒ Object
Returns the value of attribute stream_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Stream
constructor
A new instance of Stream.
- #send_request(method, client, query_filters = []) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Stream
Returns a new instance of Stream.
6 7 8 9 10 11 12 |
# File 'lib/v2_intuity/streams/stream.rb', line 6 def initialize( = {}) @name = [:name] @start_date = .fetch(:start_date, Time.now.strftime('%Y-%m-%d')) @resource_filters = format_resource_filters(.fetch(:resource_filters, nil)) @stream_id = [:stream_id] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/v2_intuity/streams/stream.rb', line 4 def name @name end |
#resource_filters ⇒ Object
Returns the value of attribute resource_filters.
4 5 6 |
# File 'lib/v2_intuity/streams/stream.rb', line 4 def resource_filters @resource_filters end |
#start_date ⇒ Object
Returns the value of attribute start_date.
4 5 6 |
# File 'lib/v2_intuity/streams/stream.rb', line 4 def start_date @start_date end |
#stream_id ⇒ Object
Returns the value of attribute stream_id.
4 5 6 |
# File 'lib/v2_intuity/streams/stream.rb', line 4 def stream_id @stream_id end |
Instance Method Details
#send_request(method, client, query_filters = []) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/v2_intuity/streams/stream.rb', line 14 def send_request(method, client, query_filters = []) return 'StreamApi client is requied' unless client.class == V2Intuity::Clients::StreamApi endpoint, = (method, query_filters) client.build_and_send_request(endpoint, ) end |