aboutsummaryrefslogtreecommitdiffstats
path: root/actionservice/lib/action_service/struct.rb
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-02-18 21:22:52 +0000
committerLeon Breedt <bitserf@gmail.com>2005-02-18 21:22:52 +0000
commitfdecb6843ba8c5b0f718225f343017e11fa7f711 (patch)
treeb8bd2050955bbc528ee23f3d42a18ee31d5f9833 /actionservice/lib/action_service/struct.rb
parent5dcbe933dfd34bb799ee370792b6066f6d6ceaac (diff)
downloadrails-fdecb6843ba8c5b0f718225f343017e11fa7f711.tar.gz
rails-fdecb6843ba8c5b0f718225f343017e11fa7f711.tar.bz2
rails-fdecb6843ba8c5b0f718225f343017e11fa7f711.zip
rename service* to web_service*.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@668 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionservice/lib/action_service/struct.rb')
-rw-r--r--actionservice/lib/action_service/struct.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionservice/lib/action_service/struct.rb b/actionservice/lib/action_service/struct.rb
index 8f2718883e..142127b052 100644
--- a/actionservice/lib/action_service/struct.rb
+++ b/actionservice/lib/action_service/struct.rb
@@ -14,16 +14,15 @@ module ActionService
# member :lastname, :string
# member :email, :string
# end
+ # person = Person.new(:id => 5, :firstname => 'john', :lastname => 'doe')
#
# Active Record model classes are already implicitly supported for method
# return signatures. A structure containing its columns as members will be
# automatically generated if its present in a signature.
- #
- # The structure
class Struct
# If a Hash is given as argument to an ActionService::Struct constructor,
- # containing as key the member name, and its associated initial value
+ # it can contain initial values for the structure member.
def initialize(values={})
if values.is_a?(Hash)
values.map{|k,v| send('%s=' % k.to_s, v)}
@@ -38,7 +37,7 @@ module ActionService
class << self
include ActionService::Signature
- # Creates a structure member accessible using +name+. Generates
+ # Creates a structure member with the specified +name+ and +type+. Generates
# accessor methods for reading and writing the member value.
def member(name, type)
write_inheritable_hash("struct_members", name => signature_parameter_class(type))