Class: Ulysses::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/ulysses/library.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dirname = nil) ⇒ Library

Returns a new instance of Library.



6
7
8
9
# File 'lib/ulysses/library.rb', line 6

def initialize(dirname = nil)
  dirname ||= '~/Library/Mobile Documents/X5AZV975AG~com~soulmen~ulysses3/Documents/Library'
  @dirname = File.expand_path(dirname)
end

Instance Attribute Details

#dirnameObject (readonly)

Returns the value of attribute dirname.



4
5
6
# File 'lib/ulysses/library.rb', line 4

def dirname
  @dirname
end

Instance Method Details

#groupsObject



11
12
13
14
15
# File 'lib/ulysses/library.rb', line 11

def groups
  Dir.glob(File.join @dirname, 'Groups-ulgroup', '*.ulgroup').map do |info_file|
    Group.new info_file
  end
end