Class: Crunchbase::FundingRound

Inherits:
Object
  • Object
show all
Defined in:
lib/crunchbase/funding_round.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, meta) ⇒ FundingRound

Returns a new instance of FundingRound.



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

def initialize(data, meta)
  @mash = data
  self. = meta
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object



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

def method_missing(method_sym, *arguments, &block)
  @mash.send(method_sym, *arguments)
end

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata.



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

def 
  
end

Class Method Details

.find(uuid) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/crunchbase/funding_round.rb', line 19

def self.find(uuid)
  response = Faraday.get("#{Crunchbase.config.host}/#{Crunchbase.config.api_version_prefix}/funding-round/#{uuid}", user_key: Crunchbase.config.user_key)

  raise "Error" if response.status != 200

  raw = Hashie::Mash.new(JSON.parse(response.body))
  new(raw.data, raw.)
rescue
  nil
end