Class: Subscene::SubtitleResultSet

Inherits:
Object
  • Object
show all
Defined in:
lib/subscene/subtitle_result_set.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ SubtitleResultSet

Returns a new instance of SubtitleResultSet


6
7
8
# File 'lib/subscene/subtitle_result_set.rb', line 6

def initialize(attributes)
  @instances = attributes[:instances]
end

Instance Attribute Details

#instancesObject (readonly)

Returns the value of attribute instances


4
5
6
# File 'lib/subscene/subtitle_result_set.rb', line 4

def instances
  @instances
end

Class Method Details

.build(html) ⇒ Object


10
11
12
13
14
15
16
17
18
# File 'lib/subscene/subtitle_result_set.rb', line 10

def self.build(html)
  instances = html.css("tbody > tr").collect do |item|
    Subscene::SubtitleResult.build(item)
  end

  new({
    instances: instances
  })
end