module Nuggets::Module::QueryAttrMixin

Public Instance Methods

query_accessor(*names) click to toggle source
# File lib/nuggets/module/query_attr_mixin.rb, line 31
def query_accessor(*names)
  query_reader(*names).each(&method(:attr_writer))
end
query_attr(*names)
Alias for: query_reader
query_reader(*names) click to toggle source
# File lib/nuggets/module/query_attr_mixin.rb, line 35
  def query_reader(*names)
    names.each { |name|
      class_eval "        def #{name}?
          !!@#{name} if instance_variable_defined?("@#{name}")
        end
", __FILE__, __LINE__ + 1
    }
  end
Also aliased as: query_attr