Cocoa on-rails-5th
Upcoming SlideShare
Loading in...5
×
 

Cocoa on-rails-5th

on

  • 420 views

 

Statistics

Views

Total Views
420
Views on SlideShare
418
Embed Views
2

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 2

http://www.hanrss.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Cocoa on-rails-5th Cocoa on-rails-5th Presentation Transcript

  • Ruby
    • Cocoa on Rails
    • 5th
    • 2011-7-25
  • 这节课讲什么
    • Ruby 语法
  • Interactive Ruby
    • 开始 -> 程序 ->Ruby 1.9.2->
    • Interactive Ruby
  • Hello World
    • Irb>puts “hello world”
    • =>”hello world”
    • => nil
  • 计算器
    • irb> 1 + 2
    • => 3
  • 数学公式
    • Irb>Math.sqrt(9)
    • => 3.0
  • 函数
    • irb> def h
    • irb> puts "Hello World!"
    • irb> end
    • => nil
    • => h
    • => h()
  • 可接受参数的函数
    • irb> def h(name)
    • irb> puts "Hello #{name}!"
    • irb> end
    • irb> h(“Junli")
  • 将代码放入文件
    • puts “hello world”
    • 保存为 hello.rb
    • 在命令行下,运行 ruby hello.rb
  • 下一课程
    • 待定