#: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