Class: Alfred::Workflow
- Inherits:
-
Object
- Object
- Alfred::Workflow
- Defined in:
- lib/alfredlite/feedback.rb,
lib/alfredlite/workflow.rb
Constant Summary collapse
- CACHE_DIR =
'/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data'- DATA_DIR =
'/Library/Application Support/Alfred 2/Workflow Data'
Instance Attribute Summary collapse
-
#bundle_id ⇒ Object
readonly
Returns the value of attribute bundle_id.
Instance Method Summary collapse
- #feedback_items ⇒ Object
- #feedback_xml ⇒ Object
-
#initialize(bundle_id) ⇒ Workflow
constructor
A new instance of Workflow.
- #query(input) ⇒ Object
- #storage_path ⇒ Object
- #volatile_storage_path ⇒ Object
Constructor Details
#initialize(bundle_id) ⇒ Workflow
Returns a new instance of Workflow.
9 10 11 |
# File 'lib/alfredlite/workflow.rb', line 9 def initialize(bundle_id) @bundle_id = bundle_id end |
Instance Attribute Details
#bundle_id ⇒ Object (readonly)
Returns the value of attribute bundle_id.
7 8 9 |
# File 'lib/alfredlite/workflow.rb', line 7 def bundle_id @bundle_id end |
Instance Method Details
#feedback_items ⇒ Object
5 6 7 |
# File 'lib/alfredlite/feedback.rb', line 5 def feedback_items @feedback_items ||= [] end |
#feedback_xml ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/alfredlite/feedback.rb', line 9 def feedback_xml doc = REXML::Document.new doc << REXML::Element.new('items') feedback_items.each { |item| doc.root << item.to_xml } doc end |
#query(input) ⇒ Object
25 26 |
# File 'lib/alfredlite/workflow.rb', line 25 def query(input) end |
#storage_path ⇒ Object
13 14 15 16 17 |
# File 'lib/alfredlite/workflow.rb', line 13 def storage_path @storage_path ||= File.join(ENV['HOME'], DATA_DIR, bundle_id) self.class.mkdir(@storage_path) @storage_path end |
#volatile_storage_path ⇒ Object
19 20 21 22 23 |
# File 'lib/alfredlite/workflow.rb', line 19 def volatile_storage_path @volatile_storage_path ||= File.join(ENV['HOME'], CACHE_DIR, bundle_id) self.class.mkdir(@volatile_storage_path) @volatile_storage_path end |