Class: TelegraphApi::DomToNode

Inherits:
Object
  • Object
show all
Defined in:
lib/telegraph_api_ruby/dom_to_node.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DomToNode

Returns a new instance of DomToNode.



11
12
13
# File 'lib/telegraph_api_ruby/dom_to_node.rb', line 11

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/telegraph_api_ruby/dom_to_node.rb', line 5

def data
  @data
end

Class Method Details

.call(*args) ⇒ Object



7
8
9
# File 'lib/telegraph_api_ruby/dom_to_node.rb', line 7

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



15
16
17
# File 'lib/telegraph_api_ruby/dom_to_node.rb', line 15

def call
  dom_to_node(parse_html(data))[:children]
end