Class: LgPodPlugin::LPodTarget
- Inherits:
-
Object
- Object
- LgPodPlugin::LPodTarget
- Defined in:
- lib/lg_pod_plugin/config/target.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#internal_hash ⇒ Object
readonly
Returns the value of attribute internal_hash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(target) ⇒ LPodTarget
constructor
A new instance of LPodTarget.
Constructor Details
#initialize(target) ⇒ LPodTarget
Returns a new instance of LPodTarget.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lg_pod_plugin/config/target.rb', line 8 def initialize(target) @internal_hash = target.send(:internal_hash) @name = @internal_hash["name"] array = Array.new(@internal_hash['dependencies'] ||= []) dependencies = array.reject do |e| if LUtils.is_a_string?(e) true elsif e.is_a?(Hash) key = e.keys.last ||= "" val = e[key].last ||= "" !val.is_a?(Hash) else true end end external_pods = Hash.new dependencies.each do |e| key = e.keys.last ||= "" val = e[key].last ||= {} next unless val.is_a?(Hash) pod = ExternalPod.new(self, key, val) external_pods[pod.name] = pod end @dependencies = external_pods end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
6 7 8 |
# File 'lib/lg_pod_plugin/config/target.rb', line 6 def dependencies @dependencies end |
#internal_hash ⇒ Object (readonly)
Returns the value of attribute internal_hash.
7 8 9 |
# File 'lib/lg_pod_plugin/config/target.rb', line 7 def internal_hash @internal_hash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/lg_pod_plugin/config/target.rb', line 5 def name @name end |