-
Notifications
You must be signed in to change notification settings - Fork 0
/
original.rb
55 lines (46 loc) · 926 Bytes
/
original.rb
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class TelcoProvider
attr_accessor :provider_name
def initialize(provider_name)
@provider_name = provider_name
end
def email
if provider_name == :digi
elsif provider_name == :maxis
else
end
end
def telephone_number
if provider_name == :digi
'03-12344321'
elsif provider_name == :maxis
'03-12345678'
else
'03-87654321'
end
end
def homepage
if provider_name == :digi || provider_name == :maxis
"#{provider_name}.com.my"
else
'celcom.com'
end
end
def is_digi?
provider_name == :digi
end
def is_maxis?
provider_name == :maxis
end
def is_celcom?
provider_name == :celcom
end
end
telco = TelcoProvider.new(:celcom)
telco.telephone_number # =>
telco.homepage # =>
telco.email # =>
telco.is_maxis? # =>
telco.is_digi? # =>