Class: Refile::Type
- Inherits:
-
Object
- Object
- Refile::Type
- Defined in:
- lib/refile/type.rb
Overview
A type represents an alias for one or multiple content types. By adding types, you could simplify this:
:document, content_type: %w[text/plain application/pdf]
To this:
:document, type: :document
Simply define a new type like this:
Refile.types[:document] = Refile::Type.new(:document,
content_type: %w[text/plain application/pdf]
)
Instance Attribute Summary collapse
-
#content_type ⇒ String+
The type’s content types.
Instance Method Summary collapse
-
#initialize(name, content_type: nil) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(name, content_type: nil) ⇒ Type
Returns a new instance of Type.
23 24 25 26 |
# File 'lib/refile/type.rb', line 23 def initialize(name, content_type: nil) @name = name @content_type = content_type end |
Instance Attribute Details
#content_type ⇒ String+
Returns The type’s content types.
19 20 21 |
# File 'lib/refile/type.rb', line 19 def content_type @content_type end |