Class: Zonomi::API::Action

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/zonomi/api/action.rb

Constant Summary collapse

ATTRIBUTES =
[:action, :host, :name, :type, :value, :prio, :ttl]
ACTIONS =
{
  set:    'SET',
  query:  'QUERY',
  delete: 'DELETE',
  delete_zone: 'DELETEZONE',
  query_zones: 'QUERYZONES',
}
TYPES =
{
  a:   'A',
  mx:  'MX',
  txt: 'TXT',
}

Instance Method Summary collapse

Instance Method Details

#attributesObject



19
20
21
# File 'lib/zonomi/api/action.rb', line 19

def attributes
  get_allowed_attributes
end

#to_hashObject



23
24
25
# File 'lib/zonomi/api/action.rb', line 23

def to_hash
  format_attributes
end

#to_paramObject



31
32
33
# File 'lib/zonomi/api/action.rb', line 31

def to_param
  attributes_to_params
end

#to_sObject



27
28
29
# File 'lib/zonomi/api/action.rb', line 27

def to_s
  attributes_to_params
end

#valid?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/zonomi/api/action.rb', line 35

def valid?
  validate_attributes!
end