Sha256: ee00161fd2f06d105e0c949fe2895c901bb26b73889faec2fb5c5e47900c2c16

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

module Navi
  module Navigable
    module InstanceMethods
      def to_navigator(options={})
        return navigator_instance if navigator_instance
        options.merge!(:navigable => self)
        Navi.navigator_class.new options
      end

      def to_navigator!(options={})
        navigator = to_navigator(options)
        navigator.save
        navigator
      end

      private

      # Easily get the navigator instance based on the Navi.navigator setting
      def navigator_instance
        @navigator_instance ||= send(Navi.navigator)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
navi-0.0.17 lib/navi/navigable/instance_methods.rb
navi-0.0.16 lib/navi/navigable/instance_methods.rb
navi-0.0.15 lib/navi/navigable/instance_methods.rb
navi-0.0.14 lib/navi/navigable/instance_methods.rb
navi-0.0.13 lib/navi/navigable/instance_methods.rb
navi-0.0.12 lib/navi/navigable/instance_methods.rb
navi-0.0.11 lib/navi/navigable/instance_methods.rb
navi-0.0.10 lib/navi/navigable/instance_methods.rb
navi-0.0.9 lib/navi/navigable/instance_methods.rb
navi-0.0.6 lib/navi/navigable/instance_methods.rb
navi-0.0.2 lib/navi/navigable/instance_methods.rb