Class: XvideosHelper::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/xvideos_helper/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



8
9
10
11
12
# File 'lib/xvideos_helper/client.rb', line 8

def initialize
  @crawler = XvideosHelper::Crawler.new
  @domain ||= Env::XVIDES_URL_WWW
  @tag_url ||= Env::XVIDES_TAG_URL
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



7
8
9
# File 'lib/xvideos_helper/client.rb', line 7

def domain
  @domain
end

#tag_urlObject

Returns the value of attribute tag_url.



7
8
9
# File 'lib/xvideos_helper/client.rb', line 7

def tag_url
  @tag_url
end

Instance Method Details

#movies_limit=(limit) ⇒ Object



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

def movies_limit=(limit)
  @crawler.movies_limit = limit
end

#movies_of(target) ⇒ Object

get movie information according to target



15
16
17
18
19
20
21
# File 'lib/xvideos_helper/client.rb', line 15

def movies_of(target)
  begin
    return @crawler.get_data_from(target,'movie')
  rescue Exception => e
    raise e
  end
end

#tag_data_listsObject

tag’s url lists



24
25
26
27
28
29
30
# File 'lib/xvideos_helper/client.rb', line 24

def tag_data_lists
  begin
    return @crawler.get_data_from(@tag_url,'taglist')
  rescue Exception => e
    raise e
  end
end

#tags_limit=(limit) ⇒ Object



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

def tags_limit=(limit)
  @crawler.tags_limit = limit
end