Class: Dictionary

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, xpath, color = nil) ⇒ Dictionary

Returns a new instance of Dictionary.



24
25
26
27
28
29
# File 'lib/dictionary.rb', line 24

def initialize(name, url, xpath, color = nil)
	@name = name
	@url = url
	@xpath = xpath
	@color = color
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



23
24
25
# File 'lib/dictionary.rb', line 23

def color
  @color
end

#nameObject (readonly)

Returns the value of attribute name.



22
23
24
# File 'lib/dictionary.rb', line 22

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



22
23
24
# File 'lib/dictionary.rb', line 22

def url
  @url
end

#xpathObject (readonly)

Returns the value of attribute xpath.



22
23
24
# File 'lib/dictionary.rb', line 22

def xpath
  @xpath
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


31
32
33
34
35
36
# File 'lib/dictionary.rb', line 31

def valid?
  return (@name && ! @name.empty?
          && @url && ! @url.empty?
          && @xpath && ! @xpath.empty?
          && @color && ! @color.empty?)
end