Class: Alman::Vacancy

Inherits:
ApiResource show all
Defined in:
lib/alman/resources/vacancy.rb

Instance Attribute Summary collapse

Attributes inherited from ApiResource

#api_method, #client, #json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiResource

add_api_attribute, api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, client, #determine_api_attribute_value, determine_api_attribute_value, #initialize, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json

Constructor Details

This class inherits a constructor from Alman::ApiResource

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/alman/resources/vacancy.rb', line 3

def created_at
  @created_at
end

#created_at_rfc822Object

Returns the value of attribute created_at_rfc822.



4
5
6
# File 'lib/alman/resources/vacancy.rb', line 4

def created_at_rfc822
  @created_at_rfc822
end

#end_atObject

Returns the value of attribute end_at.



5
6
7
# File 'lib/alman/resources/vacancy.rb', line 5

def end_at
  @end_at
end

#end_at_rfc822Object

Returns the value of attribute end_at_rfc822.



6
7
8
# File 'lib/alman/resources/vacancy.rb', line 6

def end_at_rfc822
  @end_at_rfc822
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/alman/resources/vacancy.rb', line 7

def id
  @id
end

#objectObject

Returns the value of attribute object.



8
9
10
# File 'lib/alman/resources/vacancy.rb', line 8

def object
  @object
end

#start_atObject

Returns the value of attribute start_at.



9
10
11
# File 'lib/alman/resources/vacancy.rb', line 9

def start_at
  @start_at
end

#start_at_rfc822Object

Returns the value of attribute start_at_rfc822.



10
11
12
# File 'lib/alman/resources/vacancy.rb', line 10

def start_at_rfc822
  @start_at_rfc822
end

#updated_atObject

Returns the value of attribute updated_at.



11
12
13
# File 'lib/alman/resources/vacancy.rb', line 11

def updated_at
  @updated_at
end

#updated_at_rfc822Object

Returns the value of attribute updated_at_rfc822.



12
13
14
# File 'lib/alman/resources/vacancy.rb', line 12

def updated_at_rfc822
  @updated_at_rfc822
end

Class Method Details

.retrieve(vacancy_id, params = {}, headers = {}) ⇒ Object



14
15
16
17
# File 'lib/alman/resources/vacancy.rb', line 14

def self.retrieve(vacancy_id, params={}, headers={})
  res = client.vacancies.retrieve(vacancy_id, params, headers)
  res
end

Instance Method Details

#bookingsObject



29
30
31
# File 'lib/alman/resources/vacancy.rb', line 29

def bookings()
  VacancyBookingsEndpoint.new(client, self)
end

#delete(params = {}, headers = {}) ⇒ Object



24
25
26
27
# File 'lib/alman/resources/vacancy.rb', line 24

def delete(params={}, headers={})
  res = client.vacancies.delete(id, params, headers)
  self.refresh_from(res.json, res.api_method, res.client)
end

#refresh(params = {}, headers = {}) ⇒ Object



19
20
21
22
# File 'lib/alman/resources/vacancy.rb', line 19

def refresh(params={}, headers={})
  res = client.vacancies.retrieve(id, params, headers)
  self.refresh_from(res.json, res.api_method, res.client)
end