Class: Basecamp::Types::TodoBucket

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

Overview

TodoBucket

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ TodoBucket

Returns a new instance of TodoBucket.



4279
4280
4281
4282
4283
# File 'lib/basecamp/generated/types.rb', line 4279

def initialize(data = {})
  @id = parse_integer(data["id"])
  @name = data["name"]
  @type = data["type"]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



4272
4273
4274
# File 'lib/basecamp/generated/types.rb', line 4272

def id
  @id
end

#nameObject

Returns the value of attribute name.



4272
4273
4274
# File 'lib/basecamp/generated/types.rb', line 4272

def name
  @name
end

#typeObject

Returns the value of attribute type.



4272
4273
4274
# File 'lib/basecamp/generated/types.rb', line 4272

def type
  @type
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4275
4276
4277
# File 'lib/basecamp/generated/types.rb', line 4275

def self.required_fields
  %i[id name type].freeze
end

Instance Method Details

#to_hObject



4285
4286
4287
4288
4289
4290
4291
# File 'lib/basecamp/generated/types.rb', line 4285

def to_h
  {
    "id" => @id,
    "name" => @name,
    "type" => @type,
  }.compact
end

#to_json(*args) ⇒ Object



4293
4294
4295
# File 'lib/basecamp/generated/types.rb', line 4293

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