Module: GandiV5::Data::ClassMethods

Defined in:
lib/gandi_v5/data.rb

Overview

Class methods to add to classes which include this module.

Instance Method Summary collapse

Instance Method Details

#from_gandi(data) ⇒ Object

Create a new instance with data from Gandi.

Parameters:

  • data (Hash)


148
149
150
151
152
153
154
155
# File 'lib/gandi_v5/data.rb', line 148

def from_gandi(data)
  return nil if data.nil?

  new(
    translate_gandi(data).transform_keys(&:to_sym)
                         .select { |k, _v| data_member?(k) }
  )
end