support/ruby/collins-client/lib/collins/asset.rb
# Convenience method for {#get_attribute}
#
# This 'magic' method allows you to retrieve attributes on an asset, or check if an attribute
# exists via a predicate method.
#
# @example
#   real_asset.hostname # => "foo"
#   bare_asset.hostname # => nil
#   real_asset.hostname? # => true
#   bare_asset.hostname? # => false
#
# @note This is never called directly
# @return [NilClass,Object] Nil if attribute not found, otherwise the attribute value
Convenience method for {#get_attribute}
This 'magic' method allows you to retrieve attributes on an asset, or check if an attribute
exists via a predicate method.
Convenience method for { #get_attribute } This ' magic ' method allows you to retrieve attributes on an asset or check if an attribute exists via a predicate method .
def method_missing(m, *args, &block)
      name = m.to_s.upcase
      is_bool = name.end_with?('?')
      if is_bool then
        name = name.sub('?', '')
        respond_to?(name)
      else
        extract(extras, "ATTRIBS", "0", name)
      end
    end
def method_missing ( m , * args , & block ) name = m . to_s . upcase is_bool = name . end_with? ( '?' ) if is_bool then name = name . sub ( '?' , '' ) respond_to? ( name ) else extract ( extras , "ATTRIBS" , "0" , name ) end end
Convenience method for {#get_attribute}
This 'magic' method allows you to retrieve attributes on an asset, or check if an attribute
exists via a predicate method.
Convenience method for { #get_attribute } This ' magic ' method allows you to retrieve attributes on an asset or check if an attribute exists via a predicate method .
Nil if attribute not found, otherwise the attribute value
Nil if attribute not found otherwise the attribute value
NilClass,Object
m
args
block
example
None
note
This is never called directly
This is never called directly