Module: FSPath::Mac
- Included in:
- FSPath
- Defined in:
- lib/fspath/mac.rb
Constant Summary collapse
- FINDER_LABEL_COLORS =
[nil, :grey, :green, :purple, :blue, :yellow, :red, :orange].freeze
- FINDER_LABEL_COLOR_ALIASES =
{:gray => :grey}.freeze
Instance Method Summary collapse
-
#finder_label ⇒ Object
Get finder label (one of nil, :orange, :red, :yellow, :blue, :purple, :green and :grey).
-
#finder_label=(color) ⇒ Object
Set finder label (:grey is same as :gray, nil or false as :none).
-
#move_to_trash ⇒ Object
Move to trash.
-
#spotlight_comment ⇒ Object
Get spotlight comment.
-
#spotlight_comment=(comment) ⇒ Object
Set spotlight comment.
Instance Method Details
#finder_label ⇒ Object
Get finder label (one of nil, :orange, :red, :yellow, :blue, :purple, :green and :grey)
15 16 17 |
# File 'lib/fspath/mac.rb', line 15 def finder_label FINDER_LABEL_COLORS[finder_label_number] end |
#finder_label=(color) ⇒ Object
Set finder label (:grey is same as :gray, nil or false as :none)
20 21 22 23 24 |
# File 'lib/fspath/mac.rb', line 20 def finder_label=(color) index = FINDER_LABEL_COLORS.index(FINDER_LABEL_COLOR_ALIASES[color] || color) raise "Unknown label #{color.inspect}" unless index self.finder_label_number = index end |
#move_to_trash ⇒ Object
Move to trash
7 8 9 |
# File 'lib/fspath/mac.rb', line 7 def move_to_trash # actual implementation in extension end |
#spotlight_comment ⇒ Object
Get spotlight comment
27 28 29 |
# File 'lib/fspath/mac.rb', line 27 def spotlight_comment # actual implementation in extension end |
#spotlight_comment=(comment) ⇒ Object
Set spotlight comment
32 33 34 |
# File 'lib/fspath/mac.rb', line 32 def spotlight_comment=(comment) # actual implementation in extension end |