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.



2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
# File 'lib/basecamp/generated/types.rb', line 2630

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.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def app_url
  @app_url
end

#content_typeObject

Returns the value of attribute content_type.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def content_type
  @content_type
end

#filenameObject

Returns the value of attribute filename.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def filename
  @filename
end

#filesizeObject

Returns the value of attribute filesize.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def filesize
  @filesize
end

#heightObject

Returns the value of attribute height.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def height
  @height
end

#idObject

Returns the value of attribute id.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def id
  @id
end

#urlObject

Returns the value of attribute url.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def url
  @url
end

#widthObject

Returns the value of attribute width.



2628
2629
2630
# File 'lib/basecamp/generated/types.rb', line 2628

def width
  @width
end

Instance Method Details

#to_hObject



2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
# File 'lib/basecamp/generated/types.rb', line 2641

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



2654
2655
2656
# File 'lib/basecamp/generated/types.rb', line 2654

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