Class: Basecamp::Types::TodoBucket
- Inherits:
-
Object
- Object
- Basecamp::Types::TodoBucket
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
TodoBucket
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TodoBucket
constructor
A new instance of TodoBucket.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ TodoBucket
Returns a new instance of TodoBucket.
4613 4614 4615 4616 4617 |
# File 'lib/basecamp/generated/types.rb', line 4613 def initialize(data = {}) @id = parse_integer(data["id"]) @name = data["name"] @type = data["type"] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4606 4607 4608 |
# File 'lib/basecamp/generated/types.rb', line 4606 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4606 4607 4608 |
# File 'lib/basecamp/generated/types.rb', line 4606 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
4606 4607 4608 |
# File 'lib/basecamp/generated/types.rb', line 4606 def type @type end |
Class Method Details
.required_fields ⇒ Array<Symbol>
4609 4610 4611 |
# File 'lib/basecamp/generated/types.rb', line 4609 def self.required_fields %i[id name type].freeze end |
Instance Method Details
#to_h ⇒ Object
4619 4620 4621 4622 4623 4624 4625 |
# File 'lib/basecamp/generated/types.rb', line 4619 def to_h { "id" => @id, "name" => @name, "type" => @type, }.compact end |
#to_json(*args) ⇒ Object
4627 4628 4629 |
# File 'lib/basecamp/generated/types.rb', line 4627 def to_json(*args) to_h.to_json(*args) end |