test

Ruby code posted
created at 30 Jul 20:10

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class Sathia 
 
  def full_name
    "Sathianarayanan Sundaram" # String
  end
  
  def working_in type=:current
    experience = { current: 'Hoppr', past: 'Cloudmint'} # Hash
    experience[type]
  end
 
  def is_a
    'Programmer'
  end

  def hobbies
    ['Coding', 'Music', 'Learning'] #Array
  end

  def skills
    {
      'programing' => ['Ruby', 'Python', 'PHP'],
      'platform' => ['Ruby on rails', 'CakePHP', 'Node.js'],
      'frontend' => ['Html', 'css', 'Javascript']
    }
  end
  
  def links
    links = {}
    ['facebook', 'twitter', 'github'].each do |network|
      links[network] = "http://www.#{network}.com/sathia27" # network is facebook, twitter
    end
  end

end

Eg:

geek = Sathia.new
geek.full_name # "Sathianrayanan Sundaram"
797 Bytes in 5 ms with coderay