Class: Crunchbase::Model::Membership

Inherits:
Organization show all
Defined in:
lib/crunchbase/model/membership.rb

Constant Summary collapse

RESOURCE_LIST =
'memberships'

Instance Attribute Summary collapse

Attributes inherited from Organization

#acquired_by, #acquired_by_total_items, #acquisitions, #acquisitions_total_items, #also_known_as, #api_path, #board_members_and_advisors, #board_members_and_advisors_total_items, #categories, #categories_total_items, #closed_on, #closed_on_trust_code, #competitors, #competitors_total_items, #created_at, #current_team, #current_team_total_items, #customers, #customers_total_items, #description, #founded_on, #founded_on_trust_code, #founders, #founders_total_items, #funding_rounds, #funding_rounds_total_items, #funds, #funds_total_items, #headquarters, #headquarters_total_items, #homepage_url, #images, #images_total_items, #investments, #investments_total_items, #investors, #investors_total_items, #ipo, #ipo_total_items, #is_closed, #members, #members_total_items, #memberships, #memberships_total_items, #name, #news, #news_total_items, #num_employees_max, #num_employees_min, #number_of_investments, #offices, #offices_total_items, #owned_by, #owned_by_total_items, #past_team, #past_team_total_items, #permalink, #primary_image, #primary_image_total_items, #primary_role, #products, #products_total_items, #role_company, #role_group, #role_investor, #role_school, #short_description, #stock_exchange, #stock_symbol, #sub_organizations, #sub_organizations_total_items, #total_funding_usd, #updated_at, #videos, #videos_total_items, #web_path, #websites, #websites_total_items

Attributes inherited from Entity

#type_name, #uuid

Instance Method Summary collapse

Methods inherited from Organization

#date_keys, #property_keys

Methods inherited from Entity

array_from_list, #fetch, funding_rounds_lists, get, list, organization_lists, parsing_from_list, person_lists, total_items_from_list

Constructor Details

#initialize(json) ⇒ Membership

Returns a new instance of Membership.



10
11
12
13
# File 'lib/crunchbase/model/membership.rb', line 10

def initialize(json)
  instance_relationships_object(Crunchbase::Model::Person, 'object', json) if json['type'] == 'Person'
  instance_relationships_object(Crunchbase::Model::Organization, 'object', json) if json['type'] == 'Organization'
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



8
9
10
# File 'lib/crunchbase/model/membership.rb', line 8

def object
  @object
end

Instance Method Details

#organization?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/crunchbase/model/membership.rb', line 19

def organization?
  (object.type_name == "Organization")
end

#person?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/crunchbase/model/membership.rb', line 15

def person?
  (object.type_name == "Person")
end