Class: Retab::FileLink

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/files/file_link.rb

Constant Summary collapse

HASH_ATTRS =
{
  download_url: :download_url,
  expires_in: :expires_in,
  filename: :filename,
  mime_data: :mime_data
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ FileLink

Returns a new instance of FileLink.



21
22
23
24
25
26
27
# File 'lib/retab/files/file_link.rb', line 21

def initialize(json)
  hash = self.class.normalize(json)
  @download_url = hash[:download_url]
  @expires_in = hash[:expires_in]
  @filename = hash[:filename]
  @mime_data = hash[:mime_data] ? Retab::MimeData.new(hash[:mime_data]) : nil
end

Instance Attribute Details

#download_urlObject

Returns the value of attribute download_url.



15
16
17
# File 'lib/retab/files/file_link.rb', line 15

def download_url
  @download_url
end

#expires_inObject

Returns the value of attribute expires_in.



15
16
17
# File 'lib/retab/files/file_link.rb', line 15

def expires_in
  @expires_in
end

#filenameObject

Returns the value of attribute filename.



15
16
17
# File 'lib/retab/files/file_link.rb', line 15

def filename
  @filename
end

#mime_dataObject

Returns the value of attribute mime_data.



15
16
17
# File 'lib/retab/files/file_link.rb', line 15

def mime_data
  @mime_data
end