Class: TicketflyPlus::Objects::Event

Inherits:
Base
  • Object
show all
Defined in:
lib/ticketfly_plus/objects.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ Event

Returns a new instance of Event.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ticketfly_plus/objects.rb', line 59

def initialize(event)
    @additionalInfo = event['additionalInfo']
    @additionalTicketText = event['additionalTicketText']
    @ageLimit = event['ageLimit']
    @ageLimitCode = event['ageLimitCode']
    @dateCreated = !event['dateCreated'].nil? ? DateTime.parse(event['dateCreated']) : event['dateCreated']
    @doorsDate = !event['doorsDate'].nil? ? DateTime.parse(event['doorsDate']) : event['doorsDate']
    @endDate = !event['endDate'].nil? ? DateTime.parse(event['endDate']) : event['endDate']
    @eventStatus = event['eventStatus']
    @eventStatusCode = event['eventStatusCode']
    @eventStatusMessage = event['eventStatusMessage']
    @externalTicketingUrls = !event['externalTicketingUrls'].nil? ? get_param_info(event['externalTicketingUrls'], Objects::TicketingUrl ) : event['externalTicketingUrls']
    @facebookEventId = event['facebookEventId']
    @facebookEventIdString = event['facebookEventIdString']
    @featured = event['featured']
    @headliners = !event['headliners'].nil? ? get_param_info(event['headliners'], Objects::Attraction) : event['headliners']
    @headlinersName = event['headlinersName']
    @id = event['id']
    @image = !event['image'].nil? ? Objects::Image.new(event['image']) : event['image']
    @lastUpdated = !event['lastUpdated'].nil? ? DateTime.parse(event['lastUpdated']) : event['lastUpdated']
    @name = event['name']
    @offSaleDate = !event['offSaleDate'].nil? ? DateTime.parse(event['offSaleDate']) : event['offSaleDate']
    @onSaleDate = !event['onSaleDate'].nil? ? DateTime.parse(event['onSaleDate']) : event['onSaleDate']
    @onSaleDates = !event['onSaleDates'].nil? ? get_param_info(event['onSaleDates'], Objects::SaleDate) : event['onSaleDates']
    @org = !event['org'].nil? ? Objects::Org.new(event['org']) : event['org'] 
    @promoterName = event['promoterName']
    @publishDate = !event['publishDate'].nil? ? DateTime.parse(event['publishDate']) : event['publishDate']
    @published = event['published']
    @purchaseSkin = !event['purchaseSkin'].nil? ? Objects::PurchaseSkin.new(event['purchaseSkin']) : event['purchaseSkin']
    @showType = event['showType']
    @showTypeCode = event['showTypeCode']
    @slug = event['slug']
    @sponsorImage = !event['sponsorImage'].nil? ? Objects::Image.new(event['sponsorImage']) : event['sponsorImage']
    @sponsorName = event['sponsorName']
    @startDate = !event['startDate'].nil? ? DateTime.parse(event['startDate']) : event['startDate']
    @supports = !event['supports'].nil? ? get_param_info(event['supports'], Objects::Attraction) : event['supports']
    @supportsName = event['supportsName']
    @ticketPrice = event['ticketPrice']
    @ticketPurchaseUrl = event['ticketPurchaseUrl']
    @topLineInfo = event['topLineInfo']
    @urlEventDetailsUrl = event['urlEventDetailsUrl']
    @venue = !event['venue'].nil? ? Objects::Venue.new(event['venue']) : event['venue']
end

Instance Attribute Details

#additionalInfoObject

Returns the value of attribute additionalInfo.



17
18
19
# File 'lib/ticketfly_plus/objects.rb', line 17

def additionalInfo
  @additionalInfo
end

#additionalTicketTextObject

Returns the value of attribute additionalTicketText.



18
19
20
# File 'lib/ticketfly_plus/objects.rb', line 18

def additionalTicketText
  @additionalTicketText
end

#ageLimitObject

