Class: Basecamp::Types::Event

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

Overview

Event

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Event

Returns a new instance of Event.



1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
# File 'lib/basecamp/generated/types.rb', line 1282

def initialize(data = {})
  @action = data["action"]
  @created_at = parse_datetime(data["created_at"])
  @creator = parse_type(data["creator"], "Person")
  @id = parse_integer(data["id"])
  @recording_id = parse_integer(data["recording_id"])
  @boosts_count = parse_integer(data["boosts_count"])
  @boosts_url = data["boosts_url"]
  @details = parse_type(data["details"], "EventDetails")
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def action
  @action
end

#boosts_countObject

Returns the value of attribute boosts_count.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def boosts_count
  @boosts_count
end

#boosts_urlObject

Returns the value of attribute boosts_url.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def boosts_url
  @boosts_url
end

#created_atObject

Returns the value of attribute created_at.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def created_at
  @created_at
end

#creatorObject

Returns the value of attribute creator.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def creator
  @creator
end

#detailsObject

Returns the value of attribute details.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def details
  @details
end

#idObject

Returns the value of attribute id.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def id
  @id
end

#recording_idObject

Returns the value of attribute recording_id.



1275
1276
1277
# File 'lib/basecamp/generated/types.rb', line 1275

def recording_id
  @recording_id
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1278
1279
1280
# File 'lib/basecamp/generated/types.rb', line 1278

def self.required_fields
  %i[action created_at creator id recording_id].freeze
end

Instance Method Details

#to_hObject



1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
# File 'lib/basecamp/generated/types.rb', line 1293

def to_h
  {
    "action" => @action,
    "created_at" => @created_at,
    "creator" => @creator,
    "id" => @id,
    "recording_id" => @recording_id,
    "boosts_count" => @boosts_count,
    "boosts_url" => @boosts_url,
    "details" => @details,
  }.compact
end

#to_json(*args) ⇒ Object



1306
1307
1308
# File 'lib/basecamp/generated/types.rb', line 1306

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