Class: Basecamp::Types::Tool

Inherits:
Object
  • Object
show all
Includes:
TypeHelpers
Defined in:
lib/basecamp/generated/types.rb

Overview

Tool

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Tool

Returns a new instance of Tool.



4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
# File 'lib/basecamp/generated/types.rb', line 4285

def initialize(data = {})
  @created_at = parse_datetime(data["created_at"])
  @enabled = parse_boolean(data["enabled"])
  @id = parse_integer(data["id"])
  @name = data["name"]
  @title = data["title"]
  @updated_at = parse_datetime(data["updated_at"])
  @app_url = data["app_url"]
  @bucket = parse_type(data["bucket"], "RecordingBucket")
  @position = parse_integer(data["position"])
  @status = data["status"]
  @url = data["url"]
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def app_url
  @app_url
end

#bucketObject

Returns the value of attribute bucket.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def bucket
  @bucket
end

#created_atObject

Returns the value of attribute created_at.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def created_at
  @created_at
end

#enabledObject

Returns the value of attribute enabled.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def id
  @id
end

#nameObject

Returns the value of attribute name.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def name
  @name
end

#positionObject

Returns the value of attribute position.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def position
  @position
end

#statusObject

Returns the value of attribute status.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def status
  @status
end

#titleObject

Returns the value of attribute title.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4278

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4281
4282
4283
# File 'lib/basecamp/generated/types.rb', line 4281

def self.required_fields
  %i[created_at enabled id name title updated_at].freeze
end

Instance Method Details

#to_hObject



4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
# File 'lib/basecamp/generated/types.rb', line 4299

def to_h
  {
    "created_at" => @created_at,
    "enabled" => @enabled,
    "id" => @id,
    "name" => @name,
    "title" => @title,
    "updated_at" => @updated_at,
    "app_url" => @app_url,
    "bucket" => @bucket,
    "position" => @position,
    "status" => @status,
    "url" => @url,
  }.compact
end

#to_json(*args) ⇒ Object



4315
4316
4317
# File 'lib/basecamp/generated/types.rb', line 4315

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