Class: Kongfigure::Resources::Target

Inherits:
Base
  • Object
show all
Defined in:
lib/kongfigure/resources/target.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id, #kongfigure_ignore_fields, #plugins, #unchanged, #updated

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, build_all, #display_name, #has_to_be_deleted?, #initialize, #mark_as_unchanged, #mark_as_updated, #plugin_allowed?

Constructor Details

This class inherits a constructor from Kongfigure::Resources::Base

Instance Attribute Details

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/kongfigure/resources/target.rb', line 3

def target
  @target
end

#weightObject

Returns the value of attribute weight.



3
4
5
# File 'lib/kongfigure/resources/target.rb', line 3

def weight
  @weight
end

Class Method Details

.build(hash) ⇒ Object



5
6
7
8
9
10
# File 'lib/kongfigure/resources/target.rb', line 5

def self.build(hash)
  target        = new(hash["id"], hash["kongfigure_ignore_fields"])
  target.target = hash["target"]
  target.weight = hash["weight"]
  target
end

Instance Method Details

#api_attributesObject



16
17
18
19
20
21
# File 'lib/kongfigure/resources/target.rb', line 16

def api_attributes
  {
    "target" => target,
    "weight" => weight
  }.compact
end

#api_nameObject



12
13
14
# File 'lib/kongfigure/resources/target.rb', line 12

def api_name
  "targets"
end