module GoodData::Mixin::PropertyAccessor

Public Instance Methods

property_accessor(*args) click to toggle source
# File lib/gooddata/mixins/property_accessor.rb, line 24
def property_accessor(*args)
  property_reader(*args)
  property_writer(*args)
end
property_reader(where, *props) click to toggle source
# File lib/gooddata/mixins/property_accessor.rb, line 8
def property_reader(where, *props)
  props.each do |prop|
    define_method(prop, proc {
      instance_variable_get(where)[prop]
    })
  end
end
property_writer(where, *props) click to toggle source
# File lib/gooddata/mixins/property_accessor.rb, line 16
def property_writer(where, *props)
  props.each do |prop|
    define_method("#{prop}=", proc { |val|
      instance_variable_get(where)[prop] = val
    })
  end
end