lib/vedeu/support/buffer.rb in vedeu-0.1.17 vs lib/vedeu/support/buffer.rb in vedeu-0.1.18
- old
+ new
@@ -1,11 +1,15 @@
module Vedeu
class Buffer
attr_reader :back, :front, :interface
- # @param attributes [Hash]
+ # @param [Hash] attributes The buffer attributes.
+ # @option attributes :back [Hash] The next view to be rendered.
+ # @option attributes :front [Hash] The view which is currently on screen.
+ # @option attributes :interface [Hash] An attribute form of the interface from
+ # which we can create a new front or back.
# @return [Buffer]
def initialize(attributes = {})
@attributes = attributes
@back = attributes.fetch(:back)
@@ -40,17 +44,24 @@
self
end
private
+ # @api private
+ # @param new_attributes [Hash]
+ # @return [Buffer]
def merge(new_attributes)
Buffer.new(@attributes.merge(new_attributes))
end
+ # @api private
+ # @return [TrueClass|FalseClass]
def content_available?
!!(back)
end
+ # @api private
+ # @return [TrueClass|FalseClass]
def no_content_available?
front.nil?
end
end