Sha256: deb5fe2a4f2f222ab479c54715d58b058d78c58f19a561073abc71b1d08effc2

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

module Reactor
  module Cm
    class XmlAttribute
      AVAILABLE_SCOPES = %i(get set create).freeze

      attr_accessor :name, :type, :scopes

      def initialize(name, type, options)
        @name = name
        @type = type.presence || :string

        @scopes =
          if options[:except].present?
            AVAILABLE_SCOPES - options[:except]
          elsif options[:only].present?
            options[:only]
          else
            AVAILABLE_SCOPES
          end
      end

      def scope?(name)
        scopes.include?(name)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
infopark_reactor-1.29.1 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.29.0 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.28.0 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.27.0.rc10 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.27.0.rc9 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.27.0.rc8 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.27.0.rc7 lib/reactor/cm/xml_attribute.rb
infopark_reactor-1.27.0.rc4 lib/reactor/cm/xml_attribute.rb