class Manabu::Resource

Public Class Methods

new(client, **info) click to toggle source
# File lib/manabu/resource.rb, line 3
def initialize(client, **info)
  @client = client
  fill(info)
end

Public Instance Methods

_fill(var, sym, hash) click to toggle source
# File lib/manabu/resource.rb, line 11
def _fill(var, sym, hash)
  var = hash[sym] if (hash.include?(sym) && !hash[sym].nil?)
end
fill(**info) click to toggle source
# File lib/manabu/resource.rb, line 8
def fill(**info)
end
to_hash() click to toggle source
# File lib/manabu/resource.rb, line 15
def to_hash
  hash = {}
  instance_variables.each do |var|
    iv = instance_variable_get(var)
    hash[(var.to_s.delete("@")).to_sym] = iv if !iv.nil?
  end
  hash
end