Class: Mondo::Attachment
- Defined in:
- lib/api/mondo/attachment.rb
Instance Attribute Summary collapse
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#file_type ⇒ Object
Returns the value of attribute file_type.
-
#file_url ⇒ Object
Returns the value of attribute file_url.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from Resource
Instance Method Summary collapse
Methods inherited from Resource
boolean_accessor, boolean_reader, date_accessor, date_writer, #initialize, #inspect, #to_s
Constructor Details
This class inherits a constructor from Mondo::Resource
Instance Attribute Details
#external_id ⇒ Object
Returns the value of attribute external_id.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def external_id @external_id end |
#file_type ⇒ Object
Returns the value of attribute file_type.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def file_type @file_type end |
#file_url ⇒ Object
Returns the value of attribute file_url.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def file_url @file_url end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def url @url end |
#user_id ⇒ Object
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/api/mondo/attachment.rb', line 3 def user_id @user_id end |
Instance Method Details
#deregister ⇒ Object
14 15 16 |
# File 'lib/api/mondo/attachment.rb', line 14 def deregister self.client.api_post("attachment/deregister", id: self.id) end |
#register ⇒ Object
8 9 10 11 12 |
# File 'lib/api/mondo/attachment.rb', line 8 def register raise ClientError.new("You have already registered this attachment") unless self.id.nil? self.client.api_post("attachment/register", registration_data) end |
#registration_data ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/api/mondo/attachment.rb', line 18 def registration_data { external_id: self.external_id, file_url: self.file_url, file_type: self.file_type, } end |