Class: IdsPlease

Inherits:
Object
  • Object
show all
Defined in:
lib/ids_please.rb,
lib/ids_please/cli.rb,
lib/ids_please/parsers.rb,
lib/ids_please/version.rb,
lib/ids_please/grabbers.rb,
lib/ids_please/parsers/hi5.rb,
lib/ids_please/parsers/base.rb,
lib/ids_please/grabbers/base.rb,
lib/ids_please/parsers/ameba.rb,
lib/ids_please/parsers/vimeo.rb,
lib/ids_please/parsers/mailru.rb,
lib/ids_please/parsers/reddit.rb,
lib/ids_please/parsers/tumblr.rb,
lib/ids_please/grabbers/mailru.rb,
lib/ids_please/parsers/blogger.rb,
lib/ids_please/parsers/moikrug.rb,
lib/ids_please/parsers/twitter.rb,
lib/ids_please/parsers/youtube.rb,
lib/ids_please/grabbers/twitter.rb,
lib/ids_please/parsers/facebook.rb,
lib/ids_please/parsers/linkedin.rb,
lib/ids_please/grabbers/facebook.rb,
lib/ids_please/parsers/instagram.rb,
lib/ids_please/parsers/pinterest.rb,
lib/ids_please/parsers/vkontakte.rb,
lib/ids_please/grabbers/instagram.rb,
lib/ids_please/grabbers/vkontakte.rb,
lib/ids_please/parsers/soundcloud.rb,
lib/ids_please/parsers/google_plus.rb,
lib/ids_please/parsers/livejournal.rb,
lib/ids_please/grabbers/google_plus.rb,
lib/ids_please/parsers/odnoklassniki.rb

Defined Under Namespace

Modules: CLI, Grabbers, Parsers

Constant Summary collapse

VERSION =
'2.3.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ IdsPlease

Returns a new instance of IdsPlease.



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

def initialize(*args)
  @original = args.flatten.dup
end

Instance Attribute Details

#grabbedObject

Returns the value of attribute grabbed.



16
17
18
# File 'lib/ids_please.rb', line 16

def grabbed
  @grabbed
end

#originalObject

Returns the value of attribute original.



16
17
18
# File 'lib/ids_please.rb', line 16

def original
  @original
end

#parsedObject

Returns the value of attribute parsed.



16
17
18
# File 'lib/ids_please.rb', line 16

def parsed
  @parsed
end

#unrecognizedObject

Returns the value of attribute unrecognized.



16
17
18
# File 'lib/ids_please.rb', line 16

def unrecognized
  @unrecognized
end

Class Method Details

.grabbersObject



12
13
14
# File 'lib/ids_please.rb', line 12

def self.grabbers
  IdsPlease::Grabbers
end

.parsersObject



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

def self.parsers
  IdsPlease::Parsers
end

Instance Method Details

#grabObject



36
37
38
# File 'lib/ids_please.rb', line 36

def grab
  interact(:grabbers)
end

#parseObject



32
33
34
# File 'lib/ids_please.rb', line 32

def parse
  interact(:parsers)
end

#recognizeObject



22
23
24
25
26
# File 'lib/ids_please.rb', line 22

def recognize
  @recognized = {}
  @unrecognized = []
  original.each { |l| recognize_link(l) }
end

#recognizedObject



28
29
30
# File 'lib/ids_please.rb', line 28

def recognized
  Hash[@recognized.map { |parser, links| [parser.to_sym, links] }]
end