lib/petit/shortcode.rb
# Private method called by initialize for mapping parameters from a hash to
#   object parameters
#
# @param params [HashWithIndifferentAccess] is a collection of values to be
#   validated and applied to the object instance
Private method called by initialize for mapping parameters from a hash to
object parameters
Private method called by initialize for mapping parameters from a hash to object parameters
def create_from_params(params)
      self.name = params[:name] || params[:shortcode]
      self.destination = params[:destination]
      self.ssl = params[:ssl]
      @access_count = params[:access_count] || nil
      @created_at = Time.at(params[:created_at]) if params[:created_at]
      @updated_at = Time.at(params[:updated_at]) if params[:updated_at]
    end
def create_from_params ( params ) self . name = params [ :name ] || params [ :shortcode ] self . destination = params [ :destination ] self . ssl = params [ :ssl ] @access_count = params [ :access_count ] || nil @created_at = Time . at ( params [ :created_at ] ) if params [ :created_at ] @updated_at = Time . at ( params [ :updated_at ] ) if params [ :updated_at ] end
Private method called by initialize for mapping parameters from a hash to
object parameters
Private method called by initialize for mapping parameters from a hash to object parameters
params
None