Class: Rubytypeformio::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rubytypeformio/base.rb

Direct Known Subclasses

Choice, Field, Form, Link

Instance Method Summary collapse

Instance Method Details

#compact(hash) ⇒ Object



12
13
14
15
# File 'lib/rubytypeformio/base.rb', line 12

def compact(hash)
  # hash.delete_if { |k, v| v.nil? }
  hash.delete_if { |key, value| value.to_s.strip == '' }
end

#prettyObject



7
8
9
10
# File 'lib/rubytypeformio/base.rb', line 7

def pretty
  # pry
  puts JSON.pretty_generate(self.to_h)
end