Sha256: 67b63265639fd9a4f5e4edb2c03713cfd48b8de4b097769359d3ef08b095166e

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 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_cursor!
        refresh_group!
        refresh_view!
      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_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::Output::RefreshGroup.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

      # :nocov:

    end # Refresh

  end # Bindings

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.6.19 lib/vedeu/bindings/refresh.rb
vedeu-0.6.18 lib/vedeu/bindings/refresh.rb
vedeu-0.6.17 lib/vedeu/bindings/refresh.rb
vedeu-0.6.16 lib/vedeu/bindings/refresh.rb