Sha256: cbd80189fdfe051be4a314529ed159b2f186775d2aa2274c6b6441b78a7e4dd6

Contents?: true

Size: 443 Bytes

Versions: 2

Compression:

Stored size: 443 Bytes

Contents

require 'active_support/concern'

module Ripple
  module AttributeMethods
    module Read
      extend ActiveSupport::Concern

      included do
        attribute_method_suffix ""
      end

      def [](attr_name)
        attribute(attr_name)
      end

      private
      def attribute(attr_name)
        if @attributes.include?(attr_name)
          @attributes[attr_name]
        else
          nil
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
seomoz-ripple-1.0.0.pre lib/ripple/attribute_methods/read.rb
ripple-1.0.0.beta lib/ripple/attribute_methods/read.rb