Class: Basecamp::Types::OutOfOffice

Inherits:
Object
  • Object
show all
Includes:
TypeHelpers
Defined in:
lib/basecamp/generated/types.rb

Overview

OutOfOffice

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ OutOfOffice

Returns a new instance of OutOfOffice.



2198
2199
2200
2201
2202
2203
2204
2205
# File 'lib/basecamp/generated/types.rb', line 2198

def initialize(data = {})
  @back_on_date = data["back_on_date"]
  @enabled = parse_boolean(data["enabled"])
  @end_date = data["end_date"]
  @ongoing = parse_boolean(data["ongoing"])
  @person = parse_type(data["person"], "OutOfOfficePerson")
  @start_date = data["start_date"]
end

Instance Attribute Details

#back_on_dateObject

Returns the value of attribute back_on_date.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def back_on_date
  @back_on_date
end

#enabledObject

Returns the value of attribute enabled.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def enabled
  @enabled
end

#end_dateObject

Returns the value of attribute end_date.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def end_date
  @end_date
end

#ongoingObject

Returns the value of attribute ongoing.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def ongoing
  @ongoing
end

#personObject

Returns the value of attribute person.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def person
  @person
end

#start_dateObject

Returns the value of attribute start_date.



2196
2197
2198
# File 'lib/basecamp/generated/types.rb', line 2196

def start_date
  @start_date
end

Instance Method Details

#to_hObject



2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
# File 'lib/basecamp/generated/types.rb', line 2207

def to_h
  {
    "back_on_date" => @back_on_date,
    "enabled" => @enabled,
    "end_date" => @end_date,
    "ongoing" => @ongoing,
    "person" => @person,
    "start_date" => @start_date,
  }.compact
end

#to_json(*args) ⇒ Object



2218
2219
2220
# File 'lib/basecamp/generated/types.rb', line 2218

def to_json(*args)
  to_h.to_json(*args)
end