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.



2395
2396
2397
2398
2399
2400
2401
2402
# File 'lib/basecamp/generated/types.rb', line 2395

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.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def back_on_date
  @back_on_date
end

#enabledObject

Returns the value of attribute enabled.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def enabled
  @enabled
end

#end_dateObject

Returns the value of attribute end_date.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def end_date
  @end_date
end

#ongoingObject

Returns the value of attribute ongoing.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def ongoing
  @ongoing
end

#personObject

Returns the value of attribute person.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def person
  @person
end

#start_dateObject

Returns the value of attribute start_date.



2393
2394
2395
# File 'lib/basecamp/generated/types.rb', line 2393

def start_date
  @start_date
end

Instance Method Details

#to_hObject



2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
# File 'lib/basecamp/generated/types.rb', line 2404

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



2415
2416
2417
# File 'lib/basecamp/generated/types.rb', line 2415

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