Class: Relation

Inherits:
Struct
  • Object
show all
Defined in:
lib/todotxt/relation.rb

Instance Method Summary collapse

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

#membersObject



9
10
11
# File 'lib/todotxt/relation.rb', line 9

def members
  @members ||= super
end