Sha256: 0c7ab887e6fb15047b4e06b694357d11ec9762a48bf7e55f36fd080620c4151d

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 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!
        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_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

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.6.22 lib/vedeu/bindings/refresh.rb