Class: CloudConvert::Entity

Inherits:
Base
  • Object
show all
Defined in:
lib/cloudconvert/entity.rb

Direct Known Subclasses

Event, Job, Task, User

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Class Method Summary collapse

Methods inherited from Base

attr_reader, collection_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, struct_attr_reader, symbol_attr_reader, time_attr_reader

Constructor Details

This class inherits a constructor from CloudConvert::Base

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/cloudconvert/entity.rb', line 3

def id
  @id
end

Class Method Details

.collection(response) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/cloudconvert/entity.rb', line 8

def collection(response)
  CloudConvert::Collection.new(
    response.data.collect { |item| new(item) },
    response.links,
    response.meta,
  )
end

.result(response) ⇒ Object



16
17
18
# File 'lib/cloudconvert/entity.rb', line 16

def result(response)
  new response.data
end