Class: NexosisApi::ModelListQuery
- Defined in:
- lib/nexosis_api/list_queries.rb
Overview
sort by properties include id, modelName, dataSourceName, type, createdDate, and lastUsedDate
class to hold the query options for list models
Instance Attribute Summary collapse
-
#created_after_date ⇒ String
Format - date-time (as date-time in ISO8601).
-
#created_before_date ⇒ String
Format - date-time (as date-time in ISO8601).
-
#datasource_name ⇒ String
Limits models to those for a particular data source.
Attributes inherited from ListQuery
#page_number, #page_size, #sort_by, #sort_order
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ModelListQuery
constructor
A new instance of ModelListQuery.
-
#query_parameters ⇒ Hash
A hash suitable for using as the query portion of an HTTP request to the API.
Methods inherited from ListQuery
Constructor Details
#initialize(options = {}) ⇒ ModelListQuery
Returns a new instance of ModelListQuery.
134 135 136 137 138 139 |
# File 'lib/nexosis_api/list_queries.rb', line 134 def initialize( = {}) @datasource_name = [:datasource_name] if .key? :datasource_name @created_after_date = [:created_after_date] if .key? :created_after_date @created_before_date = [:created_before_date] if .key? :created_before_date super(, :datasource_name, :created_after_date, :created_before_date) end |
Instance Attribute Details
#created_after_date ⇒ String
Format - date-time (as date-time in ISO8601). Limits models to those created on or after the specified date
157 158 159 |
# File 'lib/nexosis_api/list_queries.rb', line 157 def created_after_date @created_after_date end |
#created_before_date ⇒ String
Format - date-time (as date-time in ISO8601). Limits models to those created on or before the specified date
161 162 163 |
# File 'lib/nexosis_api/list_queries.rb', line 161 def created_before_date @created_before_date end |
#datasource_name ⇒ String
Limits models to those for a particular data source
153 154 155 |
# File 'lib/nexosis_api/list_queries.rb', line 153 def datasource_name @datasource_name end |
Instance Method Details
#query_parameters ⇒ Hash
A hash suitable for using as the query portion of an HTTP request to the API
143 144 145 146 147 148 149 |
# File 'lib/nexosis_api/list_queries.rb', line 143 def query_parameters parm_hash = {} parm_hash.store(:dataSourceName, @datasource_name) unless @datasource_name.nil? parm_hash.store(:createdAfterDate, date_string(@created_after_date)) unless @created_after_date.nil? parm_hash.store(:createdBeforeDate, date_string(@created_before_date)) unless @created_before_date.nil? self.to_hash.merge(parm_hash) end |