Class: Dictionary
- Inherits:
-
Object
- Object
- Dictionary
- Defined in:
- lib/dictionary.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#xpath ⇒ Object
readonly
Returns the value of attribute xpath.
Instance Method Summary collapse
-
#initialize(name, url, xpath, color = nil) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #valid? ⇒ Boolean
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
#color ⇒ Object
Returns the value of attribute color.
23 24 25 |
# File 'lib/dictionary.rb', line 23 def color @color end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
22 23 24 |
# File 'lib/dictionary.rb', line 22 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
22 23 24 |
# File 'lib/dictionary.rb', line 22 def url @url end |
#xpath ⇒ Object (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
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 |