Class: Basecamp::Types::MyNote
- Inherits:
-
Object
- Object
- Basecamp::Types::MyNote
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
MyNote
Instance Attribute Summary collapse
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_attachments ⇒ Object
Returns the value of attribute content_attachments.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ MyNote
constructor
A new instance of MyNote.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
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_url ⇒ Object
Returns the value of attribute app_url.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def app_url @app_url end |
#content ⇒ Object
Returns the value of attribute content.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def content @content end |
#content_attachments ⇒ Object
Returns the value of attribute content_attachments.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def @content_attachments end |
#created_at ⇒ Object
Returns the value of attribute created_at.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def type @type end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
2762 2763 2764 |
# File 'lib/basecamp/generated/types.rb', line 2762 def updated_at @updated_at end |
#url ⇒ Object
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_fields ⇒ 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_h ⇒ Object
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 |