SlideShare une entreprise Scribd logo
1  sur  253
Ruby
Nooks & Crannies
Kerry Buckley, IPRUG 4 December 2012
% notation
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%Q[foo “bar” ‘baz’ #{2 + 2}]
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%Q[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%Q[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%q[foo "bar" 'baz' #{2 + 2}]
% notation
%[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%Q[foo “bar” ‘baz’ #{2 + 2}]
=> "foo "bar" 'baz' 4"
%q[foo "bar" 'baz' #{2 + 2}]
=> "foo "bar" 'baz' #{2 + 2}"
% notation
% notation
%{foo}
% notation
%{foo}
=> "foo"
% notation
%{foo}
=> "foo"
%|bar|
% notation
%{foo}
=> "foo"
%|bar|
=> "bar"
% notation
%{foo}
=> "foo"
%|bar|
=> "bar"
%$#@_$
% notation
%{foo}
=> "foo"
%|bar|
=> "bar"
%$#@_$
=> “”
% notation
% notation
%w[foo bar baz]
% notation
%w[foo bar baz]
=> ["foo", "bar", "baz"]
% notation
%w[foo bar baz]
=> ["foo", "bar", "baz"]
%w[foo bar b#{2+2}z]
% notation
%w[foo bar baz]
=> ["foo", "bar", "baz"]
%w[foo bar b#{2+2}z]
=> ["foo", "bar", "b#{2+2}z"]
% notation
%w[foo bar baz]
=> ["foo", "bar", "baz"]
%w[foo bar b#{2+2}z]
=> ["foo", "bar", "b#{2+2}z"]
%W[foo bar b#{2+2}z]
% notation
%w[foo bar baz]
=> ["foo", "bar", "baz"]
%w[foo bar b#{2+2}z]
=> ["foo", "bar", "b#{2+2}z"]
%W[foo bar b#{2+2}z]
=> ["foo", "bar", "b4z"]
% notation
% notation
%r{^foo/bar/d*$}i
% notation
%r{^foo/bar/d*$}i
=> /^foo/bar/d*$/i
% notation
%r{^foo/bar/d*$}i
=> /^foo/bar/d*$/i
%s{foo bar}
% notation
%r{^foo/bar/d*$}i
=> /^foo/bar/d*$/i
%s{foo bar}
=> :"foo bar"
% notation
%r{^foo/bar/d*$}i
=> /^foo/bar/d*$/i
%s{foo bar}
=> :"foo bar"
%x{head -1 /etc/paths}
% notation
%r{^foo/bar/d*$}i
=> /^foo/bar/d*$/i
%s{foo bar}
=> :"foo bar"
%x{head -1 /etc/paths}
=> "/usr/binn"
*
*
"hello " * 3
*
"hello " * 3
=> "hello hello hello "
*
"hello " * 3
=> "hello hello hello "
[1, 2, 3] * 2
*
"hello " * 3
=> "hello hello hello "
[1, 2, 3] * 2
=> [1, 2, 3, 1, 2, 3]
*
"hello " * 3
=> "hello hello hello "
[1, 2, 3] * 2
=> [1, 2, 3, 1, 2, 3]
[1, 2, 3] * " "
*
"hello " * 3
=> "hello hello hello "
[1, 2, 3] * 2
=> [1, 2, 3, 1, 2, 3]
[1, 2, 3] * " "
=> "1 2 3"
Substring match
Substring match
str = "foo bar"
Substring match
str = "foo bar"
str =~ /o./
Substring match
str = "foo bar"
str =~ /o./
=> 1
Substring match
str = "foo bar"
str =~ /o./
=> 1
str =~ /xx/
Substring match
str = "foo bar"
str =~ /o./
=> 1
str =~ /xx/
=> nil
Substring match
Substring match
str = "foo bar"
str.match /o./
Substring match
str = "foo bar"
str.match /o./
=> #<MatchData "oo">
Substring match
str = "foo bar"
str.match /o./
=> #<MatchData "oo">
str.match /x/
Substring match
str = "foo bar"
str.match /o./
=> #<MatchData "oo">
str.match /x/
=> nil
Substring match
str = "foo bar"
str.match /o./
=> #<MatchData "oo">
str.match /x/
=> nil
str.match “oo”
Substring match
str = "foo bar"
str.match /o./
=> #<MatchData "oo">
str.match /x/
=> nil
str.match “oo”
=> #<MatchData "oo">
Substring match
Substring match
str = "foo bar"
str[/o./]
Substring match
str = "foo bar"
str[/o./]
=> "oo"
Substring match
str = "foo bar"
str[/o./]
=> "oo"
str[/x/]
Substring match
str = "foo bar"
str[/o./]
=> "oo"
str[/x/]
=> nil
Substring match
str = "foo bar"
str[/o./]
=> "oo"
str[/x/]
=> nil
str[“oo”]
Substring match
str = "foo bar"
str[/o./]
=> "oo"
str[/x/]
=> nil
str[“oo”]
=> "oo"
Blocks & procs
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
flip = proc {|a| a.reverse }
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
flip = proc {|a| a.reverse }
{foo bar}.map &flip
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
flip = proc {|a| a.reverse }
{foo bar}.map &flip
=> ["oof", "rab"]
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
flip = ->(a){ a.reverse }
{foo bar}.map &flip
=> ["oof", "rab"]
Blocks & procs
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
{foo bar}.map &:reverse
Blocks & procs
%w{foo bar}.map {|a| a.reverse }
=> ["oof", "rab"]
{foo bar}.map &:reverse
=> ["oof", "rab"]
Blocks & procs
Blocks & procs
Class Symbol
  def to_proc
    Proc.new do |*args|
      args.shift.__send__(self, *args)
    end
  end
end
Blocks & procs
Blocks & procs
flip = ->(a){ a.reverse }
Blocks & procs
flip = ->(a){ a.reverse }
flip.call("GURPI")
Blocks & procs
flip = ->(a){ a.reverse }
flip.call("GURPI")
=> "IPRUG"
Blocks & procs
flip = ->(a){ a.reverse }
flip.call("GURPI")
=> "IPRUG"
flip.("GURPI")
=> "IPRUG"
Blocks & procs
flip = ->(a){ a.reverse }
flip.call("GURPI")
=> "IPRUG"
flip.("GURPI")
=> "IPRUG"
flip["GURPI"]
=> "IPRUG"
tap
tap
(1..5).map{|a| a**2}
      .select(&:odd?)
      .inject(&:+)
=> 35
tap
tap
(1..5).map{|a| a**2}
      .select(&:odd?)
      .tap{|a| p a}
      .inject(&:+)
tap
(1..5).map{|a| a**2}
      .select(&:odd?)
      .tap{|a| p a}
      .inject(&:+)
[1, 9, 25]
=> 35
tap
tap
def create_foo
  Foo.new.tap do|foo|
    foo.bar = 42
    foo.baz = 69
  end
end
Multiple assignment
Multiple assignment
a, b = 1, 2
Multiple assignment
a, b = 1, 2
a
=> 1
b
=> 2
Multiple assignment
Multiple assignment
array = [1, 2]
a, b = array
Multiple assignment
array = [1, 2]
a, b = array
a
=> 1
b
=> 2
Multiple assignment
Multiple assignment
a, b, c = 1, 2
Multiple assignment
a, b, c = 1, 2
c
Multiple assignment
a, b, c = 1, 2
c
=> nil
Multiple assignment
a, b, c = 1, 2
c
=> nil
a, b = 1, 2, 3
Multiple assignment
a, b, c = 1, 2
c
=> nil
a, b = 1, 2, 3
b
Multiple assignment
a, b, c = 1, 2
c
=> nil
a, b = 1, 2, 3
b
=> 2
Multiple assignment
Multiple assignment
a, *b = 1, 2, 3, 4
Multiple assignment
a, *b = 1, 2, 3, 4
a
Multiple assignment
a, *b = 1, 2, 3, 4
a
=> 1
Multiple assignment
a, *b = 1, 2, 3, 4
a
=> 1
b
Multiple assignment
a, *b = 1, 2, 3, 4
a
=> 1
b
=> [2, 3, 4]
Multiple assignment
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
=> [2, 3, 4]
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
=> [2, 3, 4]
c
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
=> [2, 3, 4]
c
=> 5
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
=> [2, 3, 4]
c
=> 5
d
Multiple assignment
a, *b, c, d = 1, 2, 3, 4, 5, 6
b
=> [2, 3, 4]
c
=> 5
d
=> 6
Multiple assignment
Multiple assignment
array = [1, 2, 3, 4]
a, _, _, b = array
Multiple assignment
array = [1, 2, 3, 4]
a, _, _, b = array
a
=> 1
Multiple assignment
array = [1, 2, 3, 4]
a, _, _, b = array
a
=> 1
b
=> 4
Multiple assignment
array = [1, 2, 3, 4]
a, _, _, b = array
a
=> 1
b
=> 4
a, *_, b = array
Multiple assignment
Multiple assignment
array = [[1, 2], [3, 4]]
Multiple assignment
array = [[1, 2], [3, 4]]
array.map {|a| a[0] * a[1] }
Multiple assignment
array = [[1, 2], [3, 4]]
array.map {|a| a[0] * a[1] }
=> [2, 12]
Multiple assignment
array = [[1, 2], [3, 4]]
array.map {|a| a[0] * a[1] }
=> [2, 12]
array.map {|a, b| a * b }
Multiple assignment
array = [[1, 2], [3, 4]]
array.map {|a| a[0] * a[1] }
=> [2, 12]
array.map {|a, b| a * b }
=> [2, 12]
Multiple assignment
Multiple assignment
array = [[1, [2, 3]],
         [3, [4, 5]]]
Multiple assignment
array = [[1, [2, 3]],
         [3, [4, 5]]]
array.map {|a, (b, _)| a * b }
Multiple assignment
array = [[1, [2, 3]],
         [3, [4, 5]]]
array.map {|a, (b, _)| a * b }
=> [2, 12]
Multiple assignment
Multiple assignment
hash = {foo: 1, bar: 2}
Multiple assignment
hash = {foo: 1, bar: 2}
hash.map {|a| a }
Multiple assignment
hash = {foo: 1, bar: 2}
hash.map {|a| a }
=> [[:foo, 1], [:bar, 2]]
Multiple assignment
hash = {foo: 1, bar: 2}
hash.map {|a| a }
=> [[:foo, 1], [:bar, 2]]
hash.map {|k,v| "#{k} -> #{v}" }
Multiple assignment
hash = {foo: 1, bar: 2}
hash.map {|a| a }
=> [[:foo, 1], [:bar, 2]]
hash.map {|k,v| "#{k} -> #{v}" }
=> ["foo -> 1", "bar -> 2"]
Multiple assignment
Multiple assignment
people = {
  fred: [30, "blue", :male],
  freda: [21, "brown", :female]
}
Multiple assignment
people = {
  fred: [30, "blue", :male],
  freda: [21, "brown", :female]
}
people.map {|p|
  "#{p[0]} is #{p[1][0]}"
}
Multiple assignment
people = {
  fred: [30, "blue", :male],
  freda: [21, "brown", :female]
}
people.map {|p|
  "#{p[0]} is #{p[1][0]}"
}
=> ["fred is 40", "freda is 21"]
Multiple assignment
people = {
  fred: [30, "blue", :male],
  freda: [21, "brown", :female]
}
people.map {|name, attrs|
  "#{name} is #{attrs.first}"
}
=> ["fred is 40", "freda is 21"]
Multiple assignment
people = {
  fred: [30, "blue", :male],
  freda: [21, "brown", :female]
}
people.map {|name, (age, *_)|
  "#{name} is #{age}"
}
=> ["fred is 40", "freda is 21"]
Type coercion
Type coercion
123.to_s
Type coercion
123.to_s
=> "123"
Type coercion
123.to_s
=> "123"
:foo.to_s
Type coercion
123.to_s
=> "123"
:foo.to_s
=> "foo"
Type coercion
123.to_s
=> "123"
:foo.to_s
=> "foo"
[1, 2].to_s
Type coercion
123.to_s
=> "123"
:foo.to_s
=> "foo"
[1, 2].to_s
=> "[1, 2]"
Type coercion
Type coercion
"123".to_i
Type coercion
"123".to_i
=> 123
Type coercion
"123".to_i
=> 123
1.2.to_i
Type coercion
"123".to_i
=> 123
1.2.to_i
=> 1
Type coercion
"123".to_i
=> 123
1.2.to_i
=> 1
"foo".to_i
Type coercion
"123".to_i
=> 123
1.2.to_i
=> 1
"foo".to_i
=> 0
Type coercion
Type coercion
"1.2".to_f
Type coercion
"1.2".to_f
=> 1.2
Type coercion
"1.2".to_f
=> 1.2
1.to_f
Type coercion
"1.2".to_f
=> 1.2
1.to_f
=> 1.0
Type coercion
"1.2".to_f
=> 1.2
1.to_f
=> 1.0
"foo".to_f
Type coercion
"1.2".to_f
=> 1.2
1.to_f
=> 1.0
"foo".to_f
=> 0.0
Type coercion
Type coercion
1.2.to_int
Type coercion
1.2.to_int
=> 1
Type coercion
1.2.to_int
=> 1
"123".to_int
Type coercion
1.2.to_int
=> 1
"123".to_int
NoMethodError: undefined method
  `to_int' for "123":String
Type coercion
1.2.to_int
=> 1
"123".to_int
NoMethodError: undefined method
  `to_int' for "123":String
:foo.to_str
Type coercion
1.2.to_int
=> 1
"123".to_int
NoMethodError: undefined method
  `to_int' for "123":String
:foo.to_str
NoMethodError: undefined method
  `to_str' for :foo:Symbol
Type coercion
Type coercion
Integer(123)
Type coercion
Integer(123)
=> 123
Type coercion
Integer(123)
=> 123
Integer("123")
Type coercion
Integer(123)
=> 123
Integer("123")
=> 123
Type coercion
Integer(123)
=> 123
Integer("123")
=> 123
Integer(1.23)
Type coercion
Integer(123)
=> 123
Integer("123")
=> 123
Integer(1.23)
=> 1
Type coercion
Type coercion
String(“foo”)
Type coercion
String(“foo”)
=> “foo”
Type coercion
String(“foo”)
=> “foo”
String(123)
Type coercion
String(“foo”)
=> “foo”
String(123)
=> “123”
Type coercion
String(“foo”)
=> “foo”
String(123)
=> “123”
String(:foo)
Type coercion
String(“foo”)
=> “foo”
String(123)
=> “123”
String(:foo)
=> “foo”
Type coercion
Type coercion
Array(“foo”)
Type coercion
Array(“foo”)
=> [“foo”]
Type coercion
Array(“foo”)
=> [“foo”]
Array([“foo”, “bar”])
Type coercion
Array(“foo”)
=> [“foo”]
Array([“foo”, “bar”])
=> [“foo”, “bar”]
Type coercion
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo "foo", "bar"
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo "foo", "bar"
foo
bar
Type coercion
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo "foo"
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo "foo"
foo
Type coercion
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo ["foo", "bar"]
Type coercion
def echo *args
  Array(args).each {|a| puts a }
end
echo ["foo", "bar"]
foo
bar
Mapping hashes
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
squares = {}
numbers.each do |k, v|
  squares[k] = v**2
end
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
squares = {}
numbers.each do |k, v|
  squares[k] = v**2
end
squares
=> {:one=>1, :two=>4, :three=>9}
Mapping hashes
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
numbers.map {|k, v| [k, v**2] }
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
numbers.map {|k, v| [k, v**2] }
=> [[:one, 1], [:two, 4],
    [:three, 9]]
Mapping hashes
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
numbers.map {|k, v|
  [k, v**2] }.flatten
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
numbers.map {|k, v|
  [k, v**2] }.flatten
=> [:one, 1, :two, 4, :three, 9]
Mapping hashes
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
Hash[*numbers.map {|k, v|
  [k, v**2] }.flatten]
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
Hash[*numbers.map {|k, v|
  [k, v**2] }.flatten]
=> {:one=>1, :two=>4, :three=>9}
Mapping hashes
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
Hash[*numbers.flat_map {|k, v|
  [k, v**2] }]
Mapping hashes
numbers = {one: 1, two: 2,
           three: 3}
Hash[*numbers.flat_map {|k, v|
  [k, v**2] }]
=> {:one=>1, :two=>4, :three=>9}
Anonymous classes
Anonymous classes
foo = Class.new do
  def hello
    "hello"
  end
end
Anonymous classes
foo = Class.new do
  def hello
    "hello"
  end
end
foo.new.hello
Anonymous classes
foo = Class.new do
  def hello
    "hello"
  end
end
foo.new.hello
=> "hello"
Struct & OpenStruct
Struct & OpenStruct
Person = Struct.new :name, :age
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
=> #<struct Person name="Kerry",
     age=43>
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
=> #<struct Person name="Kerry",
     age=43>
me.age
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
=> #<struct Person name="Kerry",
     age=43>
me.age
=> 43
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
=> #<struct Person name="Kerry",
     age=43>
me.age
=> 43
me.age = 30
Struct & OpenStruct
Person = Struct.new :name, :age
me = Person.new "Kerry", 43
=> #<struct Person name="Kerry",
     age=43>
me.age
=> 43
me.age = 30
=> 30
Struct & OpenStruct
Struct & OpenStruct
Person = Struct.new :name do
  def greet
    puts "Hello, I'm #{name}"
  end
end
Struct & OpenStruct
Person = Struct.new :name do
  def greet
    puts "Hello, I'm #{name}"
  end
end
Person.new("Kerry").greet
Struct & OpenStruct
Person = Struct.new :name do
  def greet
    puts "Hello, I'm #{name}"
  end
end
Person.new("Kerry").greet
Hello, I'm Kerry
Struct & OpenStruct
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
=> #<OpenStruct name="Kerry",
     age=43>
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
=> #<OpenStruct name="Kerry",
     age=43>
me.age
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
=> #<OpenStruct name="Kerry",
     age=43>
me.age
=> 43
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
=> #<OpenStruct name="Kerry",
     age=43>
me.age
=> 43
me.age = 30
Struct & OpenStruct
me = OpenStruct.new(
       name: "Kerry", age: 43)
=> #<OpenStruct name="Kerry",
     age=43>
me.age
=> 43
me.age = 30
=> 30
Struct & OpenStruct
Struct & OpenStruct
struct.members
Struct & OpenStruct
struct.members
=> [:name, :age]
Struct & OpenStruct
struct.members
=> [:name, :age]
struct.values
Struct & OpenStruct
struct.members
=> [:name, :age]
struct.values
=> ["Kerry", 43]
Struct & OpenStruct
struct.members
=> [:name, :age]
struct.values
=> ["Kerry", 43]
struct.each_pair {|k, v|
  puts "#{k}: #{v}" }
Struct & OpenStruct
struct.members
=> [:name, :age]
struct.values
=> ["Kerry", 43]
struct.each_pair {|k, v|
  puts "#{k}: #{v}" }
name: Kerry
age: 43
Constructors
Constructors
class Colour
  def initialize(r, g, b)
    @r, @g, @b = r, g, b
  end
end
Constructors
class Colour
  def initialize(r, g, b)
    @r, @g, @b = r, g, b
  end
end
Colour.new(255, 0, 0)
Constructors
class Colour
  def initialize(r, g, b)
    @r, @g, @b = r, g, b
  end
end
Colour.new(255, 0, 0)
Constructors
Constructors
class BasicObject
  def self.new(*args, &block)
    instance = allocate
    instance.initialize(*args,
                        &block)
    instance
  end
end
Constructors
Constructors
class Colour
  def self.new_with_hex(*args, &block)
    instance = allocate
    instance.init_with_hex(*args, &block)
    instance
  end
Constructors
class Colour
  def self.new_with_hex(*args, &block)
    instance = allocate
    instance.init_with_hex(*args, &block)
    instance
  end

  def init_with_hex(name)
    ...
  end
end
Constructors
Constructors
Colour.new(255, 0, 0)
Constructors
Colour.new(255, 0, 0)
Colour.new_with_hex(“ff0000”)
end

Contenu connexe

Tendances

Simplifying code monster to elegant in n 5 steps
Simplifying code  monster to elegant in n 5 stepsSimplifying code  monster to elegant in n 5 steps
Simplifying code monster to elegant in n 5 stepstutec
 
Ruby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examplesRuby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examplesNiranjan Sarade
 
Ruby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and IteratorsRuby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and IteratorsSarah Allen
 
اشعار. فریدون. مشیری
اشعار. فریدون. مشیریاشعار. فریدون. مشیری
اشعار. فریدون. مشیریFarid Kamali
 
Heroku Waza 2013 Lessons Learned
Heroku Waza 2013 Lessons LearnedHeroku Waza 2013 Lessons Learned
Heroku Waza 2013 Lessons LearnedSimon Bagreev
 
Extending Operators in Perl with Operator::Util
Extending Operators in Perl with Operator::UtilExtending Operators in Perl with Operator::Util
Extending Operators in Perl with Operator::UtilNova Patch
 
ใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมธงชัย พาศรี
 
1024+ Seconds of JS Wizardry - JSConf.eu 2013
1024+ Seconds of JS Wizardry - JSConf.eu 20131024+ Seconds of JS Wizardry - JSConf.eu 2013
1024+ Seconds of JS Wizardry - JSConf.eu 2013Martin Kleppe
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cythonAnderson Dantas
 
[1062BPY12001] Data analysis with R / week 4
[1062BPY12001] Data analysis with R / week 4[1062BPY12001] Data analysis with R / week 4
[1062BPY12001] Data analysis with R / week 4Kevin Chun-Hsien Hsu
 
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"PromptWorks
 
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...3 Pillars Network
 
Dipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoireDipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoireAchraf Ourti
 
Python Usage (5-minute-summary)
Python Usage (5-minute-summary)Python Usage (5-minute-summary)
Python Usage (5-minute-summary)Ohgyun Ahn
 
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲Mohammad Reza Kamalifard
 
Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL codeSimon Hoyle
 
Perspec sys tokenization paper_a4
Perspec sys tokenization paper_a4Perspec sys tokenization paper_a4
Perspec sys tokenization paper_a4Mullrich1012
 

Tendances (20)

Simplifying code monster to elegant in n 5 steps
Simplifying code  monster to elegant in n 5 stepsSimplifying code  monster to elegant in n 5 steps
Simplifying code monster to elegant in n 5 steps
 
Ruby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examplesRuby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examples
 
Ruby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and IteratorsRuby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and Iterators
 
Python lists
Python listsPython lists
Python lists
 
اشعار. فریدون. مشیری
اشعار. فریدون. مشیریاشعار. فریدون. مشیری
اشعار. فریدون. مشیری
 
Heroku Waza 2013 Lessons Learned
Heroku Waza 2013 Lessons LearnedHeroku Waza 2013 Lessons Learned
Heroku Waza 2013 Lessons Learned
 
Extending Operators in Perl with Operator::Util
Extending Operators in Perl with Operator::UtilExtending Operators in Perl with Operator::Util
Extending Operators in Perl with Operator::Util
 
ใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรมใบงานเรื่องการคอมไพล์โปรแกรม
ใบงานเรื่องการคอมไพล์โปรแกรม
 
Elixir
ElixirElixir
Elixir
 
1024+ Seconds of JS Wizardry - JSConf.eu 2013
1024+ Seconds of JS Wizardry - JSConf.eu 20131024+ Seconds of JS Wizardry - JSConf.eu 2013
1024+ Seconds of JS Wizardry - JSConf.eu 2013
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
[1062BPY12001] Data analysis with R / week 4
[1062BPY12001] Data analysis with R / week 4[1062BPY12001] Data analysis with R / week 4
[1062BPY12001] Data analysis with R / week 4
 
py_AutoMapMaker
py_AutoMapMakerpy_AutoMapMaker
py_AutoMapMaker
 
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
 
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...
Ben Peacock, Republic of Everyone - National Green Brands Forum, melbourne 17...
 
Dipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoireDipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoire
 
Python Usage (5-minute-summary)
Python Usage (5-minute-summary)Python Usage (5-minute-summary)
Python Usage (5-minute-summary)
 
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه سوم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
 
Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL code
 
Perspec sys tokenization paper_a4
Perspec sys tokenization paper_a4Perspec sys tokenization paper_a4
Perspec sys tokenization paper_a4
 

En vedette

Javasccript MV* frameworks
Javasccript MV* frameworksJavasccript MV* frameworks
Javasccript MV* frameworksKerry Buckley
 
AZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the EnterpriseAZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the EnterpriseRawn Shah
 
Search Engines in the fight against Institutional Impecuniousness
Search Engines in the fight against Institutional ImpecuniousnessSearch Engines in the fight against Institutional Impecuniousness
Search Engines in the fight against Institutional ImpecuniousnessIWMW
 
Blooms Taxonomy
Blooms TaxonomyBlooms Taxonomy
Blooms TaxonomyDoug Adams
 
Kanban and Iterationless Working
Kanban and Iterationless WorkingKanban and Iterationless Working
Kanban and Iterationless WorkingKerry Buckley
 
Are web managers still needed when everyone is a web 'expert'?
Are web managers still needed when everyone is a web 'expert'?Are web managers still needed when everyone is a web 'expert'?
Are web managers still needed when everyone is a web 'expert'?IWMW
 
Testing http calls with Webmock and VCR
Testing http calls with Webmock and VCRTesting http calls with Webmock and VCR
Testing http calls with Webmock and VCRKerry Buckley
 

En vedette (11)

BDD with cucumber
BDD with cucumberBDD with cucumber
BDD with cucumber
 
Javasccript MV* frameworks
Javasccript MV* frameworksJavasccript MV* frameworks
Javasccript MV* frameworks
 
TDD refresher
TDD refresherTDD refresher
TDD refresher
 
AZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the EnterpriseAZEC2012 - Social Business in the Enterprise
AZEC2012 - Social Business in the Enterprise
 
Search Engines in the fight against Institutional Impecuniousness
Search Engines in the fight against Institutional ImpecuniousnessSearch Engines in the fight against Institutional Impecuniousness
Search Engines in the fight against Institutional Impecuniousness
 
7li7w devcon5
7li7w devcon57li7w devcon5
7li7w devcon5
 
Blooms Taxonomy
Blooms TaxonomyBlooms Taxonomy
Blooms Taxonomy
 
Kanban and Iterationless Working
Kanban and Iterationless WorkingKanban and Iterationless Working
Kanban and Iterationless Working
 
Are web managers still needed when everyone is a web 'expert'?
Are web managers still needed when everyone is a web 'expert'?Are web managers still needed when everyone is a web 'expert'?
Are web managers still needed when everyone is a web 'expert'?
 
Testing http calls with Webmock and VCR
Testing http calls with Webmock and VCRTesting http calls with Webmock and VCR
Testing http calls with Webmock and VCR
 
Jasmine
JasmineJasmine
Jasmine
 

Similaire à Ruby nooks & crannies

รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2Pookie Pook
 
Useful javascript
Useful javascriptUseful javascript
Useful javascriptLei Kang
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?Nikita Popov
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskellujihisa
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a bossgsterndale
 
RedDot Ruby Conf 2014 - Dark side of ruby
RedDot Ruby Conf 2014 - Dark side of ruby RedDot Ruby Conf 2014 - Dark side of ruby
RedDot Ruby Conf 2014 - Dark side of ruby Gautam Rege
 
Replica Sets
Replica SetsReplica Sets
Replica SetsMongoDB
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma IntroduçãoÍgor Bonadio
 
Functional Gradient Boosting based on Residual Network Perception
Functional Gradient Boosting based on Residual Network PerceptionFunctional Gradient Boosting based on Residual Network Perception
Functional Gradient Boosting based on Residual Network PerceptionAtsushi Nitanda
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About RubyIan Bishop
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapHoward Lewis Ship
 
Τα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonΤα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonMoses Boudourides
 
A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009Jordan Baker
 

Similaire à Ruby nooks & crannies (20)

รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?
 
Portfolio - Paul O
Portfolio - Paul OPortfolio - Paul O
Portfolio - Paul O
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Refactor like a boss
Refactor like a bossRefactor like a boss
Refactor like a boss
 
RedDot Ruby Conf 2014 - Dark side of ruby
RedDot Ruby Conf 2014 - Dark side of ruby RedDot Ruby Conf 2014 - Dark side of ruby
RedDot Ruby Conf 2014 - Dark side of ruby
 
Intoduction to php arrays
Intoduction to php arraysIntoduction to php arrays
Intoduction to php arrays
 
Replica Sets
Replica SetsReplica Sets
Replica Sets
 
Ruby - Uma Introdução
Ruby - Uma IntroduçãoRuby - Uma Introdução
Ruby - Uma Introdução
 
Functional Gradient Boosting based on Residual Network Perception
Functional Gradient Boosting based on Residual Network PerceptionFunctional Gradient Boosting based on Residual Network Perception
Functional Gradient Boosting based on Residual Network Perception
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About Ruby
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter Bootstrap
 
Τα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonΤα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την Python
 
Basics
BasicsBasics
Basics
 
เซต
เซตเซต
เซต
 
A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009A Taste of Python - Devdays Toronto 2009
A Taste of Python - Devdays Toronto 2009
 

Plus de Kerry Buckley

Tdd for BT E2E test community
Tdd for BT E2E test communityTdd for BT E2E test community
Tdd for BT E2E test communityKerry Buckley
 
What I learned from Seven Languages in Seven Weeks (IPRUG)
What I learned from Seven Languages in Seven Weeks (IPRUG)What I learned from Seven Languages in Seven Weeks (IPRUG)
What I learned from Seven Languages in Seven Weeks (IPRUG)Kerry Buckley
 
Adastral Park code retreat introduction
Adastral Park code retreat introductionAdastral Park code retreat introduction
Adastral Park code retreat introductionKerry Buckley
 
MongoMapper lightning talk
MongoMapper lightning talkMongoMapper lightning talk
MongoMapper lightning talkKerry Buckley
 
The secret life of bees
The secret life of beesThe secret life of bees
The secret life of beesKerry Buckley
 
Background processing
Background processingBackground processing
Background processingKerry Buckley
 
Katas, Contests and Coding Dojos
Katas, Contests and Coding DojosKatas, Contests and Coding Dojos
Katas, Contests and Coding DojosKerry Buckley
 
Kanban and Iterationless Working
Kanban and Iterationless WorkingKanban and Iterationless Working
Kanban and Iterationless WorkingKerry Buckley
 
Software Development Trends
Software Development TrendsSoftware Development Trends
Software Development TrendsKerry Buckley
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven DevelopmentKerry Buckley
 
REST: putting the web back in to web services
REST: putting the web back in to web servicesREST: putting the web back in to web services
REST: putting the web back in to web servicesKerry Buckley
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with SeleniumKerry Buckley
 

Plus de Kerry Buckley (20)

Tdd for BT E2E test community
Tdd for BT E2E test communityTdd for BT E2E test community
Tdd for BT E2E test community
 
What I learned from Seven Languages in Seven Weeks (IPRUG)
What I learned from Seven Languages in Seven Weeks (IPRUG)What I learned from Seven Languages in Seven Weeks (IPRUG)
What I learned from Seven Languages in Seven Weeks (IPRUG)
 
Functional ruby
Functional rubyFunctional ruby
Functional ruby
 
Adastral Park code retreat introduction
Adastral Park code retreat introductionAdastral Park code retreat introduction
Adastral Park code retreat introduction
 
MongoMapper lightning talk
MongoMapper lightning talkMongoMapper lightning talk
MongoMapper lightning talk
 
Ruby
RubyRuby
Ruby
 
Cloud
CloudCloud
Cloud
 
The secret life of bees
The secret life of beesThe secret life of bees
The secret life of bees
 
Background processing
Background processingBackground processing
Background processing
 
Katas, Contests and Coding Dojos
Katas, Contests and Coding DojosKatas, Contests and Coding Dojos
Katas, Contests and Coding Dojos
 
Rack
RackRack
Rack
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Kanban and Iterationless Working
Kanban and Iterationless WorkingKanban and Iterationless Working
Kanban and Iterationless Working
 
Software Development Trends
Software Development TrendsSoftware Development Trends
Software Development Trends
 
TDD
TDDTDD
TDD
 
TDD, BDD and mocks
TDD, BDD and mocksTDD, BDD and mocks
TDD, BDD and mocks
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven Development
 
REST: putting the web back in to web services
REST: putting the web back in to web servicesREST: putting the web back in to web services
REST: putting the web back in to web services
 
Git
GitGit
Git
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 

Ruby nooks & crannies

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n
  213. \n
  214. \n
  215. \n
  216. \n
  217. \n
  218. \n
  219. \n
  220. \n
  221. \n
  222. \n
  223. \n
  224. \n
  225. \n
  226. \n
  227. \n
  228. \n
  229. \n
  230. \n
  231. \n
  232. \n
  233. \n
  234. \n
  235. \n
  236. \n
  237. \n
  238. \n
  239. \n
  240. \n
  241. \n
  242. \n
  243. \n
  244. \n
  245. \n
  246. \n
  247. \n
  248. \n
  249. \n
  250. \n
  251. \n
  252. \n
  253. \n
  254. \n
  255. \n
  256. \n
  257. \n
  258. \n
  259. \n
  260. \n
  261. \n
  262. \n
  263. \n
  264. \n
  265. \n
  266. \n
  267. \n
  268. \n
  269. \n
  270. \n
  271. \n
  272. \n
  273. \n
  274. \n
  275. \n
  276. \n
  277. \n
  278. \n
  279. \n
  280. \n
  281. \n
  282. \n
  283. \n