class SAXMachine::SAXConfig::CollectionConfig

Attributes

name[R]

Public Class Methods

new(name, options) click to toggle source
# File lib/sax-machine/config/sax_collection.rb, line 6
def initialize(name, options)
  @name  = name.to_s
  @class = options[:class]
  @as    = options[:as].to_s
  @with  = options.fetch(:with, {})
end

Public Instance Methods

accessor() click to toggle source
# File lib/sax-machine/config/sax_collection.rb, line 13
def accessor
  as
end
attrs_match?(attrs) click to toggle source
# File lib/sax-machine/config/sax_collection.rb, line 17
def attrs_match?(attrs)
  @with.all? do |key, value|
    value === attrs[key.to_s]
  end
end
data_class() click to toggle source
# File lib/sax-machine/config/sax_collection.rb, line 23
def data_class
  @class || @name
end

Protected Instance Methods

as() click to toggle source
# File lib/sax-machine/config/sax_collection.rb, line 28
def as
  @as
end