Class: Brandmaker::CustomStructure
- Inherits:
-
Object
- Object
- Brandmaker::CustomStructure
- Extended by:
- Savon::Model
- Defined in:
- lib/brandmaker/custom_structure.rb
Class Method Summary collapse
- .all ⇒ Object
- .client ⇒ Object
- .custom_structure_name_for_mapped_technical_name(technical_name) ⇒ Object
- .find_by_technical_name(technical_name) ⇒ Object
Instance Method Summary collapse
-
#initialize(data) ⇒ CustomStructure
constructor
A new instance of CustomStructure.
- #label ⇒ Object
- #name ⇒ Object
- #objects ⇒ Object
Constructor Details
#initialize(data) ⇒ CustomStructure
Returns a new instance of CustomStructure.
38 39 40 |
# File 'lib/brandmaker/custom_structure.rb', line 38 def initialize data @data = data end |
Class Method Details
.all ⇒ Object
25 26 27 28 29 |
# File 'lib/brandmaker/custom_structure.rb', line 25 def all find_all_custom_structures.body[:find_all_custom_structures_response][:return][:custom_structures].collect do |data| CustomStructure.new data end end |
.client ⇒ Object
11 12 13 |
# File 'lib/brandmaker/custom_structure.rb', line 11 def self.client Brandmaker.configuration.dse_client end |
.custom_structure_name_for_mapped_technical_name(technical_name) ⇒ Object
31 32 33 34 35 |
# File 'lib/brandmaker/custom_structure.rb', line 31 def custom_structure_name_for_mapped_technical_name technical_name { 'anbieter_hinzufgen' => 'PM_ExterneSuppliers_Druckereien' }[technical_name] end |
.find_by_technical_name(technical_name) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/brandmaker/custom_structure.rb', line 16 def find_by_technical_name technical_name name = custom_structure_name_for_mapped_technical_name(technical_name) unless name.nil? all.find { |cs| cs.name == name } else nil end end |
Instance Method Details
#label ⇒ Object
46 47 48 |
# File 'lib/brandmaker/custom_structure.rb', line 46 def label @data[:name] end |
#name ⇒ Object
42 43 44 |
# File 'lib/brandmaker/custom_structure.rb', line 42 def name @data[:name] end |
#objects ⇒ Object
50 51 52 |
# File 'lib/brandmaker/custom_structure.rb', line 50 def objects @data[:objects] end |