class Reactor::Cm::XmlAttribute

Constants

AVAILABLE_SCOPES

Attributes

name[RW]
scopes[RW]
type[RW]

Public Class Methods

new(name, type, options) click to toggle source
# File lib/reactor/cm/xml_attribute.rb, line 13
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

Public Instance Methods

scope?(name) click to toggle source
# File lib/reactor/cm/xml_attribute.rb, line 27
def scope?(name)
  self.scopes.include?(name)
end