Class: Basecamp::Types::MyNote

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

Overview

MyNote

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ MyNote

Returns a new instance of MyNote.



2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
# File 'lib/basecamp/generated/types.rb', line 2540

def initialize(data = {})
  @app_url = data["app_url"]
  @content = data["content"]
  @content_attachments = parse_array(data["content_attachments"], "RichTextAttachment")
  @created_at = data["created_at"]
  @id = data["id"]
  @type = data["type"]
  @updated_at = data["updated_at"]
  @url = data["url"]
end

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def app_url
  @app_url
end

#contentObject

Returns the value of attribute content.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def content
  @content
end

#content_attachmentsObject

Returns the value of attribute content_attachments.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def content_attachments
  @content_attachments
end

#created_atObject

Returns the value of attribute created_at.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def id
  @id
end

#typeObject

Returns the value of attribute type.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



2533
2534
2535
# File 'lib/basecamp/generated/types.rb', line 2533

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2536
2537
2538
# File 'lib/basecamp/generated/types.rb', line 2536

def self.required_fields
  %i[app_url content content_attachments created_at id type updated_at url].freeze
end

Instance Method Details

#to_hObject



2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
# File 'lib/basecamp/generated/types.rb', line 2551

def to_h
  {
    "app_url" => @app_url,
    "content" => @content,
    "content_attachments" => @content_attachments,
    "created_at" => @created_at,
    "id" => @id,
    "type" => @type,
    "updated_at" => @updated_at,
    "url" => @url,
  }.reject { |k, v| v.nil? && !["created_at", "id", "updated_at"].include?(k) }
end

#to_json(*args) ⇒ Object



2564
2565
2566
# File 'lib/basecamp/generated/types.rb', line 2564

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