Learn Ruby on Rails - PowerPoint PPT Presentation

About This Presentation
Title:

Learn Ruby on Rails

Description:

Learn the basic concepts of Ruby on Rails by an experienced RoR developer from Space-O Technologies. – PowerPoint PPT presentation

Number of Views:80

less

Transcript and Presenter's Notes

Title: Learn Ruby on Rails


1
Ruby
Language
  • Session 1

2
Websites built on Rails
  • Twitter
  • Basecamp
  • Hulu
  • SlideShare
  • GitHub
  • Shopify
  • Groupon
  • AirBnb

3
What is Ruby ?
  • A dynamic, open source programming language with
    a focus on simplicity and productivity. It has an
    elegant syntax that is natural to read and easy
    to write.
  • - https//www.ruby-lang.org
  • It was developed by Yukihiro Matsumoto (also
    known as Matz in the Ruby community) in the mid
    1990s in Japan.
  • It is a pure Object-Oriented and an interpreted
    scripting language.

4
Say WHAAAAT ? OOP vs FP
  • According to Wikipedia, OOP is a programming
    paradigm is based on the concept of objects,
    which may contain data, in the form of fields,
    often known as attributes and code, in the form
    of procedures, often known as methods.
  • Functional programming is the form of programming
    that attempts to avoid changing state and mutable
    data.

5
Interpreted vs Compiled
  • Ruby is an interpreted scripting language and is
    run directly without first compiling and
    generating the byte code.
  • With a compiled language, code you enter is
    reduced to a set of machine-specific instructions
    before being saved as an executable file.
  • Interpreted programs can modify themselves by
    adding or changing functions at runtime. It is
    also usually easier to develop applications in an
    interpreted environment because you don't have to
    recompile your application each time you want to
    test a small section.

6
Colour me curious. Installation
  • Windows RubyInstaller
  • Ubuntu Package manager
  • Mac Pre Installed !!!

7
Lets compare shall we
  • Imagine you want to get the time one month from
    this very second. Here is how you would do that
    in Python and Ruby languages
  • Python
  • from datetime import datetime
  • from dateutil.relativedelta import relativedelta
  • new_time datetime.now() relativedelta(months1
    )

8
And in Ruby...
  • Ruby
  • require 'active_support/all'
  • new_time 1.month.from_now

9
Let the magic begin
  • Ruby files have .rb as extension
  • Hello World
  • Classes and Object
  • Global variable
  • Instance variable
  • Class variable

10
Ruby basics
  • Array
  • Hash
  • Range
  • If..Else Case
  • Loops
  • Methods

11
Thank You,

Keep Learning.
  • Space-O Technologies
Write a Comment
User Comments (0)
About PowerShow.com