Returns the value of attribute ageLimit.



19
20
21
# File 'lib/ticketfly_plus/objects.rb', line 19

def ageLimit
  @ageLimit
end

#ageLimitCodeObject

Returns the value of attribute ageLimitCode.



20
21
22
# File 'lib/ticketfly_plus/objects.rb', line 20

def ageLimitCode
  @ageLimitCode
end

#dateCreatedObject

Returns the value of attribute dateCreated.



21
22
23
# File 'lib/ticketfly_plus/objects.rb', line 21

def dateCreated
  @dateCreated
end

#doorsDateObject

Returns the value of attribute doorsDate.



22
23
24
# File 'lib/ticketfly_plus/objects.rb', line 22

def doorsDate
  @doorsDate
end

#endDateObject

Returns the value of attribute endDate.



23
24
25
# File 'lib/ticketfly_plus/objects.rb', line 23

def endDate
  @endDate
end

#eventStatusObject

Returns the value of attribute eventStatus.



24
25
26
# File 'lib/ticketfly_plus/objects.rb', line 24

def eventStatus
  @eventStatus
end

#eventStatusCodeObject

Returns the value of attribute eventStatusCode.



25
26
27
# File 'lib/ticketfly_plus/objects.rb', line 25

def eventStatusCode
  @eventStatusCode
end

#eventStatusMessageObject

Returns the value of attribute eventStatusMessage.



26
27
28
# File 'lib/ticketfly_plus/objects.rb', line 26

def eventStatusMessage
  @eventStatusMessage
end

#externalTicketingUrlsObject

Returns the value of attribute externalTicketingUrls.



27
28
29
# File 'lib/ticketfly_plus/objects.rb', line 27

def externalTicketingUrls
  @externalTicketingUrls
end

#facebookEventIdObject

Returns the value of attribute facebookEventId.



28
29
30
# File 'lib/ticketfly_plus/objects.rb', line 28

def facebookEventId
  @facebookEventId
end

#facebookEventIdStringObject

Returns the value of attribute facebookEventIdString.



29
30
31
# File 'lib/ticketfly_plus/objects.rb', line 29

def facebookEventIdString
  @facebookEventIdString
end

Returns the value of attribute featured.



30
31
32
# File 'lib/ticketfly_plus/objects.rb', line 30

def featured
  @featured
end

#headlinersObject

Returns the value of attribute headliners.



31
32
33
# File 'lib/ticketfly_plus/objects.rb', line 31

def headliners
  @headliners
end

#headlinersNameObject

Returns the value of attribute headlinersName.



32
33
34
# File 'lib/ticketfly_plus/objects.rb', line 32

def headlinersName
  @headlinersName
end

#idObject

Returns the value of attribute id.



33
34
35
# File 'lib/ticketfly_plus/objects.rb', line 33

def id
  @id
end

#imageObject

Returns the value of attribute image.



34
35
36
# File 'lib/ticketfly_plus/objects.rb', line 34

def image
  @image
end

#lastUpdatedObject

Returns the value of attribute lastUpdated.



35
36
37
# File 'lib/ticketfly_plus/objects.rb', line 35

def lastUpdated
  @lastUpdated
end

#nameObject

Returns the value of attribute name.



36
37
38
# File 'lib/ticketfly_plus/objects.rb', line 36

def name
  @name
end

#offSaleDateObject

Returns the value of attribute offSaleDate.



37
38
39
# File 'lib/ticketfly_plus/objects.rb', line 37

def offSaleDate
  @offSaleDate
end

#onSaleDateObject

Returns the value of attribute onSaleDate.



38
39
40
# File 'lib/ticketfly_plus/objects.rb', line 38

def onSaleDate
  @onSaleDate
end

#onSaleDatesObject

Returns the value of attribute onSaleDates.



39
40
41
# File 'lib/ticketfly_plus/objects.rb', line 39

def onSaleDates
  @onSaleDates
end

