Class: RouteNGNClient::Code
- Inherits:
-
RemoteModel
- Object
- Model
- RemoteModel
- RouteNGNClient::Code
- Defined in:
- lib/routengn_client/models/code.rb
Constant Summary
Constants inherited from RemoteModel
RemoteModel::DEFAULT_RESOURCE_ATTRIBUTES
Instance Attribute Summary
Attributes included from RemoteModel::ClassMethods
Attributes inherited from Model
#attributes, #request_account_id
Attributes included from Model::ClassMethods
#children, #only_children, #parents
Class Method Summary collapse
- .find_by_dialcodes(dialcodes, options = {}, &callback) ⇒ Object
- .find_by_exploded_dialcode(dialcode, options = {}, &callback) ⇒ Object
Methods included from RemoteModel::ClassMethods
#all, #collection_name, #create!, #find, #index_method, #path_base, #path_ext, #set_resource_attributes, #where
Methods inherited from Model
#initialize, #to_hash, #to_json, #to_log
Methods included from Model::ClassMethods
#belongs_to, #from_hash, #from_json, #has_many, #has_one
Methods included from Logging
Constructor Details
This class inherits a constructor from RouteNGNClient::Model
Class Method Details
.find_by_dialcodes(dialcodes, options = {}, &callback) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/routengn_client/models/code.rb', line 19 def find_by_dialcodes(dialcodes, = {}, &callback) = {:page => 1, :per_page => (dialcodes.length + 1)}.merge(self.resource_attributes[:request_options]).merge() models = all({:code => {:dialcode => {'$in' => dialcodes}}}, ) callback.call(models) if callback models end |
.find_by_exploded_dialcode(dialcode, options = {}, &callback) ⇒ Object
14 15 16 17 |
# File 'lib/routengn_client/models/code.rb', line 14 def find_by_exploded_dialcode(dialcode, = {}, &callback) subsets = Utils.string_subsets dialcode find_by_dialcodes subsets, , &callback end |