lib/twitter/user.rb
# Dynamically define a method for entity URIs
#
# @param key1 [Symbol]
# @param key2 [Symbol]
Dynamically define a method for entity URIs
Dynamically define a method for entity URIs
def define_entity_uris_methods(key1, key2)
        array = key1.to_s.split('_')
        index = array.index('uris')
        array[index] = 'urls'
        url_key = array.join('_').to_sym
        define_entity_uris_method(key1, key2)
        alias_method(url_key, key1)
        define_entity_uris_predicate_method(key1)
        alias_method(:"#{url_key}?", :"#{key1}?")
      end
def define_entity_uris_methods ( key1 , key2 ) array = key1 . to_s . split ( '_' ) index = array . index ( 'uris' ) array [ index ] = 'urls' url_key = array . join ( '_' ) . to_sym define_entity_uris_method ( key1 , key2 ) alias_method ( url_key , key1 ) define_entity_uris_predicate_method ( key1 ) alias_method ( :" #{ url_key } ? " , :" #{ key1 } ? " ) end
Dynamically define a method for entity URIs
Dynamically define a method for entity URIs
key1
<not_specific>
key2
<not_specific>
<not_specific>
None