From 1ea0dd0ffc37232d27f4fa1350af6ebb3b5439f2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 25 Oct 2012 11:59:41 +0300 Subject: App docs --- doc/app/StaticModel.html | 648 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 648 insertions(+) create mode 100644 doc/app/StaticModel.html (limited to 'doc/app/StaticModel.html') diff --git a/doc/app/StaticModel.html b/doc/app/StaticModel.html new file mode 100644 index 00000000000..9dd1617c6b5 --- /dev/null +++ b/doc/app/StaticModel.html @@ -0,0 +1,648 @@ + + + + + + +module StaticModel - Rails Application Documentation + + + + + + + + + + + + + + + + +
+

module StaticModel

+ +
+ +

Provides an ActiveRecord-like interface to a model whose data is not +persisted to a database.

+ +
+ + + + +
+ + + + + + + + + + +
+

Public Instance Methods

+ + +
+ +
+ ==(other) + click to toggle source +
+ + +
+ + + + + +
+
# File app/roles/static_model.rb, line 40
+def ==(other)
+  if other.is_a? StaticModel
+    id == other.id
+  else
+    super
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ [](key) + click to toggle source +
+ + +
+ +

Used by AR for fetching attributes

+ +

Pass it along if we respond to it.

+ + + +
+
# File app/roles/static_model.rb, line 20
+def [](key)
+  send(key) if respond_to?(key)
+end
+
+ +
+ + + + +
+ + +
+ +
+ destroyed?() + click to toggle source +
+ + +
+ + + + + +
+
# File app/roles/static_model.rb, line 36
+def destroyed?
+  false
+end
+
+ +
+ + + + +
+ + +
+ +
+ new_record?() + click to toggle source +
+ + +
+ + + + + +
+
# File app/roles/static_model.rb, line 28
+def new_record?
+  false
+end
+
+ +
+ + + + +
+ + +
+ +
+ persisted?() + click to toggle source +
+ + +
+ + + + + +
+
# File app/roles/static_model.rb, line 32
+def persisted?
+  false
+end
+
+ +
+ + + + +
+ + +
+ +
+ to_param() + click to toggle source +
+ + +
+ + + + + +
+
# File app/roles/static_model.rb, line 24
+def to_param
+  id
+end
+
+ +
+ + + + +
+ + +
+ +
+ +
+ + + + -- cgit v1.2.1