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.



2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
# File 'lib/basecamp/generated/types.rb', line 2769

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

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def app_url
  @app_url
end

#contentObject

Returns the value of attribute content.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def content
  @content
end

#content_attachmentsObject

Returns the value of attribute content_attachments.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def content_attachments
  @content_attachments
end

#created_atObject

Returns the value of attribute created_at.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def id
  @id
end

#typeObject

Returns the value of attribute type.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



2762
2763
2764
# File 'lib/basecamp/generated/types.rb', line 2762

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


2765
2766
2767
# File 'lib/basecamp/generated/types.rb', line 2765

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

Instance Method Details

#to_hObject



2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
# File 'lib/basecamp/generated/types.rb', line 2780

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



2793
2794
2795
# File 'lib/basecamp/generated/types.rb', line 2793

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