Class: Basecamp::Types::Folder

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

Overview

Folder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Folder

Returns a new instance of Folder.



1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/basecamp/generated/types.rb', line 1821

def initialize(data = {})
  @bucket_ids = data["bucket_ids"]
  @color = data["color"]
  @created_at = parse_datetime(data["created_at"])
  @gauges_url = data["gauges_url"]
  @id = parse_integer(data["id"])
  @image_url = data["image_url"]
  @is_emoji_only_name = parse_boolean(data["is_emoji_only_name"])
  @name = data["name"]
  @star_url = data["star_url"]
  @type = data["type"]
  @updated_at = parse_datetime(data["updated_at"])
  @url = data["url"]
end

Instance Attribute Details

#bucket_idsObject

Returns the value of attribute bucket_ids.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def bucket_ids
  @bucket_ids
end

#colorObject

Returns the value of attribute color.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def color
  @color
end

#created_atObject

Returns the value of attribute created_at.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def created_at
  @created_at
end

#gauges_urlObject

Returns the value of attribute gauges_url.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def gauges_url
  @gauges_url
end

#idObject

Returns the value of attribute id.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def image_url
  @image_url
end

#is_emoji_only_nameObject

Returns the value of attribute is_emoji_only_name.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def is_emoji_only_name
  @is_emoji_only_name
end

#nameObject

Returns the value of attribute name.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def name
  @name
end

#star_urlObject

Returns the value of attribute star_url.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def star_url
  @star_url
end

#typeObject

Returns the value of attribute type.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



1814
1815
1816
# File 'lib/basecamp/generated/types.rb', line 1814

def url
  @url
end

Class Method Details

.required_fieldsArray<Symbol>

Returns:

  • (Array<Symbol>)


1817
1818
1819
# File 'lib/basecamp/generated/types.rb', line 1817

def self.required_fields
  %i[bucket_ids color created_at gauges_url id image_url is_emoji_only_name name star_url type updated_at url].freeze
end

Instance Method Details

#to_hObject



1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
# File 'lib/basecamp/generated/types.rb', line 1836

def to_h
  {
    "bucket_ids" => @bucket_ids,
    "color" => @color,
    "created_at" => @created_at,
    "gauges_url" => @gauges_url,
    "id" => @id,
    "image_url" => @image_url,
    "is_emoji_only_name" => @is_emoji_only_name,
    "name" => @name,
    "star_url" => @star_url,
    "type" => @type,
    "updated_at" => @updated_at,
    "url" => @url,
  }.reject { |k, v| v.nil? && !["color", "gauges_url", "image_url"].include?(k) }
end

#to_json(*args) ⇒ Object



1853
1854
1855
# File 'lib/basecamp/generated/types.rb', line 1853

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