Class: IdsPlease
- Inherits:
-
Object
- Object
- IdsPlease
- 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
-
#grabbed ⇒ Object
Returns the value of attribute grabbed.
-
#original ⇒ Object
Returns the value of attribute original.
-
#parsed ⇒ Object
Returns the value of attribute parsed.
-
#unrecognized ⇒ Object
Returns the value of attribute unrecognized.
Class Method Summary collapse
Instance Method Summary collapse
- #grab ⇒ Object
-
#initialize(*args) ⇒ IdsPlease
constructor
A new instance of IdsPlease.
- #parse ⇒ Object
- #recognize ⇒ Object
- #recognized ⇒ Object
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
#grabbed ⇒ Object
Returns the value of attribute grabbed.
16 17 18 |
# File 'lib/ids_please.rb', line 16 def grabbed @grabbed end |
#original ⇒ Object
Returns the value of attribute original.
16 17 18 |
# File 'lib/ids_please.rb', line 16 def original @original end |
#parsed ⇒ Object
Returns the value of attribute parsed.
16 17 18 |
# File 'lib/ids_please.rb', line 16 def parsed @parsed end |
#unrecognized ⇒ Object
Returns the value of attribute unrecognized.
16 17 18 |
# File 'lib/ids_please.rb', line 16 def unrecognized @unrecognized end |
Class Method Details
Instance Method Details
#grab ⇒ Object
36 37 38 |
# File 'lib/ids_please.rb', line 36 def grab interact(:grabbers) end |
#parse ⇒ Object
32 33 34 |
# File 'lib/ids_please.rb', line 32 def parse interact(:parsers) end |
#recognize ⇒ Object
22 23 24 25 26 |
# File 'lib/ids_please.rb', line 22 def recognize @recognized = {} @unrecognized = [] original.each { |l| recognize_link(l) } end |
#recognized ⇒ Object
28 29 30 |
# File 'lib/ids_please.rb', line 28 def recognized Hash[@recognized.map { |parser, links| [parser.to_sym, links] }] end |