Class: Loggly::Search
- Inherits:
-
RemoteModel
- Object
- Model
- RemoteModel
- Loggly::Search
- Defined in:
- lib/loggly/models/search.rb
Constant Summary
Constants inherited from RemoteModel
RemoteModel::DEFAULT_RESOURCE_ATTRIBUTES
Constants inherited from Model
Instance Attribute Summary
Attributes included from RemoteModel::ClassMethods
Attributes inherited from Model
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Search
constructor
A new instance of Search.
Methods included from RemoteModel::ClassMethods
#all, #collection_name, #create!, #find, #index_method, #path_base, #path_ext, #prepare_params, #set_resource_attributes, #where
Methods inherited from Model
Methods included from Model::ClassMethods
Methods included from Logging
#init_logger, #logger, #logger=
Constructor Details
#initialize(attributes = {}) ⇒ Search
Returns a new instance of Search.
13 14 15 |
# File 'lib/loggly/models/search.rb', line 13 def initialize(attributes = {}) super end |
Class Method Details
.create!(conditions = {}, options = {}, &callback) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/loggly/models/search.rb', line 17 def self.create!(conditions = {}, = {}, &callback) .merge!(:klass => self) params = prepare_params(conditions) params[:size] = ([:per_page] ||= @resource_attributes[:per_page]) params[:page] = ([:page] ||= 0) response = Request.new(@resource_attributes, :get, [path_base, index_method], path_ext, params, ).execute(Loggly.connection) model = response.to_model callback.call(model) if callback model end |