Sha256: bea411951f424206fa9d90cdffae633c3a67b61f2bcd0051e2f35a8f8df3f9b5
Contents?: true
Size: 770 Bytes
Versions: 1
Compression:
Stored size: 770 Bytes
Contents
# frozen_string_literal: true module Saml module Kit # This module is responsible for # providing an API to build a # document object, xml, or builder class. module Buildable extend ActiveSupport::Concern class_methods do def build(*args, **kwargs) builder(*args, **kwargs) do |builder| yield builder if block_given? end.build end def build_xml(*args, **kwargs) builder(*args, **kwargs) do |builder| yield builder if block_given? end.to_xml end def builder(*args, **kwargs) builder_class.new(*args, **kwargs).tap do |builder| yield builder if block_given? end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
saml-kit-1.3.0 | lib/saml/kit/concerns/buildable.rb |