Class: DayoneToolbox::API::Base
- Inherits:
-
Object
- Object
- DayoneToolbox::API::Base
- Defined in:
- lib/dayone_toolbox/api.rb
Direct Known Subclasses
AddEntry, EditEntry, FetchEntry, SearchEntry, SearchEntryByTag
Instance Attribute Summary collapse
-
#cli_exit_code ⇒ Object
readonly
Returns the value of attribute cli_exit_code.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ Base
constructor
A new instance of Base.
- #store(path = @file) ⇒ Object
Constructor Details
#initialize(file, options = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/dayone_toolbox/api.rb', line 8 def initialize(file, ={}) @file = file @entry = DayoneToolbox::Entry.new(@file) @options = @result = nil end |
Instance Attribute Details
#cli_exit_code ⇒ Object (readonly)
Returns the value of attribute cli_exit_code.
7 8 9 |
# File 'lib/dayone_toolbox/api.rb', line 7 def cli_exit_code @cli_exit_code end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
7 8 9 |
# File 'lib/dayone_toolbox/api.rb', line 7 def entry @entry end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
7 8 9 |
# File 'lib/dayone_toolbox/api.rb', line 7 def result @result end |
Instance Method Details
#store(path = @file) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/dayone_toolbox/api.rb', line 15 def store(path = @file) File.open(path, 'w') do |f| f.puts @entry.to_plist end self end |