Class: Ingenico::Connect::SDK::Domain::File::HostedFile

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/file/hosted_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#file_nameObject

String



14
15
16
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 14

def file_name
  @file_name
end

#file_sizeObject

String



17
18
19
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 17

def file_size
  @file_size
end

#file_typeObject

String



20
21
22
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 20

def file_type
  @file_type
end

#idObject

String



23
24
25
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 23

def id
  @id
end

Instance Method Details

#from_hash(hash) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 34

def from_hash(hash)
  super
  if hash.has_key?('fileName')
    @file_name = hash['fileName']
  end
  if hash.has_key?('fileSize')
    @file_size = hash['fileSize']
  end
  if hash.has_key?('fileType')
    @file_type = hash['fileType']
  end
  if hash.has_key?('id')
    @id = hash['id']
  end
end

#to_hObject



25
26
27
28
29
30
31
32
# File 'lib/ingenico/connect/sdk/domain/file/hosted_file.rb', line 25

def to_h
  hash = super
  add_to_hash(hash, 'fileName', @file_name)
  add_to_hash(hash, 'fileSize', @file_size)
  add_to_hash(hash, 'fileType', @file_type)
  add_to_hash(hash, 'id', @id)
  hash
end