class Fabrique::BeanPropertyReference
Attributes
bean[RW]
Public Class Methods
new(bean_property)
click to toggle source
# File lib/fabrique/bean_property_reference.rb, line 6 def initialize(bean_property) chain = bean_property.split('.') @bean = chain.first @property_chain = chain.drop(1) @property = @property_chain.join('.') end
Public Instance Methods
resolve(bean)
click to toggle source
# File lib/fabrique/bean_property_reference.rb, line 13 def resolve(bean) @property_chain.inject(bean) { |acc, property| acc.send(property) } end