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.



4512
4513
4514
4515
4516
# File 'lib/basecamp/generated/types.rb', line 4512

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.



4505
4506
4507
# File 'lib/basecamp/generated/types.rb', line 4505

def id
  @id
end

#nameObject

Returns the value of attribute name.



4505
4506
4507
# File 'lib/basecamp/generated/types.rb', line 4505

def name
  @name
end

#typeObject

Returns the value of attribute type.



4505
4506
4507
# File 'lib/basecamp/generated/types.rb', line 4505

def type
  @type
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4508
4509
4510
# File 'lib/basecamp/generated/types.rb', line 4508

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

Instance Method Details

#to_hObject



4518
4519
4520
4521
4522
4523
4524
# File 'lib/basecamp/generated/types.rb', line 4518

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

#to_json(*args) ⇒ Object



4526
4527
4528
# File 'lib/basecamp/generated/types.rb', line 4526

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