Class: Basecamp::Types::SearchResultAttachment

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

Overview

SearchResultAttachment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ SearchResultAttachment

Returns a new instance of SearchResultAttachment.



4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
# File 'lib/basecamp/generated/types.rb', line 4154

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

Instance Attribute Details

#byte_sizeObject

Returns the value of attribute byte_size.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def byte_size
  @byte_size
end

#content_typeObject

Returns the value of attribute content_type.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def content_type
  @content_type
end

#download_urlObject

Returns the value of attribute download_url.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def download_url
  @download_url
end

#filenameObject

Returns the value of attribute filename.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def height
  @height
end

#idObject

Returns the value of attribute id.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def id
  @id
end

#preview_urlObject

Returns the value of attribute preview_url.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def preview_url
  @preview_url
end

#previewableObject

Returns the value of attribute previewable.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def previewable
  @previewable
end

#sgidObject

Returns the value of attribute sgid.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def sgid
  @sgid
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def thumbnail_url
  @thumbnail_url
end

#titleObject

Returns the value of attribute title.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def title
  @title
end

#urlObject

Returns the value of attribute url.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def url
  @url
end

#widthObject

Returns the value of attribute width.



4147
4148
4149
# File 'lib/basecamp/generated/types.rb', line 4147

def width
  @width
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


4150
4151
4152
# File 'lib/basecamp/generated/types.rb', line 4150

def self.required_fields
  %i[byte_size content_type download_url filename].freeze
end

Instance Method Details

#to_hObject



4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
# File 'lib/basecamp/generated/types.rb', line 4170

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

#to_json(*args) ⇒ Object



4188
4189
4190
# File 'lib/basecamp/generated/types.rb', line 4188

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