Class: Relation
- Inherits:
-
Struct
- Object
- Struct
- Relation
- Defined in:
- lib/todotxt/relation.rb
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Relation
constructor
A new instance of Relation.
- #members ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Relation
Returns a new instance of Relation.
2 3 4 5 6 7 |
# File 'lib/todotxt/relation.rb', line 2 def initialize(hash = {}) super *(hash.values_at(*members)) rescue ArgumentError => error diff = hash.keys - members raise error, "Unknown attributes #{diff}" end |
Instance Method Details
#members ⇒ Object
9 10 11 |
# File 'lib/todotxt/relation.rb', line 9 def members @members ||= super end |