Class: Rubino::Attachments::Classification

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubino/attachments/classification.rb

Overview

Result of Attachments::Classify.call. Pure data; no behaviour.

path:       frozen realpath captured once (TOCTOU), or original if unsafe
kind:       :image | :text | :document | :archive | :binary
mime:       Marcel content-sniffed type
safe:       false => safety pipeline rejected it; caller skips + warns
reason:     human-readable why-unsafe / how-classified

Instance Attribute Summary collapse

Instance Attribute Details

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def kind
  @kind
end

#mimeObject

Returns the value of attribute mime

Returns:

  • (Object)

    the current value of mime



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def mime
  @mime
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def path
  @path
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def reason
  @reason
end

#safeObject

Returns the value of attribute safe

Returns:

  • (Object)

    the current value of safe



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def safe
  @safe
end

#size_bytesObject

Returns the value of attribute size_bytes

Returns:

  • (Object)

    the current value of size_bytes



11
12
13
# File 'lib/rubino/attachments/classification.rb', line 11

def size_bytes
  @size_bytes
end