Class: Basecamp::Types::PreviewableAttachment

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

Overview

PreviewableAttachment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ PreviewableAttachment

Returns a new instance of PreviewableAttachment.



2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
# File 'lib/basecamp/generated/types.rb', line 2433

def initialize(data = {})
  @app_url = data["app_url"]
  @content_type = data["content_type"]
  @filename = data["filename"]
  @filesize = parse_integer(data["filesize"])
  @height = parse_integer(data["height"])
  @id = parse_integer(data["id"])
  @url = data["url"]
  @width = parse_integer(data["width"])
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def app_url
  @app_url
end

#content_typeObject

Returns the value of attribute content_type.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def content_type
  @content_type
end

#filenameObject

Returns the value of attribute filename.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def filename
  @filename
end

#filesizeObject

Returns the value of attribute filesize.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def filesize
  @filesize
end

#heightObject

Returns the value of attribute height.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def height
  @height
end

#idObject

Returns the value of attribute id.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def id
  @id
end

#urlObject

Returns the value of attribute url.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def url
  @url
end

#widthObject

Returns the value of attribute width.



2431
2432
2433
# File 'lib/basecamp/generated/types.rb', line 2431

def width
  @width
end

Instance Method Details

#to_hObject



2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
# File 'lib/basecamp/generated/types.rb', line 2444

def to_h
  {
    "app_url" => @app_url,
    "content_type" => @content_type,
    "filename" => @filename,
    "filesize" => @filesize,
    "height" => @height,
    "id" => @id,
    "url" => @url,
    "width" => @width,
  }.compact
end

#to_json(*args) ⇒ Object



2457
2458
2459
# File 'lib/basecamp/generated/types.rb', line 2457

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