Class: Basecamp::Types::BucketTodosGroup

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

Overview

BucketTodosGroup

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ BucketTodosGroup

Returns a new instance of BucketTodosGroup.



346
347
348
349
# File 'lib/basecamp/generated/types.rb', line 346

def initialize(data = {})
  @bucket = parse_type(data["bucket"], "RecordingBucket")
  @todos = parse_array(data["todos"], "Todo")
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



339
340
341
# File 'lib/basecamp/generated/types.rb', line 339

def bucket
  @bucket
end

#todosObject

Returns the value of attribute todos.



339
340
341
# File 'lib/basecamp/generated/types.rb', line 339

def todos
  @todos
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


342
343
344
# File 'lib/basecamp/generated/types.rb', line 342

def self.required_fields
  %i[bucket todos].freeze
end

Instance Method Details

#to_hObject



351
352
353
354
355
356
# File 'lib/basecamp/generated/types.rb', line 351

def to_h
  {
    "bucket" => @bucket,
    "todos" => @todos,
  }.compact
end

#to_json(*args) ⇒ Object



358
359
360
# File 'lib/basecamp/generated/types.rb', line 358

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