Sha256: 2cedea435a634c5e901198114df097dcdec2b45011a9c24b676da97000d58d27

Contents?: true

Size: 467 Bytes

Versions: 11

Compression:

Stored size: 467 Bytes

Contents

module RestfulResource
  class OpenObject
    def initialize(attributes = {}, hack_for_activeresource = false)
      @inner_object = OpenStruct.new(attributes)
    end

    def method_missing(method)
      if @inner_object.respond_to?(method)
        @inner_object.send(method)
      else
        super(method)
      end
    end

    def respond_to?(method, include_private = false)
      super || @inner_object.respond_to?(method, include_private)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
restful_resource-0.8.10 lib/restful_resource/open_object.rb
restful_resource-0.8.9 lib/restful_resource/open_object.rb
restful_resource-0.8.8 lib/restful_resource/open_object.rb
restful_resource-0.8.7 lib/restful_resource/open_object.rb
restful_resource-0.8.6 lib/restful_resource/open_object.rb
restful_resource-0.8.5 lib/restful_resource/open_object.rb
restful_resource-0.8.4 lib/restful_resource/open_object.rb
restful_resource-0.8.3 lib/restful_resource/open_object.rb
restful_resource-0.8.2 lib/restful_resource/open_object.rb
restful_resource-0.8.1 lib/restful_resource/open_object.rb
restful_resource-0.8.0 lib/restful_resource/open_object.rb