Sha256: 823dad4d853de4b026ab9a34036156dc77b5668d2ed5ab9cd0544a1776247019

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

module Vedeu

  module Borders

    # Allows the storing of interface/view borders independent of the
    # interface instance.
    #
    class Repository < Vedeu::Repositories::Repository

      singleton_class.send(:alias_method, :borders, :repository)

      null Vedeu::Borders::Border, enabled: false
      real Vedeu::Borders::Border

    end # Repository

  end # Borders

  # Manipulate the repository of borders.
  #
  # @example
  #   Vedeu.borders
  #
  # @!method borders
  # @return [Vedeu::Borders::Repository]
  def_delegators Vedeu::Borders::Repository,
                 :borders

  # :nocov:

  # See {file:docs/borders.md#label-3A_refresh_border_}
  Vedeu.bind(:_refresh_border_) do |name|
    Vedeu::Borders::Refresh.by_name(name)
  end

  # See {file:docs/borders.md#label-3A_set_border_caption_}
  Vedeu.bind(:_set_border_caption_) do |name, caption|
    border = Vedeu.borders.by_name(name)
    border.caption = caption
    border.store { Vedeu.trigger(:_refresh_border_, name) }
  end

  # See {file:docs/borders.md#label-3A_set_border_title_}
  Vedeu.bind(:_set_border_title_) do |name, title|
    border = Vedeu.borders.by_name(name)
    border.title = title
    border.store { Vedeu.trigger(:_refresh_border_, name) }
  end

  # :nocov:

end # Vedeu

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vedeu-0.6.69 lib/vedeu/borders/repository.rb
vedeu-0.6.68 lib/vedeu/borders/repository.rb
vedeu-0.6.67 lib/vedeu/borders/repository.rb
vedeu-0.6.66 lib/vedeu/borders/repository.rb
vedeu-0.6.65 lib/vedeu/borders/repository.rb
vedeu-0.6.64 lib/vedeu/borders/repository.rb
vedeu-0.6.63 lib/vedeu/borders/repository.rb
vedeu-0.6.62 lib/vedeu/borders/repository.rb
vedeu-0.6.61 lib/vedeu/borders/repository.rb
vedeu-0.6.60 lib/vedeu/borders/repository.rb