Class: Bitodeme::Resource::Base

Inherits:
Object
  • Object
show all
Extended by:
SingleForwardable
Defined in:
lib/bitodeme/resources/base.rb

Overview

Base class for all Bitodeme resources

Instance Method Summary collapse

Instance Method Details

#to_hObject



45
46
47
48
49
50
# File 'lib/bitodeme/resources/base.rb', line 45

def to_h
  attrs.each_with_object({}) do |attr, hash|
    val        = instance_variable_get(:"@#{attr}")
    hash[attr] = val unless val.nil?
  end
end