Sha256: 3060222cbd0340c7c061ab0f132802002537e619a3576263a15d14c811ee53c0

Contents?: true

Size: 418 Bytes

Versions: 5

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

module MyTankInfo
  class Object
    def initialize(attributes)
      @attributes = OpenStruct.new(attributes)
    end

    def method_missing(method, *args, &block)
      attribute = @attributes.send(method, *args, &block)
      attribute.is_a?(Hash) ? Object.new(attribute) : attribute
    end

    def respond_to_missing?(method, include_private = false)
      true
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
my_tank_info-1.1.1 lib/my_tank_info/object.rb
my_tank_info-1.1.0 lib/my_tank_info/object.rb
my_tank_info-1.0.2 lib/my_tank_info/object.rb
my_tank_info-1.0.1 lib/my_tank_info/object.rb
my_tank_info-1.0.0 lib/my_tank_info/object.rb