forked from vgvinay2/ruby_programme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice.rb
More file actions
22 lines (14 loc) · 855 Bytes
/
practice.rb
File metadata and controls
22 lines (14 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ary = [5, 10, 1, 23, 17]
p random_obj = rand(10)
p ary.map {|element| element * random_obj}
# Ruby => and Rails 5.2
# Capistrano is remote server automation and deployment tool.
# A part from using Deploying Web Application it can also be use for Server Automation.
# Module: Modules are about providing methods that we can use across multiple classes
# It help to resolve name space resolution and provide mixin
### Classes are about objects; modules are about functions.
# Class: Classes are about objects
# Example: For example, authentication and authorization systems are good examples of modules.
# Authentication systems work across multiple app-level classes (users are authenticated, sessions manage authentication
collection = ['tiger', 'eagle', 'hippopotamus', 'zebra', 'alligator']
p collection.reject {|element| element.length > 5 }