Sha256: 2a64c65ecd100408f2b86cb75affbcd6174f55558743b81ffe873a2880614128

Contents?: true

Size: 391 Bytes

Versions: 3

Compression:

Stored size: 391 Bytes

Contents

class HelloWorld < Iowa::Component

	attr_accessor :number
	
	def timeframe
		now = Time.now.hour
		case
		when now > 20, now < 5
			"night"
		when now > 17
			"evening"
		when now > 11
			"afternoon"
		else
			"morning"
		end
	end

	def current_time
		Time.now.asctime
	end

	def lucky_numbers
		r = []
		until r.length == 8
			n = rand(32)
			r << n unless r.include? n
		end
		r
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
IOWA-1.0.3 examples/hello_world/iowa/HelloWorld.iwa
IOWA-1.0.2 examples/hello_world/iowa/HelloWorld.iwa
IOWA-1.0.0 examples/hello_world/iowa/HelloWorld.iwa