Class: IParty::Config
- Inherits:
-
Struct
- Object
- Struct
- IParty::Config
- Defined in:
- lib/iparty/config.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#eager_load ⇒ Object
Returns the value of attribute eager_load.
-
#editions ⇒ Object
Returns the value of attribute editions.
-
#ipv6_significant ⇒ Object
Returns the value of attribute ipv6_significant.
-
#license_key ⇒ Object
Returns the value of attribute license_key.
-
#local_ip_alias ⇒ Object
Returns the value of attribute local_ip_alias.
-
#mirror ⇒ Object
Returns the value of attribute mirror.
-
#singletons ⇒ Object
Returns the value of attribute singletons.
-
#url_to_mmdb ⇒ Object
Returns the value of attribute url_to_mmdb.
Instance Method Summary collapse
- #annotate(*args, **kw) ⇒ Object
- #annotate_tag(tags, *args) ⇒ Object
- #env_value(*args, **kw, &block) ⇒ Object
- #init_singletons! ⇒ Object
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def account_id @account_id end |
#annotations ⇒ Object
Returns the value of attribute annotations
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def annotations @annotations end |
#directory ⇒ Object
Returns the value of attribute directory
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def directory @directory end |
#eager_load ⇒ Object
Returns the value of attribute eager_load
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def eager_load @eager_load end |
#editions ⇒ Object
Returns the value of attribute editions
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def editions @editions end |
#ipv6_significant ⇒ Object
Returns the value of attribute ipv6_significant
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def ipv6_significant @ipv6_significant end |
#license_key ⇒ Object
Returns the value of attribute license_key
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def license_key @license_key end |
#local_ip_alias ⇒ Object
Returns the value of attribute local_ip_alias
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def local_ip_alias @local_ip_alias end |
#mirror ⇒ Object
Returns the value of attribute mirror
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def mirror @mirror end |
#singletons ⇒ Object
Returns the value of attribute singletons
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def singletons @singletons end |
#url_to_mmdb ⇒ Object
Returns the value of attribute url_to_mmdb
4 5 6 |
# File 'lib/iparty/config.rb', line 4 def url_to_mmdb @url_to_mmdb end |
Instance Method Details
#annotate(*args, **kw) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/iparty/config.rb', line 34 def annotate *args, **kw self[:annotations] ||= {} result = {} IParty.(args).each do |net| ipp = IParty(net) kw[:tags] = ((result[ipp] || self[:annotations][ipp] || {})[:tags] || []) | kw[:tags] if kw.key?(:tags) result[ipp] = (result[ipp] || self[:annotations][ipp] || {}).merge(kw) end self[:annotations].merge!(result) result end |
#annotate_tag(tags, *args) ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/iparty/config.rb', line 46 def annotate_tag , *args self[:annotations] ||= {} IParty.(args).to_h do |net| ipp = IParty(net) self[:annotations][ipp] ||= {} self[:annotations][ipp][:tags] ||= [] self[:annotations][ipp][:tags] |= Array() [net, self[:annotations][ipp][:tags]] end end |