Class: CodaDocs::Entities::Entity
- Inherits:
-
Object
- Object
- CodaDocs::Entities::Entity
- Defined in:
- lib/coda_docs/entities/entity.rb
Direct Known Subclasses
Account, Categories, Columns, Controls, Docs, Formulas, Miscellaneous, Pages, Rows, Tables
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(access_token) ⇒ Entity
constructor
A new instance of Entity.
- #parse_response(response) ⇒ Object
Constructor Details
#initialize(access_token) ⇒ Entity
Returns a new instance of Entity.
4 5 6 |
# File 'lib/coda_docs/entities/entity.rb', line 4 def initialize(access_token) @access_token = access_token end |
Instance Method Details
#connection ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/coda_docs/entities/entity.rb', line 12 def connection conn = CodaDocs::Connection conn..merge!( headers: { 'Authorization' => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } ) conn end |
#parse_response(response) ⇒ Object
8 9 10 |
# File 'lib/coda_docs/entities/entity.rb', line 8 def parse_response(response) response.parsed_response['items'] end |