Class: Phaxio::Resource
- Inherits:
-
Object
- Object
- Phaxio::Resource
- Defined in:
- lib/phaxio/resource.rb
Overview
The base class for API resources, such as ‘Fax` and `PhoneNumber`.
This class is considered an implementation detail, and shouldn’t be directly relied upon by users.
The only exception is that this class will continue to be the base class for all Phaxio resources, so checking whether a fax instance is a kind of Phaxio::Resource will always return true.
Direct Known Subclasses
Phaxio::Resources::Account, Phaxio::Resources::Ata, Phaxio::Resources::Fax, Phaxio::Resources::FaxRecipient, Phaxio::Resources::PhaxCode, Phaxio::Resources::PhoneNumber, Phaxio::Resources::PortNumber, Phaxio::Resources::PortNumberNote, Phaxio::Resources::PortOrder, Phaxio::Resources::Public::AreaCode, Phaxio::Resources::Public::Country
Defined Under Namespace
Classes: Collection
Class Attribute Summary collapse
-
.attribute_list ⇒ Object
private
Full list of resource-specific attributes.
-
.collection_attribute_mappings ⇒ Object
private
Mapping of resource-specific attributes that must be parsed into a resource collection.
-
.normal_attribute_list ⇒ Object
private
List of resource-specific attributes that don’t require additional processing during instance data population.
-
.time_attribute_list ⇒ Object
private
List of resource-specific attributes that must be parsed into a Time object during instance data population.
Class Method Summary collapse
-
.response_collection(raw_data) ⇒ Phaxio::Resource::Collection
private
Returns a new collection of resource instances for this data.
-
.response_record(raw_data) ⇒ Phaxio::Resource
private
Returns a new instance of the resource for this data.
Class Attribute Details
.attribute_list ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Full list of resource-specific attributes.
61 62 63 |
# File 'lib/phaxio/resource.rb', line 61 def attribute_list @attribute_list end |
.collection_attribute_mappings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Mapping of resource-specific attributes that must be parsed into a resource collection.
75 76 77 |
# File 'lib/phaxio/resource.rb', line 75 def collection_attribute_mappings @collection_attribute_mappings end |
.normal_attribute_list ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of resource-specific attributes that don’t require additional processing during instance data population.
66 67 68 |
# File 'lib/phaxio/resource.rb', line 66 def normal_attribute_list @normal_attribute_list end |
.time_attribute_list ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List of resource-specific attributes that must be parsed into a Time object during instance data population.
71 72 73 |
# File 'lib/phaxio/resource.rb', line 71 def time_attribute_list @time_attribute_list end |
Class Method Details
.response_collection(raw_data) ⇒ Phaxio::Resource::Collection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new collection of resource instances for this data.
55 56 57 |
# File 'lib/phaxio/resource.rb', line 55 def response_collection raw_data Collection.new raw_data, self end |
.response_record(raw_data) ⇒ Phaxio::Resource
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of the resource for this data.
47 48 49 |
# File 'lib/phaxio/resource.rb', line 47 def response_record raw_data new raw_data end |