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.



3967
3968
3969
3970
3971
# File 'lib/basecamp/generated/types.rb', line 3967

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.



3960
3961
3962
# File 'lib/basecamp/generated/types.rb', line 3960

def id
  @id
end

#nameObject

Returns the value of attribute name.



3960
3961
3962
# File 'lib/basecamp/generated/types.rb', line 3960

def name
  @name
end

#typeObject

Returns the value of attribute type.



3960
3961
3962
# File 'lib/basecamp/generated/types.rb', line 3960

def type
  @type
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3963
3964
3965
# File 'lib/basecamp/generated/types.rb', line 3963

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

Instance Method Details

#to_hObject



3973
3974
3975
3976
3977
3978
3979
# File 'lib/basecamp/generated/types.rb', line 3973

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

#to_json(*args) ⇒ Object



3981
3982
3983
# File 'lib/basecamp/generated/types.rb', line 3981

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