Method: Reactor::Cm::XmlAttribute#initialize

Defined in:
lib/reactor/cm/xml_attribute.rb

#initialize(name, type, options) ⇒ XmlAttribute

Returns a new instance of XmlAttribute.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/reactor/cm/xml_attribute.rb', line 8

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