Class: XxxRename::FetchActorDetails
- Inherits:
-
Object
- Object
- XxxRename::FetchActorDetails
- Defined in:
- lib/xxx_rename/actors_helper.rb
Instance Method Summary collapse
-
#details(actor) ⇒ nil, Hash
Hash of details or nil if not found.
-
#initialize(matcher) ⇒ FetchActorDetails
constructor
A new instance of FetchActorDetails.
Constructor Details
#initialize(matcher) ⇒ FetchActorDetails
Returns a new instance of FetchActorDetails.
82 83 84 |
# File 'lib/xxx_rename/actors_helper.rb', line 82 def initialize(matcher) @matcher = matcher end |
Instance Method Details
#details(actor) ⇒ nil, Hash
Returns Hash of details or nil if not found.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/xxx_rename/actors_helper.rb', line 88 def details(actor) clients.each do |client| details = client.actor_details(actor) next if details.nil? XxxRename.logger.debug "#{client.class.name.split("::").last} matched actor #{actor} as #{details["gender"]}" details.tap do |h| h["compressed_name"] = details["name"].normalize h["gender"] = details["gender"].normalize end return details end nil end |