lib/vedeu/editor/document.rb in vedeu-0.6.10 vs lib/vedeu/editor/document.rb in vedeu-0.6.11
- old
+ new
@@ -4,11 +4,11 @@
# A collection of keypresses ordered by input.
#
class Document
- include Vedeu::Model
+ include Vedeu::Repositories::Model
extend Forwardable
def_delegators :border,
:bx,
:bxn,
@@ -39,15 +39,14 @@
# Returns a new instance of Vedeu::Editor::Document.
#
# @param attributes [Hash]
# @option attributes data [String]
# @option attributes name [String]
- # @option attributes repository [Vedeu::Repository]
+ # @option attributes repository
+ # [Vedeu::Repositories::Repository]
# @return [Vedeu::Editor::Document]
def initialize(attributes = {})
- @attributes = defaults.merge!(attributes)
-
- @attributes.each do |key, value|
+ defaults.merge!(attributes).each do |key, value|
instance_variable_set("@#{key}", value || defaults.fetch(key))
end
end
# Clear the document content in the terminal.