Sha256: 0d7751766d721ecc01d142d61ef2418dedda46fb97ec844de1328a568b118e52

Contents?: true

Size: 871 Bytes

Versions: 31

Compression:

Stored size: 871 Bytes

Contents

module RailsConnector

  class ObjData
    def value_of(attribute_name)
      value_and_type_of(attribute_name).first
    end

    def type_of(attribute_name)
      value_and_type_of(attribute_name).second
    end

    def value_and_type_of(attribute_name)
      raise "implement in subclass"
    end

    def has_custom_attribute?(name)
      raise "implement in subclass"
    end

    private

    def type_of_internal(key)
      case key
      when "_text_links"
        "linklist"
      when "_valid_from", "_valid_until", "_last_changed"
        "date"
      when "title", "body"
        "html"
      when "blob"
        "binary"
      else
        nil
      end
    end

    def default_attribute_value(attribute_type)
      case attribute_type
      when "linklist"
        []
      when "multienum"
        []
      else
        nil
      end
    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
infopark_cloud_connector-7.0.2 lib/rails_connector/obj_data.rb
infopark_cloud_connector-7.0.1 lib/rails_connector/obj_data.rb
infopark_cloud_connector-7.0.0 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.5 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.4 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.3.1.36404185 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.2.1.125136549 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.1.3.22208381 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.9.0.3.197272233 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.174.51542603 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.115.227021242 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.73.75172665 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.2.153416031 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.67.110847540 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.3.1.23895778 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.2.36.82613853 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.2.7.128454143 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.1.26.236500544 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.1 lib/rails_connector/obj_data.rb
infopark_cloud_connector-6.8.0.539.93842523 lib/rails_connector/obj_data.rb