Sha256: 570ce16eb3f7780bf329250364bbe133642bfa778105c9d8c997a60c62b85624

Contents?: true

Size: 462 Bytes

Versions: 7

Compression:

Stored size: 462 Bytes

Contents

class Rack::CoreData::DataModel
  class Entity
    attr_reader :name, :attributes, :relationships

    def initialize(entity)
      raise ArgumentError unless ::Nokogiri::XML::Element === entity

      @name = entity['name']
      @attributes = entity.xpath('attribute').collect{|element| Attribute.new(element)}
      @relationships = entity.xpath('relationship').collect{|element| Relationship.new(element)}
    end

    def to_s
      @name
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rack-core-data-0.3.1 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.3.0 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.2.0 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.1.0 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.0.3 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.0.2 ./lib/rack/core-data/data_model/entity.rb
rack-core-data-0.0.1 ./lib/rack/core-data/data_model/entity.rb