Class: SecEdgar::PollFiling

Inherits:
Struct
  • Object
show all
Defined in:
lib/sec_edgar/poll.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cikObject

Returns the value of attribute cik

Returns:

  • (Object)

    the current value of cik



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def cik
  @cik
end

#clientObject

Returns the value of attribute client

Returns:

  • (Object)

    the current value of client



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def client
  @client
end

#company_nameObject

Returns the value of attribute company_name

Returns:

  • (Object)

    the current value of company_name



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def company_name
  @company_name
end

#date_strObject

Returns the value of attribute date_str

Returns:

  • (Object)

    the current value of date_str



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def date_str
  @date_str
end

#file_idObject

Returns the value of attribute file_id

Returns:

  • (Object)

    the current value of file_id



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def file_id
  @file_id
end

Returns the value of attribute ftp_link

Returns:

  • (Object)

    the current value of ftp_link



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def ftp_link
  @ftp_link
end

#termObject

Returns the value of attribute term

Returns:

  • (Object)

    the current value of term



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def term
  @term
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def title
  @title
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/sec_edgar/poll.rb', line 4

def type
  @type
end

Instance Method Details

#content(&error_blk) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/sec_edgar/poll.rb', line 22

def content(&error_blk)
  @content ||= client.fetch(ftp_link, nil)
rescue RestClient::ResourceNotFound => e
  puts "404 Resource Not Found: Bad link #{ self.link }"
  if block_given?
    error_blk.call(e, self)
  else
    raise e
  end
end

#dateObject



14
15
16
# File 'lib/sec_edgar/poll.rb', line 14

def date
  Date.parse(date_str)
end


18
19
20
# File 'lib/sec_edgar/poll.rb', line 18

def link
  "http://www.sec.gov/Archives/#{ ftp_link }"
end