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.



4000
4001
4002
4003
4004
# File 'lib/basecamp/generated/types.rb', line 4000

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.



3993
3994
3995
# File 'lib/basecamp/generated/types.rb', line 3993

def id
  @id
end

#nameObject

Returns the value of attribute name.



3993
3994
3995
# File 'lib/basecamp/generated/types.rb', line 3993

def name
  @name
end

#typeObject

Returns the value of attribute type.



3993
3994
3995
# File 'lib/basecamp/generated/types.rb', line 3993

def type
  @type
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3996
3997
3998
# File 'lib/basecamp/generated/types.rb', line 3996

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

Instance Method Details

#to_hObject



4006
4007
4008
4009
4010
4011
4012
# File 'lib/basecamp/generated/types.rb', line 4006

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

#to_json(*args) ⇒ Object



4014
4015
4016
# File 'lib/basecamp/generated/types.rb', line 4014

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