Class: Basecamp::Types::Draft
- Inherits:
-
Object
- Object
- Basecamp::Types::Draft
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
Draft
Instance Attribute Summary collapse
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#excerpt ⇒ Object
Returns the value of attribute excerpt.
-
#id ⇒ Object
Returns the value of attribute id.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#scheduled_posting_at ⇒ Object
Returns the value of attribute scheduled_posting_at.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Draft
constructor
A new instance of Draft.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Draft
Returns a new instance of Draft.
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 |
# File 'lib/basecamp/generated/types.rb', line 1486 def initialize(data = {}) @app_url = data["app_url"] @bucket = parse_type(data["bucket"], "DraftBucket") @created_at = parse_datetime(data["created_at"]) @excerpt = data["excerpt"] @id = parse_integer(data["id"]) @parent = data["parent"] @scheduled_posting_at = data["scheduled_posting_at"] @title = data["title"] @type = data["type"] @updated_at = parse_datetime(data["updated_at"]) end |
Instance Attribute Details
#app_url ⇒ Object
Returns the value of attribute app_url.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def app_url @app_url end |
#bucket ⇒ Object
Returns the value of attribute bucket.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def bucket @bucket end |
#created_at ⇒ Object
Returns the value of attribute created_at.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def created_at @created_at end |
#excerpt ⇒ Object
Returns the value of attribute excerpt.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def excerpt @excerpt end |
#id ⇒ Object
Returns the value of attribute id.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def id @id end |
#parent ⇒ Object
Returns the value of attribute parent.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def parent @parent end |
#scheduled_posting_at ⇒ Object
Returns the value of attribute scheduled_posting_at.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def scheduled_posting_at @scheduled_posting_at end |
#title ⇒ Object
Returns the value of attribute title.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def type @type end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
1479 1480 1481 |
# File 'lib/basecamp/generated/types.rb', line 1479 def updated_at @updated_at end |
Class Method Details
.required_fields ⇒ Array<Symbol>
1482 1483 1484 |
# File 'lib/basecamp/generated/types.rb', line 1482 def self.required_fields %i[app_url bucket created_at excerpt id parent scheduled_posting_at title type updated_at].freeze end |
Instance Method Details
#to_h ⇒ Object
1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 |
# File 'lib/basecamp/generated/types.rb', line 1499 def to_h { "app_url" => @app_url, "bucket" => @bucket, "created_at" => @created_at, "excerpt" => @excerpt, "id" => @id, "parent" => @parent, "scheduled_posting_at" => @scheduled_posting_at, "title" => @title, "type" => @type, "updated_at" => @updated_at, }.reject { |k, v| v.nil? && !["scheduled_posting_at"].include?(k) } end |
#to_json(*args) ⇒ Object
1514 1515 1516 |
# File 'lib/basecamp/generated/types.rb', line 1514 def to_json(*args) to_h.to_json(*args) end |