Class: PostmanMta::Bookmark
- Inherits:
-
ApplicationModel
- Object
- ApplicationModel
- PostmanMta::Bookmark
- Defined in:
- app/models/postman_mta/bookmark.rb
Instance Attribute Summary collapse
-
#target_id ⇒ Object
readonly
Returns the value of attribute target_id.
-
#target_type ⇒ Object
readonly
Returns the value of attribute target_type.
Instance Method Summary collapse
- #create(params) ⇒ Object
- #destroy(bookmark_id) ⇒ Object
-
#initialize(target_type, target_id) ⇒ Bookmark
constructor
A new instance of Bookmark.
Constructor Details
#initialize(target_type, target_id) ⇒ Bookmark
Returns a new instance of Bookmark.
5 6 7 8 |
# File 'app/models/postman_mta/bookmark.rb', line 5 def initialize(target_type, target_id) @target_type = target_type @target_id = target_id end |
Instance Attribute Details
#target_id ⇒ Object (readonly)
Returns the value of attribute target_id.
3 4 5 |
# File 'app/models/postman_mta/bookmark.rb', line 3 def target_id @target_id end |
#target_type ⇒ Object (readonly)
Returns the value of attribute target_type.
3 4 5 |
# File 'app/models/postman_mta/bookmark.rb', line 3 def target_type @target_type end |
Instance Method Details
#create(params) ⇒ Object
10 11 12 |
# File 'app/models/postman_mta/bookmark.rb', line 10 def create(params) post("/#{target_type}/#{target_id}/bookmarks", body: params) end |
#destroy(bookmark_id) ⇒ Object
14 15 16 |
# File 'app/models/postman_mta/bookmark.rb', line 14 def destroy(bookmark_id) delete("/#{target_type}/#{target_id}/bookmarks/#{bookmark_id}") end |