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.



3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
# File 'lib/basecamp/generated/types.rb', line 3896

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.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def app_url
  @app_url
end

#bucketObject

Returns the value of attribute bucket.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def bucket
  @bucket
end

#created_atObject

Returns the value of attribute created_at.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def created_at
  @created_at
end

#enabledObject

Returns the value of attribute enabled.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def id
  @id
end

#nameObject

Returns the value of attribute name.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def name
  @name
end

#positionObject

Returns the value of attribute position.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def position
  @position
end

#statusObject

Returns the value of attribute status.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def status
  @status
end

#titleObject

Returns the value of attribute title.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



3889
3890
3891
# File 'lib/basecamp/generated/types.rb', line 3889

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3892
3893
3894
# File 'lib/basecamp/generated/types.rb', line 3892

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

Instance Method Details

#to_hObject



3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
# File 'lib/basecamp/generated/types.rb', line 3910

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



3926
3927
3928
# File 'lib/basecamp/generated/types.rb', line 3926

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