Sha256: 1b4f71bf4dfb4e5fe1b110ed27c05938ac8a48449dedb6d4bc3344b4f48971d7

Contents?: true

Size: 534 Bytes

Versions: 1

Compression:

Stored size: 534 Bytes

Contents

# encoding: utf-8

module Crunchbase::Model
  class CurrentTeam < Crunchbase::Model::Job

    RESOURCE_LIST = 'current_team'

    attr_reader :person

    def initialize(json)
      super

      unless (relationships = json['relationships']).nil?
        set_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
      end
    end

    def set_relationships_object(object_name, key, item)
      return unless item

      instance_variable_set "@#{key}", ( object_name.new(item) || nil )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crunchbase-ruby-library-0.0.1 lib/crunchbase/model/current_team.rb