Skip to content

Commit

Permalink
Start of milestones
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercunnion committed Nov 12, 2012
1 parent 5c7ed16 commit e4772d9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/crunchbase.rb
@@ -1,6 +1,7 @@
require 'crunchbase/api'
require 'crunchbase/cb_object'
require 'crunchbase/date_methods'
require 'crunchbase/milestone'
require 'crunchbase/company'
require 'crunchbase/financial_organization'
require 'crunchbase/investment'
Expand Down
24 changes: 24 additions & 0 deletions lib/crunchbase/milestone.rb
@@ -0,0 +1,24 @@
module Crunchbase
class Milestone
attr_reader :description, :source_url, :source_text,
:source_description, :stoneable_type, :stoned_value,
:stoned_value_type, :stoned_acquirer

include Crunchbase::DateMethods

def initialize(obj)
@description = obj['description']
@stoned_year = obj['stoned_year']
@stoned_month = obj['stoned_month']
@stoned_day = obj['stoned_day']
@source_url = obj['source_url']
@source_text = obj['source_text']
@source_description = obj['source_description']
@stoneable_type = obj['stoneable_type']
end

def date
@date ||= date_from_components(@stoned_year, @stoned_month, @stoned_day)
end
end
end

0 comments on commit e4772d9

Please sign in to comment.