Class: Alula::RestResource
- Inherits:
-
ApiResource
- Object
- ApiResource
- Alula::RestResource
- Defined in:
- lib/alula/rest_resource.rb
Direct Known Subclasses
BillingProgram, Dealer, DealerAccountTransfer, DealerAddress, DealerBranding, DealerPhone, DealerProgram, DealerSuspensionLog, Device, DeviceAlias, DeviceCellularStatus, DeviceCharge, DeviceCredit, DeviceEventLog, DeviceNotification, DeviceProgram, DeviceUser, EventTrigger, EventWebhook, FeatureBySubject, FeaturePlan, FeaturePlanVideo, FeaturePrice, HelixUser, OAuthClient, ReceiverConnection, ReceiverDisabled, ReceiverGroup, Revision, Station, User, UserAddress, UserPhone, UserPreferences, UserPushtoken, UserVideoProfile, VideoVerificationCamera, VideoVerificationEvent
Instance Attribute Summary
Attributes inherited from ApiResource
#dirty_attributes, #errors, #id, #link_matchers, #links, #rate_limit, #raw_data, #values
Class Method Summary collapse
-
.resource_url(id = nil) ⇒ Object
TODO: Not sure if the period replace is applicatble to our use determine as we add child resources.
Instance Method Summary collapse
Methods inherited from ApiResource
#annotate_errors, #apply_attributes, #as_json, #as_patchable_json, build, #cache_links, class_name, #clone, #construct_from, #dirty?, #errors?, #filter_builder, #initialize, #model_name, #reconstruct_from, #refresh
Constructor Details
This class inherits a constructor from Alula::ApiResource
Class Method Details
.resource_url(id = nil) ⇒ Object
TODO: Not sure if the period replace is applicatble to our use
determine as we add child resources
5 6 7 8 9 10 |
# File 'lib/alula/rest_resource.rb', line 5 def self.resource_url(id = nil) if self == RestResource raise NotImplementedError, "Cannot call resource_url on a RestResource. Try using Device or Customer instead." end "/rest/v1/#{self.get_resource_path(id)}" end |
Instance Method Details
#resource_url(param_id = nil) ⇒ Object
12 13 14 15 |
# File 'lib/alula/rest_resource.rb', line 12 def resource_url(param_id = nil) our_id = [id, param_id].compact.first self.class.resource_url(our_id) end |