Class: Phaxio::Resource

Inherits:
Object
  • Object
show all
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.

Defined Under Namespace

Classes: Collection

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.attribute_listObject

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_mappingsObject

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_listObject

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_listObject

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