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.



3615
3616
3617
3618
3619
# File 'lib/basecamp/generated/types.rb', line 3615

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.



3608
3609
3610
# File 'lib/basecamp/generated/types.rb', line 3608

def id
  @id
end

#nameObject

Returns the value of attribute name.



3608
3609
3610
# File 'lib/basecamp/generated/types.rb', line 3608

def name
  @name
end

#typeObject

Returns the value of attribute type.



3608
3609
3610
# File 'lib/basecamp/generated/types.rb', line 3608

def type
  @type
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3611
3612
3613
# File 'lib/basecamp/generated/types.rb', line 3611

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

Instance Method Details

#to_hObject



3621
3622
3623
3624
3625
3626
3627
# File 'lib/basecamp/generated/types.rb', line 3621

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

#to_json(*args) ⇒ Object



3629
3630
3631
# File 'lib/basecamp/generated/types.rb', line 3629

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