Skip to content

Instantly share code, notes, and snippets.

@JuzerShakir
Last active July 8, 2021 03:01
Show Gist options
  • Save JuzerShakir/b0a5bc32b0a2c5c836e748caa66116cc to your computer and use it in GitHub Desktop.
Save JuzerShakir/b0a5bc32b0a2c5c836e748caa66116cc to your computer and use it in GitHub Desktop.
Used in variable doc medium
string = "I am a string." # => String
int = 123 # => Integer
float = 34.5 # => Float
complex = 1i # => Complex
boolean = true # => Boolean
array = [a,b,c] # => Array
hash = {ruby: 3.0} # => Hash
total = int + float # => 157.5
prok = Proc.new { puts "I'm a Proc" }
# => #<Proc:0x000055e15f9f38a0 define_var.rb:1>
lambdaa = lambda { puts "I'm a Lambda" }
# => <Proc:0x000055e15f9f3850 define_var.rb:2 (lambda)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment