Method: WordsRubySdk::Paragraph#initialize

Defined in:
lib/words_ruby_sdk/models/paragraph.rb

#initialize(attributes = {}) ⇒ Paragraph

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/words_ruby_sdk/models/paragraph.rb', line 64

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key

  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.key?(:'link')
    self.link = attributes[:'link']
  end

  if attributes.key?(:'NodeId')
    self.node_id = attributes[:'NodeId']
  end

  if attributes.key?(:'ChildNodes')
    if (value = attributes[:'ChildNodes']).is_a?(Array)
      self.child_nodes = value
    end
  end

end