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.



4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
# File 'lib/basecamp/generated/types.rb', line 4252

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.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def app_url
  @app_url
end

#bucketObject

Returns the value of attribute bucket.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def bucket
  @bucket
end

#created_atObject

Returns the value of attribute created_at.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def created_at
  @created_at
end

#enabledObject

Returns the value of attribute enabled.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def id
  @id
end

#nameObject

Returns the value of attribute name.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def name
  @name
end

#positionObject

Returns the value of attribute position.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def position
  @position
end

#statusObject

Returns the value of attribute status.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def status
  @status
end

#titleObject

Returns the value of attribute title.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



4245
4246
4247
# File 'lib/basecamp/generated/types.rb', line 4245

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4248
4249
4250
# File 'lib/basecamp/generated/types.rb', line 4248

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

Instance Method Details

#to_hObject



4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
# File 'lib/basecamp/generated/types.rb', line 4266

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



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

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