U E D R , A S I H C RSS

Ruby/2011년스터디/세미나


1. RubyLanguage

RubyLanguage , 기







    • Hello World!

2. Ruby


    • tryRuby
    • irb
    • visual studio ironRuby
    • netbeans ruby
    • eclipse ruby
    • aptana (경 )

  • Hello Ruby!

      • 1- 2
      • 1
        -2

    • ?!

        • 1.0/0.0 -> infinity
        • 123.method
        • "".method
      • nilClass
        • nilClass nil, prototype .
        • , 객!
        • class
    • .



  • Ruby.new

    • !( )

    • initialize
      • initialize. ( )
        class Some
        def initialize
        # init variables
        end
      • end

      • 기(@)
    • def initialize
      @var # this is the way how declaring variable
      end

    • !

      • class Some
        def initialize
        # init variables
        end
      • end

        def Some.function
        # dynamic function declare
        end


    • class Some2 < Some
      def initialize
      # this is overriding
      end
      end


        • , 까?
      • Some2.function2 # undefined method
        def Some.function2
        # new function
        end
        Some.function2 # works!
        • / ?
          • superclass

    • attr_reader/attr_writer

  • ! ( return )
    • 결과
    • {} def/end
    • () !

      • while
      • do/while
      • for


      • 기기
        {| parameters| do something with parameters..}
        yield : get the block and run it

        a = 1, 2, 3, 4, 5
        a.each {|x| puts x+1} # bloack ?(maybe)



      • <- gets
      • <- puts, print

  • ( )

  • 기 ( 까?)
    • if/else
    • rescue

  • ()

    • UnitTest::

  • !


  • DeleteMe) .. 고 고

3. Ruby


class Layton
  def initialize
    @location = 'A'
  end

  def crossRiver
    printLocation
    @location = 'B'
    print " -> "
    printLocation
    print "\n"
  end

  def printLocation
    print @location
  end
end

4.

  • Snowball Keyword()
    • Winner : ,
Keyword
Ruby . $_ .
? ?
ifelse
->
(2)
irb irb .( NetBeans 게 irb )
-> (@)
. or . -

5.

  • "" irb . irb , dll . Ctrl+C N . irb . 1+2 3 ( =>nil !). 기기 #define . . , . . -
    • .. ..ㅠㅠ 기기 yield구 yield . co-routine ~ !! . -
    • 거 공 ㅠㅠ -
  • if-else . 근 if구 . C, C++, Java, JavaScript, Python . 근 " " .. . ㅠ ... 그 . aptana... . 그고 irb . Python Shell . 그 " " ... 궁금. -
    • 게. RubyLanguage if 구 . . a b add(a, b) . .

add(3,4) # => 7  (# RubyLanguage   )
add 3,4  # => 7 
. . 그 add 3, 4, 7

add(3, add(4, 7))
? .

add 3, add 4, 7
add ? . -

  • Ruby . irb Ruby . c . lua wow . -
    • irb ..ㅋㅋ .rb ruby / ~ -
  • . ( ) . irb editor . -
    • RubyLanguage . EuclideanAlgorithm . Netbeans ~ 고 간 . -
  • 그간 공 . "" . ....... . -
    • "" -ㅋㅋ . . ... ( 기). Martz :-) (..) :) -
    • ㅋㅋ -

    1. RubyLanguage . 그 . . T_T
    2. CodeRace . 그 .
    3. CodeRace RubyLanguage . 그 고 기 .
    4. CodeRace . -
  • . -
  • Ruby . , 궁금 . 궁금. 그 ㅋㅋㅋ (1. , 2. 3. ). 그고 { |x| ~~ } 기 꺼 ? 궁금. -
    • . { |x| ~~ } () . -
    • ! !! -

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:27:56
Processing time 0.0571 sec