Sha256: c3d6cfff2bb7a06ce9c9571443e58520c3be576957467497e09b76df2f256875

Contents?: true

Size: 592 Bytes

Versions: 10

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module Alma
  class AlmaRecord
    def initialize(record)
      @raw_record = record
      post_initialize()
    end

    def method_missing(name)
      return response[name.to_s] if response.has_key?(name.to_s)
      super.method_missing name
    end

    def respond_to_missing?(name, include_private = false)
      response.has_key?(name.to_s) || super
    end

    def response
      @raw_record
    end

    def post_initialize
      # Subclasses can define this method to perform extra initialization
      # after the super class init.
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alma-0.6.2 lib/alma/alma_record.rb
alma-0.6.1 lib/alma/alma_record.rb
alma-0.6.0 lib/alma/alma_record.rb
alma-0.5.1 lib/alma/alma_record.rb
alma-0.5.0 lib/alma/alma_record.rb
alma-0.4.2 lib/alma/alma_record.rb
alma-0.4.1 lib/alma/alma_record.rb
alma-0.4.0 lib/alma/alma_record.rb
alma-0.3.3 lib/alma/alma_record.rb
alma-0.3.2 lib/alma/alma_record.rb