This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Its: allowing params feature #786
Closed

Description
"its" could allow easily the use of methods with parameters like its("phone_numbers[0]").
# I think this piece of code could be changed from:
def its(attribute, &block)
..
let(:__its_subject) do
attribute_chain = attribute.to_s.split('.')
attribute_chain.inject(subject) do |inner_subject, attr|
inner_subject.send(attr)
end
end
end
..
# to this, to allow params and method chaining
..
let(:__its_subject) do
subject.instance_eval(attribute.to_s)
end
..
Metadata
Metadata
Assignees
Labels
No labels