Class: HakumiComponents::Upload::FileEntry

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/upload/file_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uid:, name:, status:, percent:, url:) ⇒ FileEntry

Returns a new instance of FileEntry.



18
19
20
21
22
23
24
# File 'app/components/hakumi_components/upload/file_entry.rb', line 18

def initialize(uid:, name:, status:, percent:, url:)
  @uid = uid
  @name = name
  @status = status
  @percent = percent
  @url = url
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'app/components/hakumi_components/upload/file_entry.rb', line 30

def name
  @name
end

#percentObject (readonly)

Returns the value of attribute percent.



36
37
38
# File 'app/components/hakumi_components/upload/file_entry.rb', line 36

def percent
  @percent
end

#statusObject (readonly)

Returns the value of attribute status.



33
34
35
# File 'app/components/hakumi_components/upload/file_entry.rb', line 33

def status
  @status
end

#uidObject (readonly)

Returns the value of attribute uid.



27
28
29
# File 'app/components/hakumi_components/upload/file_entry.rb', line 27

def uid
  @uid
end

#urlObject (readonly)

Returns the value of attribute url.



39
40
41
# File 'app/components/hakumi_components/upload/file_entry.rb', line 39

def url
  @url
end

Instance Method Details

#to_hObject



42
43
44
45
46
47
48
49
50
# File 'app/components/hakumi_components/upload/file_entry.rb', line 42

def to_h
  {
    uid: @uid,
    name: @name,
    status: @status,
    percent: @percent,
    url: @url
  }
end