Sha256: e02537e28b4bcadb0b9cc29ff297c2e90c4cbd3fa75884e5c238bfa865437e25

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 Bytes

Contents

#:enddoc:
module RailsConnector
  class ObjClass
    attr_reader :name, :attributes

    def initialize(data)
      @name, @attributes = data['name'], data['attributes'] || []
    end

    def self.by_name(name)
      if data = Revision.current.obj_classes[name.to_s]
        new(data)
      else
        raise ResourceNotFound, "Could not find #{self} with name #{name}"
      end
    end

    def has_attribute?(attribute_name)
      @attributes.include?(attribute_name.to_s)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.8.0.beta.200.891.647580e lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.889.d503e42 lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.883.f5f063b lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.884.4bd86e6 lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.869.9609b39 lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.856.8c0fec5 lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.809.bdfa8c3 lib/rails_connector/obj_class.rb
infopark_cloud_connector-6.8.0.beta.200.785.05d4af9 lib/rails_connector/obj_class.rb