#orgObject

Returns the value of attribute org.



40
41
42
# File 'lib/ticketfly_plus/objects.rb', line 40

def org
  @org
end

#promoterNameObject

Returns the value of attribute promoterName.



41
42
43
# File 'lib/ticketfly_plus/objects.rb', line 41

def promoterName
  @promoterName
end

#publishDateObject

Returns the value of attribute publishDate.



42
43
44
# File 'lib/ticketfly_plus/objects.rb', line 42

def publishDate
  @publishDate
end

#publishedObject

Returns the value of attribute published.



43
44
45
# File 'lib/ticketfly_plus/objects.rb', line 43

def published
  @published
end

#purchaseSkinObject

Returns the value of attribute purchaseSkin.



44
45
46
# File 'lib/ticketfly_plus/objects.rb', line 44

def purchaseSkin
  @purchaseSkin
end

#showTypeObject

Returns the value of attribute showType.



45
46
47
# File 'lib/ticketfly_plus/objects.rb', line 45

def showType
  @showType
end

#showTypeCodeObject

Returns the value of attribute showTypeCode.



46
47
48
# File 'lib/ticketfly_plus/objects.rb', line 46

def showTypeCode
  @showTypeCode
end

#slugObject

Returns the value of attribute slug.



47
48
49
# File 'lib/ticketfly_plus/objects.rb', line 47

def slug
  @slug
end

#sponsorImageObject

Returns the value of attribute sponsorImage.



48
49
50
# File 'lib/ticketfly_plus/objects.rb', line 48

def sponsorImage
  @sponsorImage
end

#sponsorNameObject

Returns the value of attribute sponsorName.



49
50
51
# File 'lib/ticketfly_plus/objects.rb', line 49

def sponsorName
  @sponsorName
end

#startDateObject

Returns the value of attribute startDate.



50
51
52
# File 'lib/ticketfly_plus/objects.rb', line 50

def startDate
  @startDate
end

#supportsObject

Returns the value of attribute supports.



51
52
53
# File 'lib/ticketfly_plus/objects.rb', line 51

def supports
  @supports
end

#supportsNameObject

Returns the value of attribute supportsName.



52
53
54
# File 'lib/ticketfly_plus/objects.rb', line 52

def supportsName
  @supportsName
end

#ticketPriceObject

Returns the value of attribute ticketPrice.



53
54
55
# File 'lib/ticketfly_plus/objects.rb', line 53

def ticketPrice
  @ticketPrice
end

#ticketPurchaseUrlObject

Returns the value of attribute ticketPurchaseUrl.



54
55
56
# File 'lib/ticketfly_plus/objects.rb', line 54

def ticketPurchaseUrl
  @ticketPurchaseUrl
end

#topLineInfoObject

Returns the value of attribute topLineInfo.



55
56
57
# File 'lib/ticketfly_plus/objects.rb', line 55

def topLineInfo
  @topLineInfo
end

#urlEventDetailsUrlObject

Returns the value of attribute urlEventDetailsUrl.



56
57
58
# File 'lib/ticketfly_plus/objects.rb', line 56

def urlEventDetailsUrl
  @urlEventDetailsUrl
end

#venueObject

Returns the value of attribute venue.



57
58
59
# File 'lib/ticketfly_plus/objects.rb', line 57

def venue
  @venue
end

Instance Method Details

#share_a_sale(shareasale) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
# File 'lib/ticketfly_plus/objects.rb', line 103

def share_a_sale(shareasale)
        s_url = 'http://www.shareasale.com/r.cfm?u=' + shareasale.to_s + '&b=234786&m=27601&afftrack=&urllink='
        share_a_sale_url = s_url + @ticketPurchaseUrl.
                        gsub('&', '%26').
                        gsub('.', '%2E').
                        gsub('/', '%2F').
                        gsub('=', '%3D').
                        gsub('?', '%3F').
                        gsub('_', '%5F')
        return share_a_sale_url
end