Class: HyperTrack::Action

Inherits:
SharedResource show all
Includes:
HyperTrack::ApiOperations::ActionAPI
Defined in:
lib/hypertrack/resources/action.rb

Constant Summary collapse

API_BASE_PATH =
"actions/"
REQUIRED_FIELDS =
[]
VALID_ATTRIBUTE_VALUES =
{
  type: {
    allowed: [:pickup, :delivery, :dropoff, :visit, :stoppver, :task],
    allow_nil: true
  },
  vehicle_type: {
    allowed: HyperTrack::SharedResource::VALID_VEHICLE_TYPES,
    allow_nil: true
  }
}

Constants inherited from SharedResource

SharedResource::VALID_VEHICLE_TYPES

Instance Attribute Summary

Attributes inherited from SharedResource

#id

Class Method Summary collapse

Methods included from HyperTrack::ApiOperations::ActionAPI

#cancel, #complete, #meter, #mileage

Methods inherited from SharedResource

#[], #[]=, get_class_name, #initialize, #keys, #to_json, #values

Methods included from HyperTrack::ApiOperations::Common::Create

#create

Methods included from HyperTrack::ApiOperations::Common::Retrieve

#retrieve

Methods included from HyperTrack::ApiOperations::Common::List

#list

Methods included from HyperTrack::ApiOperations::Common::Nearby

#nearby

Methods included from HyperTrack::ApiOperations::Common::RetrieveByUniqueId

#retrieve_by_unique_id

Methods included from HyperTrack::ApiOperations::Common::Update

#update

Methods included from HyperTrack::ApiOperations::Common::Get

#get, #get_list

Methods included from HyperTrack::ApiOperations::Common::Patch

#patch

Constructor Details

This class inherits a constructor from HyperTrack::SharedResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HyperTrack::SharedResource

Class Method Details

.placeline(filter_params = {}) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/hypertrack/resources/action.rb', line 19

def self.placeline(filter_params={})
  api_result = HyperTrack::ApiClient.fetch(get_class_name::API_BASE_PATH, filter_params)
  api_result['results'].each_with_index do |opts, idx|
    api_result['results'][idx] = get_class_name.new(opts['id'], opts)
  end

  api_result['results']
end