Sha256: ffa428bb3f10d160feb07887f93a1be9985354611c1391ccf86b806b18c660c7
Contents?: true
Size: 1.27 KB
Versions: 2
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true module Vedeu module Cells # Provides the position and visibility escape sequence for a # {Vedeu::Cursors::Cursor} # # @api private # class Cursor < Vedeu::Cells::Empty # @return [Boolean] def cell? false end # @return [NilClass] def null nil end alias_method :background, :null alias_method :colour, :null alias_method :foreground, :null alias_method :style, :null # Return an empty hash as most escape sequences won't make # sense as JSON. # # @return [Hash<void>] def to_h {}.merge!(position.to_h).merge!(value: value) end alias_method :to_hash, :to_h # Return an empty string as most escape sequences won't make # sense as HTML. # # @param _options [Hash] Ignored. # @return [String] def to_html(_options = {}) '' end # @return [String] def to_s "#{position}#{value}" end alias_method :to_str, :to_s # @return [Symbol] def type :cursor end private # @return [Hash] def defaults super.merge!(position: [1, 1]) end end # Cursor end # Cells end # Vedeu
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.8.6 | lib/vedeu/cells/cursor.rb |
vedeu-0.8.5 | lib/vedeu/cells/cursor.rb |