Class: Fountain::SecureDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/fountain/secure_document.rb

Overview

Fountain Secure Document

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ SecureDocument

Returns a new instance of SecureDocument.

Parameters:

  • data (Hash)

    Raw secure document data



14
15
16
# File 'lib/fountain/secure_document.rb', line 14

def initialize(data)
  @raw_data = Util.stringify_hash_keys data
end

Instance Attribute Details

#raw_dataObject (readonly)

Raw document data



9
10
11
# File 'lib/fountain/secure_document.rb', line 9

def raw_data
  @raw_data
end

Instance Method Details

#filenameObject

Filename



34
35
36
# File 'lib/fountain/secure_document.rb', line 34

def filename
  raw_data['filename']
end

#friendly_nameObject

FriendlyName



29
30
31
# File 'lib/fountain/secure_document.rb', line 29

def friendly_name
  raw_data['friendly_name']
end

#idObject

Secure document ID



19
20
21
# File 'lib/fountain/secure_document.rb', line 19

def id
  raw_data['id']
end

#inspectObject



53
54
55
56
57
58
59
60
61
# File 'lib/fountain/secure_document.rb', line 53

def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @id="%<id>s" @name="%<name>s">',
    class_name: self.class.name,
    object_id: object_id,
    id: id,
    name: name
  )
end

#nameObject

Name



24
25
26
# File 'lib/fountain/secure_document.rb', line 24

def name
  raw_data['name']
end

#public_urlObject

Public URL



39
40
41
# File 'lib/fountain/secure_document.rb', line 39

def public_url
  raw_data['public_url']
end

#sizeObject

Size



44
45
46
# File 'lib/fountain/secure_document.rb', line 44

def size
  raw_data['size']
end

#stageObject

Stage



49
50
51
# File 'lib/fountain/secure_document.rb', line 49

def stage
  Stage.new raw_data['stage']
end