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.



328
329
330
331
# File 'lib/basecamp/generated/types.rb', line 328

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.



321
322
323
# File 'lib/basecamp/generated/types.rb', line 321

def bucket
  @bucket
end

#todosObject

Returns the value of attribute todos.



321
322
323
# File 'lib/basecamp/generated/types.rb', line 321

def todos
  @todos
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


324
325
326
# File 'lib/basecamp/generated/types.rb', line 324

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

Instance Method Details

#to_hObject



333
334
335
336
337
338
# File 'lib/basecamp/generated/types.rb', line 333

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

#to_json(*args) ⇒ Object



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

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