Sha256: bf7500c1f64566a81a38159f333116a68b14bdab57522b2a8cabb4a308cd9656

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

require 'rexml/document'
require 'moblues/data_model/relationship'

module Moblues
  module Reader
    class Relationship
      def relationship(xml)
        DataModel::Relationship.new(
          name: xml.attributes['name'],
          destination_entity: xml.attributes['destinationEntity'],
          to_many: opt_bool(xml.attributes['toMany']),
          ordered: opt_bool(xml.attributes['ordered'])
        )
      end

      private
      def opt_bool(str_value)
        str_value == 'YES'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
moblues-0.4.0 lib/moblues/reader/relationship.rb
moblues-0.3.0 lib/moblues/reader/relationship.rb
moblues-0.2.0 lib/moblues/reader/relationship.rb
moblues-0.1.0 lib/moblues/reader/relationship.rb
moblues-0.0.1 lib/moblues/reader/relationship.rb