Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / common_cartridge   ruby

Repository URL to install this package:

Version: 1.0.1 

/ lib / common_cartridge / elements / organizations.rb

module CommonCartridge
  module Elements
    module Organizations
      class Item
        attr_accessor :type

        include SAXMachine

        attribute :identifier
        attribute :identifierref
        element :title

        elements :item, class: self, as: :items
      end

      class RootItem
        include SAXMachine

        attribute :identifier
        attribute :identifierref

        elements :item, class: Item, as: :items

        # todo: implement 'find_by' method here to quickly scan for particular items
      end

      class Organization
        include SAXMachine

        attribute :identifier
        attribute :structure
        element :item, class: RootItem, as: :root_item
      end

      class RootOrganization
        include SAXMachine

        elements :organization, class: Organization, as: :organizations
      end
    end
  end
end