Class: Basecamp::Types::RichTextAttachment

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

Overview

RichTextAttachment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ RichTextAttachment

Returns a new instance of RichTextAttachment.



3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
# File 'lib/basecamp/generated/types.rb', line 3035

def initialize(data = {})
  @byte_size = parse_integer(data["byte_size"])
  @content_type = data["content_type"]
  @download_url = data["download_url"]
  @filename = data["filename"]
  @id = parse_integer(data["id"])
  @preview_url = data["preview_url"]
  @previewable = parse_boolean(data["previewable"])
  @sgid = data["sgid"]
  @thumbnail_url = data["thumbnail_url"]
  @height = parse_integer(data["height"])
  @width = parse_integer(data["width"])
end

Instance Attribute Details

#byte_sizeObject

Returns the value of attribute byte_size.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def byte_size
  @byte_size
end

#content_typeObject

Returns the value of attribute content_type.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def content_type
  @content_type
end

#download_urlObject

Returns the value of attribute download_url.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def download_url
  @download_url
end

#filenameObject

Returns the value of attribute filename.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def height
  @height
end

#idObject

Returns the value of attribute id.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def id
  @id
end

#preview_urlObject

Returns the value of attribute preview_url.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def preview_url
  @preview_url
end

#previewableObject

Returns the value of attribute previewable.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def previewable
  @previewable
end

#sgidObject

Returns the value of attribute sgid.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def sgid
  @sgid
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def thumbnail_url
  @thumbnail_url
end

#widthObject

Returns the value of attribute width.



3028
3029
3030
# File 'lib/basecamp/generated/types.rb', line 3028

def width
  @width
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


3031
3032
3033
# File 'lib/basecamp/generated/types.rb', line 3031

def self.required_fields
  %i[byte_size content_type download_url filename id preview_url previewable sgid thumbnail_url].freeze
end

Instance Method Details

#to_hObject



3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
# File 'lib/basecamp/generated/types.rb', line 3049

def to_h
  {
    "byte_size" => @byte_size,
    "content_type" => @content_type,
    "download_url" => @download_url,
    "filename" => @filename,
    "id" => @id,
    "preview_url" => @preview_url,
    "previewable" => @previewable,
    "sgid" => @sgid,
    "thumbnail_url" => @thumbnail_url,
    "height" => @height,
    "width" => @width,
  }.compact
end

#to_json(*args) ⇒ Object



3065
3066
3067
# File 'lib/basecamp/generated/types.rb', line 3065

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