Sha256: 1f56f7293b940bab3a7eccce120790b4e58f31da7d96b48132fdd4959707aa79

Contents?: true

Size: 808 Bytes

Versions: 3

Compression:

Stored size: 808 Bytes

Contents

require 'caracal/core/models/page_flip_model'
require 'caracal/errors'


module Caracal
  module Core

    # This module encapsulates all the functionality related to flipping
    # specific page contents
    #
    module PageFlips
      def self.included(base)
        base.class_eval do

          #-------------------------------------------------------------
          # Public Methods
          #-------------------------------------------------------------

          def page_flip(*args, &block)
            options = Caracal::Utilities.extract_options!(args)

            model = Caracal::Core::Models::PageFlipModel.new(options, &block)
            
            if model.valid?
              contents << model
            end

            model
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
caracal_the_curve-1.4.4 lib/caracal/core/page_flips.rb
caracal_the_curve-1.4.3 lib/caracal/core/page_flips.rb
caracal_the_curve-1.4.2 lib/caracal/core/page_flips.rb