Class: DayoneToolbox::API::SearchEntryByTag

Inherits:
Base
  • Object
show all
Defined in:
lib/dayone_toolbox/api.rb

Instance Attribute Summary

Attributes inherited from Base

#cli_exit_code, #entry, #result

Instance Method Summary collapse

Methods inherited from Base

#initialize, #store

Constructor Details

This class inherits a constructor from DayoneToolbox::API::Base

Instance Method Details

#execObject



49
50
51
52
53
54
55
56
# File 'lib/dayone_toolbox/api.rb', line 49

def exec
  if @options[:include]
    @result = tag_include?
  elsif @options[:not]
    @result = tag_not_include?
  end
  self
end

#tag_include?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/dayone_toolbox/api.rb', line 41

def tag_include?
  @entry.tags.include?(@options[:include])
end

#tag_not_include?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/dayone_toolbox/api.rb', line 45

def tag_not_include?
  ! @entry.tags.include?(@options[:not])
end