Class: LMHD::Test::Hello

Inherits:
Object
  • Object
show all
Defined in:
lib/lmhd/test/hello.rb

Overview

Hello World

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lang = nil) ⇒ Hello

Returns a new instance of Hello.



7
8
9
# File 'lib/lmhd/test/hello.rb', line 7

def initialize(lang=nil)
	@language = lang
end

Class Method Details

.hi(language = nil) ⇒ Object

Say hi!

Example:

>> LMHD::Test::Hello.hi( "groot" )
=> I AM GROOT

Arguments:

language: (String)


19
20
21
22
# File 'lib/lmhd/test/hello.rb', line 19

def self.hi(language=nil)
	hello = Hello.new(language)
	hello.hi
end

Instance Method Details

#hiObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/lmhd/test/hello.rb', line 24

def hi
	case @language
	when "dood"
		"'sup doods"
	when "groot"
		"I AM GROOT"
	else
		"Hello World"
	end
end