Class: Daijisen::Definition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(def_html) ⇒ Definition

Returns a new instance of Definition.



42
43
44
45
46
# File 'lib/daijisen.rb', line 42

def initialize(def_html)
  @link = def_html.css("h3 a")[0]['href']
  @reading = def_html.css("h3 a")[0].content
  @example = def_html.css("div")[0].content
end

Instance Attribute Details

#exampleObject

Returns the value of attribute example.



40
41
42
# File 'lib/daijisen.rb', line 40

def example
  @example
end

Returns the value of attribute link.



40
41
42
# File 'lib/daijisen.rb', line 40

def link
  @link
end

#readingObject

Returns the value of attribute reading.



40
41
42
# File 'lib/daijisen.rb', line 40

def reading
  @reading
end