Class: DayOneKindle::DataStore

Inherits:
Object
  • Object
show all
Defined in:
lib/dayone-kindle/data_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries, tags = []) ⇒ DataStore

Returns a new instance of DataStore.



5
6
7
8
# File 'lib/dayone-kindle/data_store.rb', line 5

def initialize(entries, tags = [])
  @entries = entries
  @tags = tags
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



3
4
5
# File 'lib/dayone-kindle/data_store.rb', line 3

def entries
  @entries
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/dayone-kindle/data_store.rb', line 3

def tags
  @tags
end

Instance Method Details

#save!Object



10
11
12
# File 'lib/dayone-kindle/data_store.rb', line 10

def save!
  entries.map { |entry| save_entry!(entry) }
end