Class: Basecamp::Types::Assignable

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

Overview

Assignable

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject

Returns the value of attribute app_url.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def app_url
  @app_url
end

#assigneesObject

Returns the value of attribute assignees.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def assignees
  @assignees
end

#bucketObject

Returns the value of attribute bucket.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def bucket
  @bucket
end

#due_onObject

Returns the value of attribute due_on.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def due_on
  @due_on
end

#idObject

Returns the value of attribute id.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def id
  @id
end

#parentObject

Returns the value of attribute parent.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def parent
  @parent
end

#starts_onObject

Returns the value of attribute starts_on.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def starts_on
  @starts_on
end

#titleObject

Returns the value of attribute title.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def title
  @title
end

#typeObject

Returns the value of attribute type.



223
224
225
# File 'lib/basecamp/generated/types.rb', line 223

def type
  @type
end

#urlObject

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_hObject



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