Class: Camdram::TechieAdvert

Inherits:
Base
  • Object
show all
Defined in:
lib/camdram/techie_advert.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Base

#make_orphan

Constructor Details

#initialize(*args) ⇒ Camdram::TechieAdvert

Instantiate a new TechieAdvert object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


15
16
17
18
19
20
21
# File 'lib/camdram/techie_advert.rb', line 15

def initialize(*args)
  super(*args)
  @show = Show.new(@show, @client_instance) unless @show.nil?
  @deadline_time = DateTime.parse(@deadline_time) unless @deadline_time.nil?
  @expiry = Date.parse(@expiry) unless @expiry.nil?
  @last_updated = Date.parse(@last_updated) unless @last_updated.nil?
end

Instance Attribute Details

#contactObject

Returns the value of attribute contact


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def contact
  @contact
end

#deadlineObject

Returns the value of attribute deadline


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def deadline
  @deadline
end

#deadline_timeObject

Returns the value of attribute deadline_time


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def deadline_time
  @deadline_time
end

#expiryObject

Returns the value of attribute expiry


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def expiry
  @expiry
end

#last_updatedObject

Returns the value of attribute last_updated


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def last_updated
  @last_updated
end

#positionsObject

Returns the value of attribute positions


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def positions
  @positions
end

#showObject

Returns the value of attribute show


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def show
  @show
end

#tech_extraObject

Returns the value of attribute tech_extra


9
10
11
# File 'lib/camdram/techie_advert.rb', line 9

def tech_extra
  @tech_extra
end

Instance Method Details

#infoHash

Return a hash of the advert's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/camdram/techie_advert.rb', line 26

def info
  {
    id: id,
    show: show,
    positions: positions,
    contact: contact,
    deadline: deadline,
    deadline_time: deadline_time,
    expiry: expiry,
    tech_extra: tech_extra,
    last_updated: last_updated,
  }
end