Sha256: 3676044d6fa1a725d779352912b743e41a6d164842c99c78ae9501d05162d6f1

Contents?: true

Size: 1.67 KB

Versions: 7

Compression:

Stored size: 1.67 KB

Contents

module Vedeu

  module Bindings

    # Provides events to refresh the view.
    #
    module Refresh

      extend self

      # Setup events relating to running Vedeu. This method is called
      # by Vedeu.
      #
      # @return [TrueClass]
      def setup!
        refresh!
        refresh_border!
        refresh_cursor!
        refresh_group!
        refresh_view!
        refresh_view_content!
      end

      private

      # :nocov:

      # See {file:docs/events/refresh.md#\_refresh_}
      def refresh!
        Vedeu.bind(:_refresh_) { Vedeu::Output::Refresh.all }
      end

      # See {file:docs/events/refresh.md#\_refresh_border_}
      def refresh_border!
        Vedeu.bind(:_refresh_border_) do |name|
          Vedeu::Borders::Refresh.by_name(name)
        end
      end

      # See {file:docs/events/refresh.md#\_refresh_cursor_}
      def refresh_cursor!
        Vedeu.bind(:_refresh_cursor_) do |name|
          Vedeu::Cursors::Refresh.by_name(name)
        end
      end

      # See {file:docs/events/refresh.md#\_refresh_group_}
      def refresh_group!
        Vedeu.bind(:_refresh_group_) do |name|
          Vedeu::Groups::Refresh.by_name(name)
        end
      end

      # See {file:docs/events/refresh.md#\_refresh_view_}
      def refresh_view!
        Vedeu.bind(:_refresh_view_) do |name|
          Vedeu::Buffers::Refresh.by_name(name)
        end
      end

      # See {file:docs/events/refresh.md#\_refresh_view_content_}
      def refresh_view_content!
        Vedeu.bind(:_refresh_view_content_) do |name|
          Vedeu::Buffers::Refresh.refresh_content_by_name(name)
        end
      end

      # :nocov:

    end # Refresh

  end # Bindings

end # Vedeu

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vedeu-0.6.29 lib/vedeu/bindings/refresh.rb
vedeu-0.6.28 lib/vedeu/bindings/refresh.rb
vedeu-0.6.27 lib/vedeu/bindings/refresh.rb
vedeu-0.6.26 lib/vedeu/bindings/refresh.rb
vedeu-0.6.25 lib/vedeu/bindings/refresh.rb
vedeu-0.6.24 lib/vedeu/bindings/refresh.rb
vedeu-0.6.23 lib/vedeu/bindings/refresh.rb