Class: Basecamp::Types::Assignable
- Inherits:
-
Object
- Object
- Basecamp::Types::Assignable
- Includes:
- TypeHelpers
- Defined in:
- lib/basecamp/generated/types.rb
Overview
Assignable
Instance Attribute Summary collapse
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#assignees ⇒ Object
Returns the value of attribute assignees.
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#due_on ⇒ Object
Returns the value of attribute due_on.
-
#id ⇒ Object
Returns the value of attribute id.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#starts_on ⇒ Object
Returns the value of attribute starts_on.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Assignable
constructor
A new instance of Assignable.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Assignable
Returns a new instance of Assignable.
225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/basecamp/generated/types.rb', line 225 def initialize(data = {}) @app_url = data["app_url"] @assignees = parse_array(data["assignees"], "Person") @bucket = parse_type(data["bucket"], "TodoBucket") @due_on = data["due_on"] @id = parse_integer(data["id"]) @parent = parse_type(data["parent"], "TodoParent") @starts_on = data["starts_on"] @title = data["title"] @type = data["type"] @url = data["url"] end |
Instance Attribute Details
#app_url ⇒ Object
Returns the value of attribute app_url.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def app_url @app_url end |
#assignees ⇒ Object
Returns the value of attribute assignees.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def assignees @assignees end |
#bucket ⇒ Object
Returns the value of attribute bucket.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def bucket @bucket end |
#due_on ⇒ Object
Returns the value of attribute due_on.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def due_on @due_on end |
#id ⇒ Object
Returns the value of attribute id.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def id @id end |
#parent ⇒ Object
Returns the value of attribute parent.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def parent @parent end |
#starts_on ⇒ Object
Returns the value of attribute starts_on.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def starts_on @starts_on end |
#title ⇒ Object
Returns the value of attribute title.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
223 224 225 |
# File 'lib/basecamp/generated/types.rb', line 223 def url @url end |
Instance Method Details
#to_h ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/basecamp/generated/types.rb', line 238 def to_h { "app_url" => @app_url, "assignees" => @assignees, "bucket" => @bucket, "due_on" => @due_on, "id" => @id, "parent" => @parent, "starts_on" => @starts_on, "title" => @title, "type" => @type, "url" => @url, }.compact end |
#to_json(*args) ⇒ Object
253 254 255 |
# File 'lib/basecamp/generated/types.rb', line 253 def to_json(*args) to_h.to_json(*args) end |