Class: Kombo::Models::Shared::FormatFile

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/kombo/models/shared/format_file.rb

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(type:, accepted_mime_types: nil, max_file_size_bytes: nil) ⇒ FormatFile

Returns a new instance of FormatFile.



23
24
25
26
27
28
29
30
# File 'lib/kombo/models/shared/format_file.rb', line 23

def initialize(type:, accepted_mime_types: nil, max_file_size_bytes: nil)
  unless type == 'FILE'
    raise ArgumentError, 'Invalid value for type'
  end
  @type = 'FILE'
  @accepted_mime_types = accepted_mime_types
  @max_file_size_bytes = max_file_size_bytes
end

Instance Method Details

#==(other) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/kombo/models/shared/format_file.rb', line 33

def ==(other)
  return false unless other.is_a? self.class
  return false unless @type == other.type
  return false unless @accepted_mime_types == other.accepted_mime_types
  return false unless @max_file_size_bytes == other.max_file_size_bytes
  true
end