Constructor method for new resources; the optional attributes parameter takes a Hash of attributes for the new resource.
Examples
my_course = Course.new my_course.name = "Western Civilization" my_course.lecturer = "Don Trotter" my_course.save my_other_course = Course.new(:name => "Philosophy: Reason and Being", :lecturer => "Ralph Cling") my_other_course.save
Source Code
# File active_resource/base.rb, line 533 def initialize(attributes = {}) @attributes = {} @prefix_options = {} load(attributes) end
<code/>and<pre/>for code samples.