Sha256: 5a0a21fe33873630796e2c274a7ab8a6b28b48fb5c47ba45e1c51908c0fbc463

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

module Joybox
  module Actions

    class Split

      def self.defaults
        {
          duration: 0.3
        }
      end

      def self.with(options = {})
        # Todo print error message on the console
        return unless [:columns, :rows].any? { |k| options.has_key? k }

        options = options.nil? ? defaults : defaults.merge!(options)
        return CCSplitCols.actionWithCols(options[:columns], duration: options[:duration]) if options.has_key? :columns
        return CCSplitRows.actionWithRows(options[:rows], duration: options[:duration]) if options.has_key? :rows
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/actions/split.rb
joybox-1.1.0 motion/joybox/actions/split.rb