<commit_before>= rpcoder

== installation

  $ gem install rpcoder

== generating AS3 RPC code

  #!/usr/bin/env ruby
  
  require 'rpcoder'
  require 'fileutils'
  
  RPCoder.name_space = 'foo.bar.rpc'
  RPCoder.api_class_name = 'RPC'
  
  RPCoder.type "Mail" do |t|
    t.add_field :subject, :String
    t.add_field :body,    :String
  end
  
  RPCoder.function "getMail" do |f|
    f.path        = "/mails/:id" # => ("/mails/" + id)
    f.method      = "GET"
    f.set_return_type "Mail"
    f.add_param  :id, "int"
    f.description = 'メールを取得'
  end
  
  RPCoder.function "getMails" do |f|
    f.path        = "/mails"
    f.method      = "GET"
    f.set_return_type "Array", {:array_type => "Mail"}
    f.description = 'メールを送信'
  end
  
  RPCoder.function "sendMail" do |f|
    f.path        = "/mails/create"
    f.method      = "POST"
    f.set_return_type "void"
    f.add_param  :subject, "String"
    f.add_param  :body,    "String"
    f.description = 'メールを送信'
  end
  
  # output codes
  dir = File.expand_path('src', File.dirname(__FILE__))
  RPCoder.export(dir)

<commit_msg>readme changes for as3 code example<commit_after>= rpcoder

== installation

  $ gem install rpcoder

== code for AS3 RPC

  #!/usr/bin/env ruby
  
  require 'rpcoder'
  require 'fileutils'
  
  RPCoder.name_space = 'foo.bar.rpc'
  RPCoder.api_class_name = 'RPC'
  
  RPCoder.type "Mail" do |t|
    t.add_field :subject, :String
    t.add_field :body,    :String
  end
  
  RPCoder.function "getMail" do |f|
    f.path        = "/mails/:id" # => ("/mails/" + id)
    f.method      = "GET"
    f.set_return_type "Mail"
    f.add_param  :id, "int"
    f.description = 'メールを取得'
  end
  
  RPCoder.function "getMails" do |f|
    f.path        = "/mails"
    f.method      = "GET"
    f.set_return_type "Array", {:array_type => "Mail"}
    f.description = 'メールを送信'
  end
  
  RPCoder.function "sendMail" do |f|
    f.path        = "/mails/create"
    f.method      = "POST"
    f.set_return_type "void"
    f.add_param  :subject, "String"
    f.add_param  :body,    "String"
    f.description = 'メールを送信'
  end
  
  # output codes
  dir = File.expand_path('src', File.dirname(__FILE__))
  RPCoder.export(dir)

== code for using RPC

  var rpc:RPC = new RPC('http://localhost:3000');
  rpc.getMail(1, function():void {
  	// success
  }, function():void {
  	// failure
  })


{'fraction_non_alphanumeric': 0.1441899915182358, 'fraction_numerical': 0.0033927056827820186, 'mean_word_length': 2.418840579710145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '44302', 'n_tokens_mistral': 960, 'n_tokens_neox': 925, 'n_words': 196}