Class: Alman::Calendar

Inherits:
ApiResource show all
Defined in:
lib/alman/resources/calendar.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/calendar.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/calendar.rb', line 4

def created_at_rfc822
  @created_at_rfc822
end

#detailsObject

Returns the value of attribute details.



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

def details
  @details
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#objectObject

Returns the value of attribute object.



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

def object
  @object
end

#updated_atObject

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#updated_at_rfc822Object

Returns the value of attribute updated_at_rfc822.



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

def updated_at_rfc822
  @updated_at_rfc822
end

Class Method Details

.all(params = {}, headers = {}) ⇒ Object



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

def self.all(params={}, headers={})
  res = client.calendars.all(params, headers)
  res
end

.create(params = {}, headers = {}) ⇒ Object



27
28
29
30
# File 'lib/alman/resources/calendar.rb', line 27

def self.create(params={}, headers={})
  res = client.calendars.create(params, headers)
  res
end

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



17
18
19
20
# File 'lib/alman/resources/calendar.rb', line 17

def self.retrieve(calendar_id, params={}, headers={})
  res = client.calendars.retrieve(calendar_id, params, headers)
  res
end

.update(calendar_id, params = {}, headers = {}) ⇒ Object



22
23
24
25
# File 'lib/alman/resources/calendar.rb', line 22

def self.update(calendar_id, params={}, headers={})
  res = client.calendars.update(calendar_id, params, headers)
  res
end

Instance Method Details

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



37
38
39
40
# File 'lib/alman/resources/calendar.rb', line 37

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

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



32
33
34
35
# File 'lib/alman/resources/calendar.rb', line 32

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

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



46
47
48
49
50
# File 'lib/alman/resources/calendar.rb', line 46

def save(params={}, headers={})
  params = ParamsBuilder.merge(api_attributes, params)
  res = client.calendars.update(id, params, headers)
  self.refresh_from(res.json, res.api_method, res.client)
end

#vacanciesObject



42
43
44
# File 'lib/alman/resources/calendar.rb', line 42

def vacancies()
  CalendarVacanciesEndpoint.new(client, self)
end