Sha256: 73339b6fcdae544529211e688d01d4e025547d807b50a385662b2fc816ac5746

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

module AngularSprinkles
  module Helpers
    module DirectiveHelper
      def directive(name, input = {}, options = {}, &block)
        content = capture(&block) if block_given?

        attributes = Directive::Attributes.new([
          Directive::Name.new(name),
          Directive::Input::new(input),
          Directive::Options::new(options.except(:tag))
        ], { tag: options[:tag], content: content })

        content_tag(*attributes.to_content_tag)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
angular_sprinkles-0.0.5 lib/angular_sprinkles/helpers/directive_helper.rb