Skip to content

Commit

Permalink
Moved #attribute_for from Tuple to PrimitiveTuple because that's the …
Browse files Browse the repository at this point in the history
…only place it is needed
  • Loading branch information
Nathan Sobo authored and Nathan Sobo committed Nov 17, 2008
1 parent 3899c06 commit a66242c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions lib/unison/tuples/primitive_tuple.rb
Expand Up @@ -319,6 +319,16 @@ def customize_relation(relation, &customization_block)
customization_block ? instance_exec(relation, &customization_block) : relation
end

def attribute_for(attribute_or_name)
case attribute_or_name
when Attributes::Attribute
attribute_or_name
when Symbol
set[attribute_or_name]
else
raise ArgumentError, "attribute_for only accepts an Attribute or Symbol"
end
end
end
end
end
11 changes: 0 additions & 11 deletions lib/unison/tuples/tuple.rb
Expand Up @@ -32,17 +32,6 @@ def on_update(*args, &block)

protected
attr_reader :update_subscription_node

def attribute_for(attribute_or_name)
case attribute_or_name
when Attributes::Attribute
attribute_or_name
when Symbol
set[attribute_or_name]
else
raise ArgumentError, "attribute_for only accepts an Attribute or Symbol"
end
end
end
end
end

0 comments on commit a66242c

Please sign in to comment.