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

#description ⇒ Object

Returns the value of attribute description.



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

def description
  @description
end

#end ⇒ Object

Returns the value of attribute end.



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

def end
  @end
end

#hash ⇒ Object

Returns the value of attribute hash.



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

def hash
  @hash
end

#name ⇒ Object

Returns the value of attribute name.



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

def name
  @name
end

#online_event ⇒ Object

Returns the value of attribute online_event.



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

def online_event
  @online_event
end

#start ⇒ Object

Returns the value of attribute start.



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

def start
  @start
end