Sha256: 89e3e72e02d6ef990e7cd1fc00019df80f1a3b0eec8176f896e541529fc4ced5
Contents?: true
Size: 954 Bytes
Versions: 13
Compression:
Stored size: 954 Bytes
Contents
# frozen_string_literal: true module UiBibz module FactoryMethods # Class to initialize component class ComponentInitializeFactoryMethod def initialize(component, component_binding) @component = component @binding = component_binding @content = component_binding.local_variable_get(:content) @options = component_binding.local_variable_get(:options) @html_options = component_binding.local_variable_get(:html_options) @block = component_binding.local_variable_get(:block) end def make strategy.new(@component, @binding) end private def strategy if !@block.nil? UiBibz::Strategies::ComponentInitializeBlockStrategy elsif @content.is_a?(Hash) UiBibz::Strategies::ComponentInitializeHashStrategy else UiBibz::Strategies::ComponentInitializeStandardStrategy end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems