Class: Organizer::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/organizer/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Event

Returns a new instance of Event.



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
# File 'lib/organizer/event.rb', line 5

def initialize(params={})
			params.each do |attr, value|
				self.public_send("#{attr}=", value)
			end

			self.hash = 
		{
			name: {
				html: self.name
			},
			description: {
				html: self.description
			},
			start: {
				timezone: Time.zone.tzinfo.name,
				utc: self.start.utc.iso8601
			},
			:end => {
	timezone: Time.zone.tzinfo.name,
				utc: self.end.utc.iso8601
			},
			currency: "MYR",
			online_event: self.online_event
				}

			super()
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/organizer/event.rb', line 3

def description
  @description
end

#endObject

Returns the value of attribute end.



3
4
5
# File 'lib/organizer/event.rb', line 3

def end
  @end
end

#hashObject

Returns the value of attribute hash.



3
4
5
# File 'lib/organizer/event.rb', line 3

def hash
  @hash
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/organizer/event.rb', line 3

def name
  @name
end

#online_eventObject

Returns the value of attribute online_event.



3
4
5
# File 'lib/organizer/event.rb', line 3

def online_event
  @online_event
end

#startObject

Returns the value of attribute start.



3
4
5
# File 'lib/organizer/event.rb', line 3

def start
  @start
end