A
download Association.rb
Language: Ruby
LOC: 23
Project Info
IOWA
Server: RubyForge
Type: cvs
...Forge\i\iowa\iowa\iowa\src\
   Application.rb
   ApplicationStats.rb
   Association.rb
   BindingsParser.rb
   Client.rb
   Component.rb
   ComponentProxy.rb
   config.rb
   Context.rb
   DbPool.rb
   DynamicElements.rb
   Element.rb
   Form.rb
   HTTPServer.rb
   ISAAC.rb
   KeyValueCoding.rb
   LRUCache.rb
   PageStore.rb
   read_multipart.rb
   Request.rb
   SciTE.properties
   Session.rb
   SessionStats.rb
   SessionStore.rb
   Tag.rb
   TemplateParser.rb
   WEBrickServlet.rb

module Iowa

class Association
	
	def initialize(association)
		@association = association
	end
end

class PathAssociation < Association

	def get(object)
		object.valueForKeyPath(@association)
	end
	
	def set(object, val)
		object.takeValueForKeyPath(val, @association)
	end
end

class LiteralAssociation < Association

	def get(object)
		@association
	end
	
	def set(object, val)
		raise "attempted to set literal association"
	end
end

end

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us