query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
|---|---|---|---|---|---|---|
Update properties of this object
|
def update!(**args)
@bot = args[:bot] if args.key?(:bot)
@command_id = args[:command_id] if args.key?(:command_id)
@command_name = args[:command_name] if args.key?(:command_name)
@triggers_dialog = args[:triggers_dialog] if args.key?(:triggers_dialog)
@type = args[:type] if args.key?(:type)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@admin_installed = args[:admin_installed] if args.key?(:admin_installed)
@display_name = args[:display_name] if args.key?(:display_name)
@external_user_allowed = args[:external_user_allowed] if args.key?(:external_user_allowed)
@name = args[:name] if args.key?(:name)
@single_user_bot_dm = args[:single_user_bot_dm] if args.key?(:single_user_bot_dm)
@space_details = args[:space_details] if args.key?(:space_details)
@space_history_state = args[:space_history_state] if args.key?(:space_history_state)
@space_threading_state = args[:space_threading_state] if args.key?(:space_threading_state)
@space_type = args[:space_type] if args.key?(:space_type)
@threaded = args[:threaded] if args.key?(:threaded)
@type = args[:type] if args.key?(:type)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@default_to_current_space = args[:default_to_current_space] if args.key?(:default_to_current_space)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@description = args[:description] if args.key?(:description)
@guidelines = args[:guidelines] if args.key?(:guidelines)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def properties=(value)\n @properties = value\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
"0.63344294",
"0.63216114",
"0.6284898",
"0.6271445",
"0.62648237",
"0.624251",
"0.6218843",
"0.6217826",
"0.6211294",
"0.6204883",
"0.6204883",
"0.6203174",
"0.6203085",
"0.6202945",
"0.61754346",
"0.61754346",
"0.6159627",
"0.61573356",
"0.6146927",
"0.61265624",
"0.61233723",
"0.61213213",
"0.6110708",
"0.61082405",
"0.610203",
"0.6087213",
"0.60851586",
"0.606328",
"0.60598475",
"0.6056013",
"0.605159",
"0.605159",
"0.60428274",
"0.6032607",
"0.6025175",
"0.6016861",
"0.59932756",
"0.5991629",
"0.5977848",
"0.59746736",
"0.5967899",
"0.59640163",
"0.5963087",
"0.59628224",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59529036",
"0.594494",
"0.594494",
"0.59420687",
"0.59420687",
"0.59377116",
"0.5927631",
"0.5926637",
"0.592564",
"0.59237856",
"0.59237856",
"0.5923722",
"0.59169865",
"0.591586",
"0.58917314",
"0.58872443",
"0.58862734",
"0.58807427",
"0.5880232",
"0.5880232",
"0.5877138",
"0.5860484",
"0.5846987",
"0.58439326",
"0.58367634",
"0.58300084",
"0.5829718",
"0.58233184",
"0.5822193"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@value = args[:value] if args.key?(:value)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@on_click = args[:on_click] if args.key?(:on_click)
@text = args[:text] if args.key?(:text)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@text = args[:text] if args.key?(:text)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def properties=(value)\n @properties = value\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
"0.63344294",
"0.63216114",
"0.6284898",
"0.6271445",
"0.62648237",
"0.624251",
"0.6218843",
"0.6217826",
"0.6211294",
"0.6204883",
"0.6204883",
"0.6203174",
"0.6203085",
"0.6202945",
"0.61754346",
"0.61754346",
"0.6159627",
"0.61573356",
"0.6146927",
"0.61265624",
"0.61233723",
"0.61213213",
"0.6110708",
"0.61082405",
"0.610203",
"0.6087213",
"0.60851586",
"0.606328",
"0.60598475",
"0.6056013",
"0.605159",
"0.605159",
"0.60428274",
"0.6032607",
"0.6025175",
"0.6016861",
"0.59932756",
"0.5991629",
"0.5977848",
"0.59746736",
"0.5967899",
"0.59640163",
"0.5963087",
"0.59628224",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59529036",
"0.594494",
"0.594494",
"0.59420687",
"0.59420687",
"0.59377116",
"0.5927631",
"0.5926637",
"0.592564",
"0.59237856",
"0.59237856",
"0.5923722",
"0.59169865",
"0.591586",
"0.58917314",
"0.58872443",
"0.58862734",
"0.58807427",
"0.5880232",
"0.5880232",
"0.5877138",
"0.5860484",
"0.5846987",
"0.58439326",
"0.58367634",
"0.58300084",
"0.5829718",
"0.58233184",
"0.5822193"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@name = args[:name] if args.key?(:name)
@thread_key = args[:thread_key] if args.key?(:thread_key)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@hours = args[:hours] if args.key?(:hours)
@minutes = args[:minutes] if args.key?(:minutes)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@id = args[:id] if args.key?(:id)
@offset = args[:offset] if args.key?(:offset)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@filename = args[:filename] if args.key?(:filename)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def properties=(value)\n @properties = value\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
"0.63344294",
"0.63216114",
"0.6284898",
"0.6271445",
"0.62648237",
"0.624251",
"0.6218843",
"0.6217826",
"0.6211294",
"0.6204883",
"0.6204883",
"0.6203174",
"0.6203085",
"0.6202945",
"0.61754346",
"0.61754346",
"0.6159627",
"0.61573356",
"0.6146927",
"0.61265624",
"0.61233723",
"0.61213213",
"0.6110708",
"0.61082405",
"0.610203",
"0.6087213",
"0.60851586",
"0.606328",
"0.60598475",
"0.6056013",
"0.605159",
"0.605159",
"0.60428274",
"0.6032607",
"0.6025175",
"0.6016861",
"0.59932756",
"0.5991629",
"0.5977848",
"0.59746736",
"0.5967899",
"0.59640163",
"0.5963087",
"0.59628224",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59529036",
"0.594494",
"0.594494",
"0.59420687",
"0.59420687",
"0.59377116",
"0.5927631",
"0.5926637",
"0.592564",
"0.59237856",
"0.59237856",
"0.5923722",
"0.59169865",
"0.591586",
"0.58917314",
"0.58872443",
"0.58862734",
"0.58807427",
"0.5880232",
"0.5880232",
"0.5877138",
"0.5860484",
"0.5846987",
"0.58439326",
"0.58367634",
"0.58300084",
"0.5829718",
"0.58233184",
"0.5822193"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@attachment_data_ref = args[:attachment_data_ref] if args.key?(:attachment_data_ref)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@domain_id = args[:domain_id] if args.key?(:domain_id)
@is_anonymous = args[:is_anonymous] if args.key?(:is_anonymous)
@name = args[:name] if args.key?(:name)
@type = args[:type] if args.key?(:type)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@type = args[:type] if args.key?(:type)
@user = args[:user] if args.key?(:user)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def properties=(value)\n @properties = value\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.7012263",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.69181895",
"0.67403597",
"0.6709326",
"0.6709326",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6696149",
"0.6618882",
"0.6571848",
"0.65386343",
"0.65178275",
"0.6394807",
"0.6389745",
"0.6389745",
"0.63328",
"0.6319025",
"0.6283673",
"0.6269463",
"0.62639254",
"0.62410724",
"0.62170374",
"0.62152076",
"0.6210263",
"0.6204041",
"0.6204041",
"0.62021106",
"0.62017816",
"0.62017",
"0.61730784",
"0.61730784",
"0.6159277",
"0.6156169",
"0.61445665",
"0.6125433",
"0.61241156",
"0.6121413",
"0.6110477",
"0.6105694",
"0.61016303",
"0.60845226",
"0.6084427",
"0.6065455",
"0.6059506",
"0.6054869",
"0.6051708",
"0.6051708",
"0.60413384",
"0.6030853",
"0.6022535",
"0.6015561",
"0.59932375",
"0.59898263",
"0.5976479",
"0.5973787",
"0.59678394",
"0.5963291",
"0.5962048",
"0.5961157",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.5950731",
"0.59500545",
"0.59443134",
"0.59443134",
"0.59424853",
"0.59424853",
"0.593523",
"0.5926413",
"0.5924831",
"0.592427",
"0.59233046",
"0.59233046",
"0.5921224",
"0.59144294",
"0.59142506",
"0.58887535",
"0.58854496",
"0.5883008",
"0.58792305",
"0.5876954",
"0.5876954",
"0.58744955",
"0.5857968",
"0.5845542",
"0.5841629",
"0.58363605",
"0.5829255",
"0.582919",
"0.5822138",
"0.58208305"
] |
0.0
|
-1
|
Update properties of this object
|
def update!(**args)
@buttons = args[:buttons] if args.key?(:buttons)
@image = args[:image] if args.key?(:image)
@key_value = args[:key_value] if args.key?(:key_value)
@text_paragraph = args[:text_paragraph] if args.key?(:text_paragraph)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update(attrs)\n super(attrs)\n end",
"def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"def update\n # TODO: implement update\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update\n \n end",
"def refresh\n set_attributes\n end",
"def update(attrs)\n @attrs.update(attrs)\n self\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"def update_resource object, attributes\n object.update attributes\n end",
"def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"def update\n \n end",
"def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"def update\n @objects.map(&:update);\n end",
"def update\n raise NotImplementedError\n end",
"def update\n raise NotImplementedError\n end",
"def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update\n end",
"def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def modified_properties=(value)\n @modified_properties = value\n end",
"def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"def update\n\t\t\n\t\tend",
"def set_props(props)\n @props.merge!(props)\n end",
"def update() end",
"def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"def update_attributes(attrs)\n super({})\n end",
"def update\n @dirty = true\n end",
"def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"def update\n super\n end",
"def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"def properties=(value)\n @properties = value\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update ; end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"def update_with(attributes)\n assign_attributes(attributes)\n end",
"def update\n # don't need to update; hash is shared\n end",
"def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"def update\n raise NotImplementedError\n end",
"def update_attributes attributes\n @attributes.merge! attributes\n end",
"def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"def update\r\n end",
"def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n raise NotImplemented\n end",
"def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"def update_values\n end",
"def update_values\n end",
"def update\n raise NotImplementedError\n end",
"def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"def update attributes, collection #:nodoc:\n 0\n end",
"def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"def update\n set_deltatime\n set_last_update_at\n end"
] |
[
"0.70124525",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.69187176",
"0.6738901",
"0.67084897",
"0.67084897",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66983044",
"0.66188794",
"0.6571416",
"0.6538292",
"0.65194744",
"0.63953435",
"0.63903284",
"0.63903284",
"0.63344294",
"0.63216114",
"0.6284898",
"0.6271445",
"0.62648237",
"0.624251",
"0.6218843",
"0.6217826",
"0.6211294",
"0.6204883",
"0.6204883",
"0.6203174",
"0.6203085",
"0.6202945",
"0.61754346",
"0.61754346",
"0.6159627",
"0.61573356",
"0.6146927",
"0.61265624",
"0.61233723",
"0.61213213",
"0.6110708",
"0.61082405",
"0.610203",
"0.6087213",
"0.60851586",
"0.606328",
"0.60598475",
"0.6056013",
"0.605159",
"0.605159",
"0.60428274",
"0.6032607",
"0.6025175",
"0.6016861",
"0.59932756",
"0.5991629",
"0.5977848",
"0.59746736",
"0.5967899",
"0.59640163",
"0.5963087",
"0.59628224",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59534305",
"0.59529036",
"0.594494",
"0.594494",
"0.59420687",
"0.59420687",
"0.59377116",
"0.5927631",
"0.5926637",
"0.592564",
"0.59237856",
"0.59237856",
"0.5923722",
"0.59169865",
"0.591586",
"0.58917314",
"0.58872443",
"0.58862734",
"0.58807427",
"0.5880232",
"0.5880232",
"0.5877138",
"0.5860484",
"0.5846987",
"0.58439326",
"0.58367634",
"0.58300084",
"0.5829718",
"0.58233184",
"0.5822193"
] |
0.0
|
-1
|
Given a list of classes, modules, strings, and symbols, compile a combined list of methods. Classes and modules will be queried for their instance methods; strings and symbols will be treated as method names. Once the list is compiled, make all of the methods private. Takes an optional options hash, which can include the following options: :ancestors is a boolean determining whether to consider ancestors classes and modules. :except is a list of classes, modules, and method names which will be excluded from treatment.
|
def hide(*stuff)
hide_methods(self, [Object], *stuff)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def apply_to_methods\n # If method/methods option is set and all are String or Symbol, apply to those only, instead of\n # iterating through all methods\n methods = [@options[:method] || @options[:methods]]\n methods.compact!\n methods.flatten!\n\n if !methods.empty? && methods.all?{ |method| method.is_a?(String) || method.is_a?(Symbol) }\n methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n return\n end\n\n context.public_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n context.protected_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n if @options[:private_methods]\n context.private_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n end\n end",
"def with_methods\n method_names = @director ? @director.methods_wrapped.map {|m| m.name } : []\n [self.code.methods].flatten.each do |method|\n next if do_not_wrap?(method)\n next if method_names.include?(method.name)\n\n arguments = [method.arguments].flatten\n\n # Ignore methods that have non-public arguments anywhere\n if !arguments.empty? && !arguments.select {|a| !a.cpp_type.base_type.public?}.empty?\n Logger.info \"Ignoring method #{method.qualified_name} due to non-public argument type(s)\"\n next\n end\n\n if method.static?\n add_child StaticMethodNode.new(method, self)\n else\n add_child MethodNode.new(method, self)\n end\n end\n end",
"def privatize_non_exported_methods(singleton, symbols)\n singleton.instance_methods(false).each do |sym|\n next if symbols.include?(sym)\n\n singleton.send(:private, sym)\n end\n end",
"def method_definitions(*selection)\n list = []\n\n if selection.empty?\n list.concat bind_call(:instance_methods)\n end\n\n selection.each do |s|\n case s\n when :public, :all\n list.concat bind_call(:public_instance_methods)\n when :protected, :all\n list.concat bind_call(:protected_instance_methods)\n when :private, :all\n list.concat bind_call(:private_instance_methods)\n end\n end\n\n return list\n end",
"def collect_methods(include_ancestors, *methods_or_modules)\n methods_or_modules.inject([]) {|methods, method_or_module|\n case method_or_module\n when Symbol, String\n methods << method_or_module.to_sym\n when Module # also includes classes\n methods.concat(method_or_module.instance_methods(include_ancestors))\n when Array\n methods.concat(method_or_module)\n else\n raise ArgumentError, \"Bad argument: #{method_or_module.inspect}\"\n end\n }\n end",
"def remove_methods *ary\n ary.each do |methd|\n eval \"class << self; remove_method :'#{methd}'; end\"\n end\n end",
"def delegate_methods(*symbols); end",
"def get_all_unused_methods(access_control = nil)\n @methods.inject([]) do |unused_methods, (_class_name, methods)|\n unused_methods +=\n if access_control\n methods.select { |method| method.access_control == access_control && !method.used }\n else\n methods.reject(&:used)\n end\n end.reject { |method| method.access_control == 'public' && @possible_methods[method.method_name] }\n end",
"def all_methods(instance_methods = false)\n methods = if instance_methods || @instance_methods_switch\n Pry::Method.all_from_class(@interrogatee)\n else\n Pry::Method.all_from_obj(@interrogatee)\n end\n\n if Pry::Helpers::Platform.jruby? && !@jruby_switch\n methods = trim_jruby_aliases(methods)\n end\n\n methods.select { |method| @ppp_switch || method.visibility == :public }\n end",
"def child_methods\n literals.select {|lit| lit.kind_of? CompiledMethod }\n end",
"def get_methods(obj)\n meths = obj.methods.grep(/impl/)\n meths.map { |m| m.to_s.gsub('impl_', '') + '!' }\n end",
"def private_delegate_methods(*symbols); end",
"def translate_methods(translator)\n method_compilers.collect do |compiler|\n #log.debug \"Translate method #{compiler.method.name}\"\n translate_method(compiler , translator)\n end.flatten\n end",
"def all_c_methods\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_c_methods\n end\n end",
"def define_helpers(list)\n list.each do |method_name, method_info|\n # puts \"define #{method_name}\"\n params = parse_param(method_info[\"params\"])\n if method_name[0] == \".\"\n class_eval %(\n private def #{method_name[1..-1]} (params = { #{params} })\n request(\"#{method_name}\", params)\n end\n ), __FILE__, __LINE__ - 4\n else\n class_eval %(\n def #{method_name} (params = { #{params} })\n request(\"#{method_name}\", params)\n end\n ), __FILE__, __LINE__ - 4\n end\n end\n end",
"def build_Method_List(fpath_in, fpath_Out = nil)\r\n \r\n #########################\r\n # build: out path\r\n #########################\r\n if fpath_Out == nil\r\n\r\n # use => fpath_in string\r\n fpath_Out = fpath_in + \".METHODS\"\r\n \r\n end#if fpath_Out == nil\r\n\r\n #########################\r\n # build: methods list\r\n #########################\r\n # open file\r\n f_in = File.open(fpath_in, \"r\")\r\n \r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n\r\n # pattern (if multiple, add 'm' after the right hand of '/' char)\r\n # what to detect => 1) method name, 2) parameters \r\n #REF multiple http://stackoverflow.com/questions/5239997/regex-how-to-match-multiple-lines answered Mar 9 '11 at 0:36\r\n pattern = /void (.+)(\\(.*\\)) {/\r\n\r\n # array for method strings \r\n methods = Array.new\r\n \r\n # read lines\r\n while(line)\r\n \r\n res = (line=~ pattern)\r\n \r\n match = line.match pattern\r\n \r\n # match?\r\n if match\r\n\r\n # push matched strings into the array \r\n methods << match[1] + \"\\t\" + match[2]\r\n# methods << match[1] + match[2]\r\n \r\n end\r\n \r\n # next line\r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n \r\n end#while(line)\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_in.close\r\n \r\n #########################\r\n # write: output\r\n #########################\r\n # open file\r\n f_Out = File.open(fpath_Out, \"w\")\r\n\r\n # sort: use '!' for destructive effect\r\n methods.sort!\r\n \r\n # counter\r\n counter = 0\r\n \r\n # write each method string (with a new-line char '\\n')\r\n methods.each_with_index do |m, i|\r\n \r\n f_Out.write(\"#{i + 1}.\\t#{m}\" + \"\\n\")\r\n# f_Out.write(m + \"\\n\")\r\n \r\n counter = counter + 1\r\n \r\n end\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_Out.close\r\n \r\n #########################\r\n # return\r\n #########################\r\n return counter\r\n \r\nend",
"def get_yard_meths(meths, files = [])\n ## TODO: handle YARD options tags\n ## filter out meths without types\n meths.keep_if { |m| (!m.tags(:param).empty? && m.tags(:param).any? { |t| !t.types.nil? }) || (!m.tags(:return).empty? && m.tags(:return).any? { |t| !t.types.nil? }) } \n\n ## these methods have types automatically generated for them based on their names\n ## for our purposes, not interested in these automatically generated types\n meths.keep_if { |m| !(m[:name] == :initialize) && !m[:name].to_s.end_with?(\"?\") && !(m[:name] == :==) } \n meths_hash = {}\n meths.each { |m|\n files << m.file unless files.include? m.file\n klass = m.namespace\n meth = m.name\n meths_hash[klass] ||= {} ## class\n meths_hash[klass][meth] ||= {} ## meth\n meths_hash[klass][meth][:attr_meth] = m.reader? || m.writer? ## %bool indicating whether meth is attribute reader or writer\n meths_hash[klass][meth][:params] ||= {} ## params\n m.tags(:param).each { |param|\n if param.types\n meths_hash[klass][meth][:params][param.name] = {}\n begin\n meths_hash[klass][meth][:params][param.name][:type] = YARDTC::Parser.parse(param.types) if param.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Parameter: #{param.name}, Type: #{param.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:params][param.name][:doc] = param.text.force_encoding 'utf-8' if param.text && !param.text.empty?\n end\n }\n m.tags(:return).each { |ret|\n ## should be at most 1 return type\n if ret.types\n meths_hash[klass][meth][:return] = {}\n begin\n meths_hash[klass][meth][:return][:type] = YARDTC::Parser.parse(ret.types) if ret.types \n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Return, Type: #{ret.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:return][:doc] = ret.text.force_encoding 'utf-8' if ret.text && !ret.text.empty?\n end\n }\n\n ## handle block types\n if m.tag(:yield) || !m.tags(:yieldparam).empty? || m.tag(:yieldreturn)\n meths_hash[klass][meth][:block] = {}\n meths_hash[klass][meth][:block][:doc] = m.tag(:yield).text if m.tag(:yield) && m.tag(:yield).text && !m.tag(:yield).text.empty?\n meths_hash[klass][meth][:block][:params] = {} \n if !m.tags(:yieldparam).empty?\n m.tags(:yieldparam).each { |yp|\n if yp.types\n meths_hash[klass][meth][:block][:params][yp.name] = {}\n ## TODO: handle multiple types\n begin\n meths_hash[klass][meth][:block][:params][yp.name][:type] = YARDTC::Parser.parse(yp.types) if yp.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Block Parameter: #{yp.name}, Type: #{yp.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:block][:params][yp.name][:doc] = yp.text if yp.text && !yp.text.empty?\n end\n }\n end\n\n if (yr = m.tag(:yieldreturn))\n meths_hash[klass][meth][:block][:return] = {}\n ## TODO: handle multiple types\n begin\n meths_hash[klass][meth][:block][:return][:type] = YARDTC::Parser.parse(yr.types) if yr.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Block Return, Type: #{yr.types}, File: #{m.file}\") } \n end\n meths_hash[klass][meth][:block][:return][:doc] = yr.text if yr.text && !yr.text.empty?\n end\n \n end\n\n ## m.source is the source code for the method\n ## m.is_explicit? is true iff the method is defined explicitly in source.\n ## e.g., attribute methods are often not explicitly defined.\n if m.source && m.is_explicit?\n source = m.source.force_encoding 'utf-8'\n meths_hash[klass][meth][:source] = source\n begin\n parsed = Parser::CurrentRuby.parse source\n #meths_hash[klass][meth][:source_parsed] = parsed.to_s.force_encoding 'utf-8'\n meths_hash[klass][meth][:source_tokenized] = $tokens.to_s.force_encoding 'utf-8'\n $tokens = []\n rescue; end\n end\n meths_hash[klass][meth][:docstring] = m.docstring.force_encoding 'utf-8' if m.docstring\n }\n return meths_hash\nend",
"def hide_methods(mod, except_defaults, *stuff)\n options = stuff.last.is_a?(Hash) ? stuff.pop : {}\n include_ancestors = options.fetch(:ancestors){false}\n except = Array(options.fetch(:except){except_defaults})\n protect = Array(options[:protect])\n except_methods = collect_methods(true, *except)\n protect_methods = collect_methods(true, *protect)\n methods_to_hide = collect_methods(include_ancestors, *stuff)\n (methods_to_hide - except_methods).each do |method_name|\n mod.module_eval do\n next unless method_defined?(method_name)\n if protect_methods.include?(method_name)\n protected method_name\n else\n private method_name\n end\n end\n end\n end",
"def open!(*methods)\n # Only select string and symbols, any other type of key is allowed,\n # it just won't be accessible via dynamic methods.\n methods = methods.select{ |x| String === x || Symbol === x }\n if methods.any?{ |m| m.to_s.start_with?('__') }\n raise ArgumentError, \"cannot open shadow methods\"\n end\n # only public methods need be made protected\n methods = methods.map{ |x| x.to_sym }\n methods = methods & public_methods(true).map{ |x| x.to_sym }\n if @safe\n raise ArgumentError, \"cannot set public method\" unless methods.empty?\n else\n (class << self; self; end).class_eval{ protected *methods }\n end\n methods\n end",
"def unmodulize(*method_syms)\n method_syms.each do |method_sym|\n methname = method_sym.to_s\n orig_methname_sym = \"#{methname}_before_modulize\".to_sym\n if instance_methods(false).include?(orig_methname_sym) # if it was modulized\n class_eval <<-EOM\n alias_method method_sym, orig_methname_sym\n remove_method orig_methname_sym\n EOM\n end\n end\n end",
"def create_methods_from_instance(instance)\n instance.public_methods(false).each do |method_name|\n add_method(instance, method_name)\n end\n end",
"def private_methods(all=true) end",
"def emit_methods_arrays\n @symbol_table.map do |cname, chash|\n if chash.has_key? :functions_def\n id2fun_records = chash[:functions_def].map do |fname,farray|\n fdef = farray.first\n args_number = fdef[2].rest.length\n if fdef[0] == :stdlib_defn\n # Method defined in stdlib\n [fname, ('&'+fdef[1].to_s).to_sym, :NULL]\n else\n # Method defined in user code\n [fname, :NULL, :NULL]\n end \n end\n HashBuilder.emit_table(cname, HashElemStruct, id2fun_records)\n end\n end.join\n end",
"def def_mutation_method(*meths)\n meths.each do |meth|\n instance_eval(\"def #{meth}!(*args, &block); mutation_method(:#{meth}, *args, &block) end\")\n end\n end",
"def methods(*names)\n methods = []\n ast.traverse do |node|\n if match?(:method, node, names)\n methods << node\n yield node if block_given?\n end\n end\n methods\n end",
"def methods_to_try(obj)\n ret = obj.methods.map(&:intern)\n blacklist = obj.is_a?(Module) ? CLASS_METHOD_BLACKLIST : INSTANCE_METHOD_BLACKLIST\n klass = obj.is_a?(Module) ? obj : obj.class\n\n klass.ancestors.each { |ancestor| ret -= blacklist[ancestor.to_s.intern] }\n\n # 1.8.7 lacks Symbol#<=>\n ret.sort_by(&:to_s)\n end",
"def matchMethodsInClasses(classList, type, mname)\n res = []\n \n for cname in classList\n cl = findClass(cname)\n res.concat cl.findMethods(mname, type == \"::\")\n# meths.each {|m| res << \"#{cname}#{m.type=='class'?'::':'#'}#{m.name}\" }\n end\n\n return res\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(res)\n end\n end",
"def not_sandboxed_methods(include_superclasses = false, allowed_mixins=[], *disallowed_methods)\n\n __the_methods_to_check = public_instance_methods(false)\n puts \"#{self.name}: direct: #{__the_methods_to_check.inspect}\" if $DEBUG\n if include_superclasses\n clz = self.superclass\n while !clz.nil?\n unless clz == Object || (defined? BasicObject && clz == BasicObject)\n puts \"#{self.name}: #{clz.name}: #{clz.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += clz.public_instance_methods(false)\n end\n clz = clz.superclass\n end\n \n if allowed_mixins.length > 0\n #we include any mixins\n for m in self.included_modules\n if allowed_mixins.include?(m)\n puts \"#{self.name}: #{m.name}: #{m.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += m.public_instance_methods(false)\n end\n end\n end\n end\n \n __the_methods_to_check << \"nil?\".intern\n \n __the_methods_to_check.uniq!\n \n unless disallowed_methods.nil? || disallowed_methods.length == 0\n not_bang = false\n if disallowed_methods.include?(:bang_methods) #just remove all xxx! methods that modify in place\n __the_methods_to_check.reject! { |meth| meth.to_s[-1, 1] == \"!\"}\n not_bang = true\n end\n unless not_bang || disallowed_methods.length > 1\n __the_methods_to_check.reject! { |meth| disallowed_methods.include?(meth)}\n end\n end\n \n puts \"#{self.name}: #{__the_methods_to_check.inspect}\" if $DEBUG\n \n sandboxed_methods(*__the_methods_to_check)\n \n \n \n end",
"def helper_method(*methods); end",
"def expose_methods_with_benchmark(innervar, methods_to_expose, opts = {})\n b = opts[:benchmark]\n post_hook = opts[:post_hook]\n methods_to_expose.each do |m|\n exec = \"@#{innervar}.#{m}(*args)\"\n exec = \"XYZ::Aux.benchmark('#{m}'){#{exec}}\" if b == :all || (b.respond_to?(:include?) && b.include?(m))\n method_def = (post_hook ? \"def #{m}(*args);#{post_hook}.call(#{exec});end\" : \"def #{m}(*args);#{exec};end\")\n class_eval(method_def)\n end\n end",
"def private_delegate_methods(*symbols)\n symbols.each { |symbol| private delegate_method(symbol) }\n nil\n end",
"def _magic_insight_methods\n # We want to keep the longer of the methods by num chars in the method name, because these are the ones meant for\n # humans to see (e.g. human_time, filtered_backtrace, display_time)\n sorted = _sorted_methods\n idiomatic = _idiomatic_methods\n # So we delete the shorter of the two\n idiomatic.each do |idiom|\n sorted.each_with_index do |meth, index|\n # first one found will be the shortest, so delete and move to next idiom\n if meth.to_s =~ /#{idiom}/\n sorted.delete_at(index)\n break # to idiomatic loop\n end\n end\n end\n sorted\n end",
"def instance_modules(*mods)\n @instance_modules ||= [ \n Command::InstanceMethods, \n Command::Options::InstanceMethods\n ]\n @instance_modules += mods\n end",
"def to_donate_methods\n if should_donate? and !@methods.empty?\n fragment(\"%s;$opal.donate(self, [%s]);\" % [@compiler.parser_indent, @methods.map(&:inspect).join(', ')])\n else\n fragment(\"\")\n end\n end",
"def all_methods_with_source(string:, match_case: true)\n return [] if string.empty?\n\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_matching_methods(string, match_case)\n end\n end",
"def methods(src)\n\n # TODO This leaves out methods like [], <<, etc...maybe just check for first non-space?\n method_sigs = /def\\s+[a-z_!?.]+/\n method_names = src.scan(method_sigs).map { |sig| sig.sub(/^def /, '') }\n\n bodies = src.split(method_sigs)[1..-1] # strip off first chunk, the class beginning\n\n method_names.zip(bodies)\n end",
"def compile!( name, &block )\n # Get the already defined method\n m = instance_method( name )\n\n # Create a new method with leading underscore\n define_method( \"_#{name}\", &block )\n _m = instance_method( \"_#{name}\" )\n remove_method( \"_#{name}\" )\n\n # Define instance method\n define!( name, _m, m, &block )\n end",
"def get_methods(class_name, access_control = nil)\n if access_control\n methods(class_name).select { |method| method.access_control == access_control }\n else\n methods(class_name)\n end\n end",
"def select_methods(pattern)\n methods = []\n class_cache.keys.sort.each do |klass|\n class_cache[klass][\"instance_methods\"].map{|h|h[\"name\"]}.grep(pattern) do |name|\n method = load_cache_for(klass)[klass+'#'+name]\n methods << method if method\n end\n class_cache[klass][\"class_methods\"].map{|h|h[\"name\"]}.grep(pattern) do |name|\n method = load_cache_for(klass)[klass+'::'+name]\n methods << method if method\n end\n end\n methods\n end",
"def cache_methods(*args)\n options = args.pop if args.last.is_a?(Hash)\n methods = args\n\n methods.each do |method|\n self.cache_method(method, options)\n end\n end",
"def call\n methods = [\n limit_methods,\n pricingrule_methods\n ]\n result[:plan_methods] = methods.each_with_object({}) { |elem, acc| acc.merge!(elem) }\n end",
"def method_strings\t\n [\n \".methods\",\n \".methods(false)\",\n \".instance_methods\",\n \".instance_methods(false)\",\n \".public_methods\",\n \".public_methods(false)\",\n \".public_instance_methods\",\n \".public_instance_methods(false)\",\n \".protected_methods\",\n \".protected_methods(false)\",\n \".private_methods\",\n \".private_methods(false)\"\n ]\nend",
"def class_modules(*mods)\n @class_modules ||= [ \n Command::ClassMethods,\n Command::Options::ClassMethods,\n ]\n @class_modules += mods\n end",
"def create_methods_from_instance(instance)\n\t instance.public_methods(false).each do |method_name|\n\t add_method(instance, method_name)\n\t end\n\t end",
"def expose(*list)\n @exposed_methods ||= []\n @exposed_methods |= list\n end",
"def expand_methods(code, mdefs, meths = mdefs.keys)\n code.gsub(/^( *)\\b(#{ meths * \"|\" })\\b(?:\\((.*?)\\))?\\n/) do\n indent, meth, args = $1, $2, $3\n body = mdefs[meth.to_sym]\n body = body.body if body.is_a?(MethodDef)\n if args\n mdefs[meth.to_sym].params.zip(args.split(\", \")) do |param, arg|\n body = replace_var(body, param, arg)\n end\n end\n indent(indent.size, body)\n end\n end",
"def commands(*names, mapper: nil, use: nil, plugins_options: EMPTY_HASH, **opts)\n if names.any? || opts.any?\n @commands = names + opts.to_a\n\n @commands.each do |spec|\n type, *view = Array(spec).flatten\n\n if view.empty?\n define_command_method(type, mapper: mapper, use: use,\n plugins_options: plugins_options)\n else\n define_restricted_command_method(type, view, mapper: mapper, use: use,\n plugins_options: plugins_options)\n end\n end\n else\n @commands ||= []\n end\n end",
"def dynamic_define_methods_apply(targetModule, *methodSpecsNom, &dynBlok)\n eye = :ddm_apl\n eyeTale = 'DDM APL'\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTale, \"targetModule >#{targetModule.class}< >#{targetModule}< specs >#{methodSpecsNom.class}< >#{methodSpecsNom.size}< >#{methodSpecsNom.class}< dynBlok >#{dynBlok}<\")\n\n # validate specs\n methodSpecsRdc = dynamic_define_methods_reduce_specifications(targetModule, *methodSpecsNom)\n \n # any methods specs with logic to apply?\n methodSpecs = methodSpecsRdc\n \n # try to merge all the text methods together\n\n textMethods = []\n \n methodSpecs.each_with_index do | methodSpec, methodNdx |\n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ms(eye, eyeTale, \"methodNdx >#{methodNdx}< methodSpec >#{methodSpec.class}< >#{methodSpec.class}<\")\n\n potrubi_bootstrap_mustbe_hash_or_croak(methodSpec)\n \n case (specType = methodSpec[:spec])\n when Proc then\n\n specName = potrubi_bootstrap_mustbe_string_or_croak((r = methodSpec[:name]) ? r.to_s : nil, eye, \"proc name is nil\")\n specProc = specType # potrubi_bootstrap_mustbe_proc_or_croak(mustbe_key_or_croak(methodSpec, :proc))\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"PROC BEG specName >#{specName.class}< >#{specName}< specProc >#{specProc.class}< >#{specProc}<\")\n\n if (! textMethods.empty?) then # any text methods \"waiting\"; must be defined before proc\n dynamic_define_methods_apply_texts(targetModule, *textMethods)\n textMethods.clear # none wating now\n end\n \n targetModule.__send__(:define_method, specName.to_sym, &specProc) \n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"PROC FIN specName >#{specName.class}< >#{specName}< specProc >#{specProc.class}< >#{specProc}<\")\n\n when String then textMethods << methodSpec \n when Array then textMethods << methodSpec\n else\n potrubi_bootstrap_surprise_exception(specType, \"methodSpec >#{methodSpec.class}< >#{methodSpec.class}< specType >#{specType.class}< is what?\")\n end\n\n end\n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"TXTSZ\", potrubi_bootstrap_logger_fmt_kls(textMethods: textMethods))\n \n textMethods.empty? || dynamic_define_methods_apply_texts(targetModule, *textMethods)\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTale, \"targetModule >#{targetModule.class}< >#{targetModule}< specs >#{methodSpecs.class}< >#{methodSpecs.size}<\")\n\n self\n \n end",
"def filter_for(method_name)\n methods = Array.new\n \n @filter_chain.each do |method_to_call, option|\n if option == true\n methods << method_to_call\n elsif option.has_key?(:only) && option[:only].include?(method_name.to_sym)\n methods << method_to_call \n elsif option.has_key?(:except) && !option[:except].include?(method_name.to_sym)\n methods << method_to_call \n end\n end\n\n return methods.uniq\n end",
"def close!(*methods)\n (class << self; self; end).class_eval{ public *methods }\n methods\n end",
"def load_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n methods = []\n\n methods << load_method(store, :class_methods, ancestor, '::', method) if\n [:class, :both].include? types\n\n methods << load_method(store, :instance_methods, ancestor, '#', method) if\n [:instance, :both].include? types\n\n found << [store, methods.compact]\n end\n\n found.reject do |path, methods| methods.empty? end\n end",
"def add_method_list out, methods, name\n return if methods.empty?\n\n out << RDoc::Markup::Heading.new(1, \"#{name}:\")\n out << RDoc::Markup::BlankLine.new\n\n if @use_stdout and !@interactive then\n out.concat methods.map { |method|\n RDoc::Markup::Verbatim.new method\n }\n else\n out << RDoc::Markup::IndentedParagraph.new(2, methods.join(', '))\n end\n\n out << RDoc::Markup::BlankLine.new\n end",
"def load_methods_matching name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n methods = []\n methods << load_method(store, :class_methods, ancestor, '::', method) if\n [:class, :both].include? types\n methods << load_method(store, :instance_methods, ancestor, '#', method) if\n [:instance, :both].include? types\n found << [store, methods.compact]\n end\n found.reject do |path, methods| methods.empty? end\n end",
"def find_methods name\n klass, selector, method = parse_name name\n\n types = method_type selector\n\n klasses = nil\n ambiguous = klass.empty?\n\n if ambiguous then\n klasses = classes.keys\n else\n klasses = ancestors_of klass\n klasses.unshift klass\n end\n\n methods = []\n\n klasses.each do |ancestor|\n ancestors = classes[ancestor]\n\n next unless ancestors\n\n klass = ancestor if ambiguous\n\n ancestors.each do |store|\n methods << [store, klass, ancestor, types, method]\n end\n end\n\n methods = methods.sort_by do |_, k, a, _, m|\n [k, a, m].compact\n end\n\n methods.each do |item|\n yield(*item) # :yields: store, klass, ancestor, types, method\n end\n\n self\n end",
"def def_wrapper_methods(*methods)\n methods.each() do |name|\n define_method(name) do |*args|\n (str, pos, len, *opt) = args\n raise(ArgumentError, \"argument pos is negative\") if pos && pos < 0\n str_len = bytesize(str)\n pos ||= 0\n pos = str_len if pos > str_len\n len = str_len - pos if !len || len < 0 || len > str_len - pos\n add_encoding(@unsafe.__send__(name, str, pos, len, *opt))\n end\n end\n end",
"def find_methods name\n klass, selector, method = parse_name name\n types = method_type selector\n klasses = nil\n ambiguous = klass.empty?\n if ambiguous then\n klasses = classes.keys\n else\n klasses = ancestors_of klass\n klasses.unshift klass\n end\n methods = []\n klasses.each do |ancestor|\n ancestors = classes[ancestor]\n next unless ancestors\n klass = ancestor if ambiguous\n ancestors.each do |store|\n methods << [store, klass, ancestor, types, method]\n end\n end\n methods = methods.sort_by do |_, k, a, _, m|\n [k, a, m].compact\n end\n methods.each do |item|\n yield(*item) # :yields: store, klass, ancestor, types, method\n end\n self\n end",
"def instance_method_list\n warn '#instance_method_list is obsoleted, please use #instance_methods'\n @instance_methods ||= method_list.reject { |a| a.singleton }\n end",
"def alias_methods(*method_names)\r\n trait = self\r\n module_or_self.module_eval do\r\n existing_instance_methods = method_names & trait.instance_methods\r\n existing_instance_methods.each do |method_name|\r\n alias_method trait.aliased_method_name(method_name), method_name\r\n end\r\n end\r\n end",
"def compile_all(options = {})\n # Each tasks\n @tasks.keys.map do |name|\n # Compile the task\n compile name, options\n end\n end",
"def add_all_commands(mode = :verbose )\n \tbegin\n \t @exclude ||= []\t\n \t all = private_methods(false) - %w(initialize method_missing) - @exclude\n \t add_commands all, mode\n \trescue Exception => e\n\t puts_ex e\n\t end \n \tend",
"def expose(*meths)\n @exposed ||= []\n meths.each do |meth|\n @exposed << meth unless @exposed.include?(meth)\n end\n @exposed\n end",
"def get_methods(mod)\n methods = []\n mod.constants.sort.each do |c|\n mod.const_get(c).singleton_methods.sort.each do |m|\n methods << \"#{c}::#{m}\"\n end\n end\n methods\nend",
"def method_missing(method_sym, *args, &block)\n method_sym = method_sym.slice(1, method_sym.length) if method_sym[0] == \"_\"\n map { |value| value.send(method_sym, *args, &block) }\n end",
"def callable_methods\n methods.grep(/^_\\w+[^_]$/)\n end",
"def chain_methods(methods)\n methods.inject(nil) do |memo, acc|\n target = memo ? memo : self\n target.respond_to?(acc) ? target.send(acc) : memo\n end\n end",
"def create_with_methods!\n @parameters.reject(&:header?).each do |parameter|\n self.class.define_method(:\"with_#{parameter.to_method_name}\") do |value|\n @with_params[parameter.name] = value\n self\n end\n end\n end",
"def sort_and_clean_compilers(compilers, options)\n return compilers unless options['compilers'] && options['compilers'].length > 0\n compilers.select!{ |c| options['compilers'].include?(c[:class].to_s.demodulize.downcase) }\n compilers.sort_by!{ |c| options['compilers'].index(c[:class].to_s.demodulize.downcase) }\n end",
"def delegate_methods(*symbols)\n symbols.each { |symbol| delegate_method(symbol) }\n nil\n end",
"def initialize_methods_etc\n @method_list = []\n @attributes = []\n @aliases = []\n @requires = []\n @includes = []\n @constants = []\n\n # This Hash maps a method name to a list of unmatched aliases (aliases of\n # a method not yet encountered).\n @unmatched_alias_lists = {}\n end",
"def remove_all_methods!\n instance_methods.each do |method_name|\n # Important -- we use Class#remove_method, not Class#undef_method, which does something that's different in\n # some important ways.\n remove_method(method_name) if @methods_defined[method_name.to_sym]\n end\n\n @class_methods_module.instance_methods.each do |method_name|\n @class_methods_module.send(:remove_method, method_name) if @class_methods_defined[method_name]\n end\n end",
"def map_send(method, options={}, &block)\n\n map = {}\n list.each do |file|\n if dest = block.call(file)\n map[file] = dest\n end\n end\n\n if options[:safe] or !options[:force] or SAFE_METHODS.include?(method) \n ensure_safe(map)\n end\n\n map.each do |src, dest|\n fileutils.__send__(method, src, dest, options)\n end\n FileList.all(*map.values)\n end",
"def private(*syms) end",
"def eliminate_methods(methods, matcher)\n eliminated = []\n i = 0\n while i < methods.size\n method_info = methods[i]\n method_name = method_info.full_name\n if matcher === method_name\n raise \"can't eliminate root method\" if method_info.root?\n eliminated << methods.delete_at(i)\n method_info.eliminate!\n else\n i += 1\n end\n end\n eliminated\n end",
"def list_methods_matching_orig name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n found.push(*matches)\n end\n end\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n found.push(*matches)\n end\n end\n found.uniq\n end",
"def add_custom_methods!(dynamic_methods_module, target_class, options = { })\n cn = column_name\n\n custom_methods.each do |custom_method|\n mn = custom_method.to_s\n mn = \"#{options[:prefix]}_#{mn}\" if options[:prefix]\n\n if target_class._flex_columns_safe_to_define_method?(mn)\n dynamic_methods_module.define_method(mn) do |*args, &block|\n flex_object = _flex_column_object_for(cn)\n flex_object.send(custom_method, *args, &block)\n end\n\n dynamic_methods_module.private(custom_method) if options[:visibility] == :private\n end\n end\n end",
"def readonly(*syms)\n return if syms.size == 0 # If no arguments, do nothing \n code = \"\" # Start with an empty string of code \n # Generate a string of Ruby code to define attribute reader methods.\n # Notice how the symbol is interpolated into the string of code.\n syms.each do |s|\n code << \"def #{s}; #{s}; end\\n\"\n end \n # Finally, class_eval the generated code to create instance methods.\n class_eval code \n end",
"def faker_methods(mod)\n methods = mod.methods - Module.methods - UTILS_METHODS\n\n # For Company.name (et al), don't discard :name if it was reimplemented\n methods << :name if mod.send(:name) != mod.to_s\n methods\nend",
"def list_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n\n found.concat matches\n end\n end\n\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n\n found.concat matches\n end\n end\n\n found.uniq\n end",
"def get_methods(fqns, scope: T.unsafe(nil), visibility: T.unsafe(nil), deep: T.unsafe(nil)); end",
"def included_meths(opts = T.unsafe(nil)); end",
"def all_access_to(options = {})\n options.assert_valid_keys(:only, :except)\n if options.has_key?(:only)\n self.public_actions = [options[:only]].flatten.compact.collect{ |a| a.to_sym }\n end\n if options.has_key?(:except)\n instance_methods_array = instance_methods(false).collect{ |a| a.to_sym }\n opts = [options[:except]].flatten.compact.collect{ |a| a.to_sym }\n self.public_actions = opts - instance_methods_array\n self.private_actions = opts\n end\n end",
"def create_methods!\n return unless type == :normal\n\n fn = name\n dmm = session_class._dynamic_methods_module\n mn = name.to_s.downcase\n\n dmm.define_method(mn) do\n self[fn]\n end\n\n dmm.define_method(\"#{mn}=\") do |new_value|\n self[fn] = new_value\n end\n\n if visibility == :private\n dmm.send(:private, mn, \"#{mn}=\".to_sym)\n end\n end",
"def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end",
"def filter(type_and_methods)\n type = type_and_methods.keys.first\n Array(type_and_methods[type]).each do |method|\n filters(type) <<\n case method\n when Symbol, String then proc { |message| send(method, message) } \n when Proc then method\n end\n end\n end",
"def for_each_gosu_method\n require \"yard\"\n YARD::Registry.load!\n \n # Utility functions\n YARD::Registry.at(\"Gosu\").meths.each do |meth|\n args = meth.parameters.map { |arg| arg.compact.join(\" = \") }\n yield \"Module Methods\", \"Gosu.#{meth.name}\", args, nil\n end\n \n # Methods and class methods\n YARD::Registry.all(:class).each do |cls|\n next if %w(Color GLTexInfo).include? cls.name\n \n cls.meths.each do |meth|\n # Ignore methods whose previous comment starts with @deprecated\n if meth.has_tag? :deprecated\n puts \"Skipped #{meth.path} (@deprecated)\"\n next\n end\n \n # Ignore explicit and attr setters (methods that end in a =)\n next if meth.name.to_s[-1, 1] == \"=\"\n \n # Ignore methods with only one argument\n next if meth.parameters.empty?\n \n method_name = meth.name.to_s\n method_name = \"self.#{method_name}\" if meth.scope == :class\n args = meth.parameters.map { |arg| arg.compact.join(\" = \") }\n \n # Support for static methods\n # e.g. self.load_tiles<tab> => Image.load_tiles<tab>\n if cls.name != :Window\n method_name.sub! \"self.\", \"#{cls.name}.\"\n else\n # Not in the window though\n method_name.sub! \"self.\", \"\"\n end\n \n # Ignore methods that are never called directly.\n next if %w(button_up button_down).include? method_name\n \n if method_name == \"initialize\"\n next if cls.name == :Window # Nobody wants to call Window.new\n method_name = \"#{cls.name}.new\"\n end\n \n if args.last[0, 1] == \"&\"\n block_name = args.last[1..-1].gsub(\"_\", \" \") + \" here\"\n args.pop\n end\n \n yield cls.name.to_s, method_name, args, block_name\n end\n end\nend",
"def remove_all_methods!\n instance_methods.each do |method_name|\n # Important -- we use Class#remove_method, not Class#undef_method, which does something that's different in\n # some important ways.\n remove_method(method_name) if @methods_defined[method_name.to_sym]\n end\n end",
"def rbenchmarker_validation_check(options)\n raise Rbenchmarker::TargetFilePathError if options[:all] && !options[:all].is_a?(String)\n raise Rbenchmarker::TargetFilePathError if options[:all] && !File.file?(options[:all])\n raise Rbenchmarker::OnlyMethodDesignationError if options[:only] && !options[:only].is_a?(Array)\n raise Rbenchmarker::OnlyMethodDesignationError if options[:only] && !options[:only].all? do |method_name|\n method_name.is_a?(String) || method_name.is_a?(Symbol)\n end\n raise Rbenchmarker::ExceptMethodDesignationError if options[:except] && !options[:except].is_a?(Array)\n raise Rbenchmarker::ExceptMethodDesignationError if options[:except] && !options[:except].all? do |method_name|\n method_name.is_a?(String) || method_name.is_a?(Symbol)\n end\n raise Rbenchmarker::AddedMethodDesignationError if options[:added] && !options[:added].is_a?(Array)\n raise Rbenchmarker::AddedMethodDesignationError if options[:added] && !options[:added].all? do |method_name|\n method_name.is_a?(String) || method_name.is_a?(Symbol)\n end\n raise Rbenchmarker::PrependModuleDesignationError if options[:prepend] && !options[:prepend].is_a?(Array)\n raise Rbenchmarker::PrependModuleDesignationError if options[:prepend] && !options[:prepend].all? do |obj|\n obj.class.to_s == 'Module'\n end\n raise Rbenchmarker::IncludeModuleDesignationError if options[:include] && !options[:include].is_a?(Array)\n raise Rbenchmarker::IncludeModuleDesignationError if options[:include] && !options[:include].all? do |obj|\n obj.class.to_s == 'Module'\n end\n raise Rbenchmarker::ExtendModuleDesignationError if options[:extend] && !options[:extend].is_a?(Array)\n raise Rbenchmarker::ExtendModuleDesignationError if options[:extend] && !options[:extend].all? do |obj|\n obj.class.to_s == 'Module'\n end\n end",
"def class_methods\n all_methods().find_all{|m| m.singleton && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end",
"def only(*methods)\r\n with_options(only: methods)\r\n end",
"def method_missing(method_sym, *arguments, &block)\n method = method_sym.to_s\n\n #puts \"%s %s %s\" % [\"---- \", method, \" ----\"]\n #\n if method =~ /^[A-Z]\\d{2}(_\\d{2})?/\n Array(parse(get_spec(method))).join(', ') rescue ''\n elsif respond_to?((/(\\w+)/.match(method))[0])\n instance_eval(method) rescue ''\n # for testing:\n elsif %w(E_STRING E_MULTI_STRING E_NUMBER E_DATETIME E_DATE E_TIME E_YES_NO E_SINGLE E_MULTIPLE E_ALLOW_NEGATIVE E_LOOKUP).include?(method)\n Array(parse(get_spec(method))).join(', ') rescue ''\n else\n super\n end\n end",
"def __list_helper_methods\n # avoiding '__self__' and '__id__' symbols with last regex part\n methods.grep(/^#{@@helper_start_with}.*?[^__]$/) do |method|\n method.to_s\n end\n end",
"def compile!( name, &block )\n define_method name, &block\n method = instance_method name\n remove_method name\n\n block.arity == 0 ? proc { |a,p| method.bind(a).call } : proc { |a,*p| method.bind(a).call(*p) }\n end",
"def all_methods\n collect_methods unless @methods\n @all_methods = sort_members(@methods) unless @all_methods\n @all_methods\n end",
"def all_convenience_methods\n @mutex.synchronize do\n @methods.keys\n end\n end",
"def compile( method_name, op: 1, ret: 1 )\n @opts = { op: op, ret: ret }.tap do |oo|\n oo.define_singleton_method :op do self[:op] end\n oo.define_singleton_method :ret do self[:ret] end\n end\n\n # Set up compile-time argument sourcing.\n @argsrc = ArgumentSource.new\n\n # Write the method skeleton.\n initialize_writer_state\n write_method_head_skeleton( method_name )\n write_initial_pipeline\n write_method_tail_skeleton\n\n # Now that we have the skeleton, let's write the meat.\n write_method_meat\n\n puts \"head is #@head\\npipe is #@pipe\\ntail is #@tail\" if Pyper::DEBUG > 1\n\n # Finally, close any blocks and return\n autoclose_open_blocks_and_return\n end",
"def public(*syms) end",
"def methods\n return @methods if defined?(@methods)\n @methods = contents_of_type(Entities::InstanceMethod)\n @methods << contents_of_type(Entities::ClassMethod)\n @methods << contents_of_type(Entities::SingletonMethod)\n @methods.flatten!\n end",
"def interpret(mods)\n @_extensions ||= []\n [mods].flatten.compact.uniq.each { |mod|\n next if @_extensions.include?(mod)\n @_extensions << mod\n extend(mod)\n }\n self\n end",
"def add_methods_to_included_class!(dynamic_methods_module, association_name, target_class, options)\n return if (! flex_column_class.delegation_type)\n\n prefix = if options.has_key?(:prefix) then options[:prefix] else flex_column_class.delegation_prefix end\n is_private = private? || (flex_column_class.delegation_type == :private) || (options[:visibility] == :private)\n\n if is_private && options[:visibility] == :public\n raise ArgumentError, %{You asked for public visibility for methods included from association #{association_name.inspect},\n but the flex column #{flex_column_class.model_class.name}.#{flex_column_class.column_name} has its methods\n defined with private visibility (either in the flex column itself, or at the model level).\n\n You can't have methods be 'more public' in the included class than they are in the class\n they're being included from.}\n end\n\n mn = field_name\n mn = \"#{prefix}_#{mn}\".to_sym if prefix\n\n fcc = flex_column_class\n fn = field_name\n\n if target_class._flex_columns_safe_to_define_method?(mn)\n dynamic_methods_module.define_method(mn) do\n associated_object = send(association_name) || send(\"build_#{association_name}\")\n flex_column_object = associated_object.send(fcc.column_name)\n flex_column_object.send(fn)\n end\n\n dynamic_methods_module.define_method(\"#{mn}=\") do |x|\n associated_object = send(association_name) || send(\"build_#{association_name}\")\n flex_column_object = associated_object.send(fcc.column_name)\n flex_column_object.send(\"#{fn}=\", x)\n end\n\n if is_private\n dynamic_methods_module.private(mn)\n dynamic_methods_module.private(\"#{mn}=\")\n end\n end\n end",
"def resolve_component_methods( components, component_plan = [] )\n components.map do |comp|\n mths = []\n if component_plan.empty?\n mths = [ :install ] if comp.respond_to?( :install )\n else\n found = component_plan.select { |cls,_| comp.kind_of?( cls ) }\n mths = found.map { |_,mth| mth }\n mths = [ :install ] if mths.include?( :install ) #trumps\n end\n [ comp, mths ] unless mths.empty?\n end.compact\n end",
"def disable_unsafe_method(target, *names, &block)\n block ||= ->(*) {}\n names.each { |name| target.define_singleton_method name, &block }\n end"
] |
[
"0.62086856",
"0.6109597",
"0.5829991",
"0.57031196",
"0.5702612",
"0.5621867",
"0.56057113",
"0.56019765",
"0.55754775",
"0.5560452",
"0.5512844",
"0.55104476",
"0.54419714",
"0.5430024",
"0.54073",
"0.5401559",
"0.5381694",
"0.5372398",
"0.53435564",
"0.5299563",
"0.5244238",
"0.5239252",
"0.52145296",
"0.51857615",
"0.51834935",
"0.5181123",
"0.51734906",
"0.5165598",
"0.5162648",
"0.51608956",
"0.51606697",
"0.51584625",
"0.51550037",
"0.5151389",
"0.5144368",
"0.51442987",
"0.514284",
"0.5141249",
"0.5132103",
"0.5127355",
"0.51172715",
"0.51053613",
"0.5101915",
"0.50917923",
"0.5087649",
"0.5067557",
"0.5027019",
"0.5026479",
"0.50230753",
"0.50022906",
"0.49819237",
"0.49776638",
"0.4974825",
"0.49732044",
"0.49620113",
"0.49585277",
"0.49274924",
"0.4927294",
"0.49205682",
"0.49190408",
"0.49056518",
"0.4904733",
"0.49009573",
"0.48993027",
"0.48972026",
"0.4886073",
"0.48853612",
"0.48837674",
"0.48788103",
"0.48765233",
"0.48702547",
"0.4856576",
"0.4849898",
"0.4847329",
"0.48451224",
"0.4843614",
"0.4842459",
"0.48405164",
"0.4835523",
"0.48320234",
"0.48293757",
"0.48287618",
"0.4828351",
"0.48248017",
"0.48221672",
"0.4820852",
"0.4811492",
"0.48077515",
"0.48035794",
"0.48031297",
"0.47987583",
"0.47923803",
"0.47850752",
"0.47841397",
"0.47840434",
"0.4776872",
"0.4773101",
"0.47683057",
"0.47666",
"0.47616413",
"0.47535244"
] |
0.0
|
-1
|
Like hide, only hides methods at the class/module level.
|
def hide_singletons(*stuff)
hide_methods(singleton_class, [Class], *stuff)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hide!\n singleton_class.send(:define_method, :nodoc) { true }\n end",
"def hide(*stuff)\n hide_methods(self, [Object], *stuff)\n end",
"def hide; end",
"def hide; end",
"def hide_methods(mod, except_defaults, *stuff)\n options = stuff.last.is_a?(Hash) ? stuff.pop : {}\n include_ancestors = options.fetch(:ancestors){false}\n except = Array(options.fetch(:except){except_defaults})\n protect = Array(options[:protect])\n except_methods = collect_methods(true, *except)\n protect_methods = collect_methods(true, *protect)\n methods_to_hide = collect_methods(include_ancestors, *stuff)\n (methods_to_hide - except_methods).each do |method_name|\n mod.module_eval do\n next unless method_defined?(method_name)\n if protect_methods.include?(method_name)\n protected method_name\n else\n private method_name\n end\n end\n end\n end",
"def hide(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored[classOrModule] = true\n\t\tend\n\tend",
"def exclude\n all - methods\n end",
"def remove_invisible min_visibility\n return if [:private, :nodoc].include? min_visibility\n remove_invisible_in @method_list, min_visibility\n remove_invisible_in @attributes, min_visibility\n remove_invisible_in @constants, min_visibility\n end",
"def getHideFrom _obj, _args\n \"_obj getHideFrom _args;\" \n end",
"def hide()\n @view__.hide\n end",
"def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end",
"def hide_existing_method(method_name)\n stow_existing_definition(method_name)\n define_proxy_method(method_name)\n end",
"def hide(&block)\n visible block ? proc { false == (instance_eval &block) } : false\n end",
"def exclude_common_methods!\r\n ExcludeCommonMethods.apply!(self)\r\n end",
"def hide!\n self[:hidden] = true\n self\n end",
"def private_methods(all=true) end",
"def unboring_methods\n if [::Class,::Module].include? self\n # Only those instance methods that we have not by virtue of being an instance of ourself\n self.methods - (self.instance_methods - self.singleton_methods)\n elsif self.is_a? ::Class\n # Only those instance methods that we have not by virtue of being a Class, unless we have overridden them\n self.methods - (::Class.instance_methods - self.singleton_methods)\n else\n # Only those instance methods that we have not by virtue of being a Module, unless we have overridden them\n self.methods - (::Module.instance_methods - self.singleton_methods)\n end\n end",
"def hide app\n app.perform :hide\n end",
"def filter_methods; end",
"def reveal(name)\n unbound_method = find_hidden_method(name)\n fail \"Don't know how to reveal method '#{name}'\" unless unbound_method\n define_method(name, unbound_method)\n end",
"def hide!\n visible(false)\n end",
"def hide!\n visible(false)\n end",
"def reveal(name)\n hidden_method = find_hidden_method(name)\n fail \"Don't know how to reveal method '#{name}'\" unless hidden_method\n define_method(name, hidden_method)\n end",
"def hide\n Control.functions[__method__] ||= AU3_Function.new(\"ControlHide\", 'SSS', 'L')\n res = Control.functions[__method__].call(@title.wide, @text.wide, @c_id.wide)\n raise_unfound if res == 0\n nil\n end",
"def private_instance_methods(include_super=true) end",
"def hidden?(*)\n false\n end",
"def hideObject _obj, _args\n \"_obj hideObject _args;\" \n end",
"def hide_unless(condition)\n hide(:unless => condition)\n end",
"def unhide app\n app.perform :unhide\n end",
"def hide_action(*names)\n write_inheritable_attribute(:hidden_actions, hidden_actions | names.collect { |n| n.to_s })\n end",
"def hide_docs(command)\n def command.nodoc; true end\n end",
"def hidden?\n end",
"def check_only_methods\n end",
"def public\n Rubinius::VariableScope.of_sender.method_visibility = nil\n end",
"def unboring_instance_methods\n if [::BasicObject,::Object,::Kernel].include? self\n self.instance_methods\n # elsif [Class,Module].include? self\n # self.instance_methods - Object.instance_methods\n else\n self.instance_methods - (::Object.instance_methods - self.local_instance_methods)\n end\n end",
"def a_private_method\n end",
"def hide_elements\n true\n end",
"def a_private_method\n\tend",
"def hide_as(arg = nil, &proc) # :yields: field_def or nil\n @view_control.hide_as(arg, &proc)\n end",
"def expose(name)\n unless public_method_defined?(name)\n raise NameError, \"undefined method `#{name}' for class `#{self.name}'\"\n end\n\n exposed_methods[name] = true\n end",
"def class_methods\n all_methods().find_all{|m| m.singleton && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end",
"def hide?\n @hide\n end",
"def internal_methods; end",
"def hidden_apis; end",
"def protected_methods(all=true) end",
"def isHidden _args\n \"isHidden _args;\" \n end",
"def method_visibility(method)\n if private_method_defined?(method)\n :private\n elsif protected_method_defined?(method)\n :protected\n else\n :public\n end\n end",
"def hide_current_state\n\t\t@classes = Array.new\n\t\tObjectSpace.each_object(Class) do |klass|\n\t\t\t@classes.push klass\n\t\tend\n\t\t@modules = Hash.new\n\t\tObjectSpace.each_object(Module) do |mod|\n\t\t\t@modules[mod] = true\n\t\tend\n\tend",
"def hidden?()\n not visible?()\n end",
"def mixes_in_class_methods(mod)\n Private::Mixins.declare_mixes_in_class_methods(self, mod)\n end",
"def hide!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 108 )\n\n \n # - - - - main rule block - - - -\n # at line 967:5: 'hide' ( IGNORABLE )* '{'\n match( \"hide\" )\n # at line 967:12: ( IGNORABLE )*\n while true # decision 56\n alt_56 = 2\n look_56_0 = @input.peek( 1 )\n\n if ( look_56_0 == 0x9 || look_56_0 == 0xc || look_56_0 == 0x20 || look_56_0 == 0x2f || look_56_0 == 0x5c || look_56_0 == 0xa0 )\n alt_56 = 1\n\n end\n case alt_56\n when 1\n # at line 967:12: IGNORABLE\n ignorable!\n\n else\n break # out of loop for decision 56\n end\n end # loop for decision 56\n match( 0x7b )\n # --> action\n quick_balance( LBRACE, RBRACE ) \n # <-- action\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 108 )\n\n end",
"def hideElements \n @hideElements.each do |element|\n element.hide\n end\n end",
"def hide_tree(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored_tree[classOrModule] = true\n\t\tend\n\tend",
"def hide\n @peer.hide\n end",
"def hidden_field(method, options = T.unsafe(nil)); end",
"def get_all_unused_methods(access_control = nil)\n @methods.inject([]) do |unused_methods, (_class_name, methods)|\n unused_methods +=\n if access_control\n methods.select { |method| method.access_control == access_control && !method.used }\n else\n methods.reject(&:used)\n end\n end.reject { |method| method.access_control == 'public' && @possible_methods[method.method_name] }\n end",
"def hide\n @visible = false\n self\n end",
"def hide_command!\n Rails::Command.hidden_commands << self\n end",
"def hide\n super\n\n Vedeu.buffers.by_name(name).hide\n end",
"def forbidding(*args, &block)\n\t\t\t\t\tself.instruction.forbidding *args, &block\n\t\t\t\tend",
"def private_method; end",
"def hidden?\n not visible\n end",
"def hide_if(condition)\n hide(:if => condition)\n end",
"def method_removed(*) end",
"def private_method\n\tend",
"def private_method\n\tend",
"def hide_action(*names)\n self._hidden_actions = self._hidden_actions | names.map { |n| n.to_s }\n end",
"def remove_all_methods!\n instance_methods.each do |method_name|\n # Important -- we use Class#remove_method, not Class#undef_method, which does something that's different in\n # some important ways.\n remove_method(method_name) if @methods_defined[method_name.to_sym]\n end\n\n @class_methods_module.instance_methods.each do |method_name|\n @class_methods_module.send(:remove_method, method_name) if @class_methods_defined[method_name]\n end\n end",
"def private_method\n end",
"def not_sandboxed_methods(include_superclasses = false, allowed_mixins=[], *disallowed_methods)\n\n __the_methods_to_check = public_instance_methods(false)\n puts \"#{self.name}: direct: #{__the_methods_to_check.inspect}\" if $DEBUG\n if include_superclasses\n clz = self.superclass\n while !clz.nil?\n unless clz == Object || (defined? BasicObject && clz == BasicObject)\n puts \"#{self.name}: #{clz.name}: #{clz.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += clz.public_instance_methods(false)\n end\n clz = clz.superclass\n end\n \n if allowed_mixins.length > 0\n #we include any mixins\n for m in self.included_modules\n if allowed_mixins.include?(m)\n puts \"#{self.name}: #{m.name}: #{m.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += m.public_instance_methods(false)\n end\n end\n end\n end\n \n __the_methods_to_check << \"nil?\".intern\n \n __the_methods_to_check.uniq!\n \n unless disallowed_methods.nil? || disallowed_methods.length == 0\n not_bang = false\n if disallowed_methods.include?(:bang_methods) #just remove all xxx! methods that modify in place\n __the_methods_to_check.reject! { |meth| meth.to_s[-1, 1] == \"!\"}\n not_bang = true\n end\n unless not_bang || disallowed_methods.length > 1\n __the_methods_to_check.reject! { |meth| disallowed_methods.include?(meth)}\n end\n end\n \n puts \"#{self.name}: #{__the_methods_to_check.inspect}\" if $DEBUG\n \n sandboxed_methods(*__the_methods_to_check)\n \n \n \n end",
"def instance_methods\n all_methods().find_all{|m| (!m.singleton) && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end",
"def hide\n client.post('/api/hide', id: read_attribute(:name))\n end",
"def hide_secret\n @is_showing_secret = false\n # TODO secret should be using a JPanel or something, not a dialog.\n end",
"def hidden?\n classes.include?('hidden')\n end",
"def remove_invisible_in array, min_visibility # :nodoc:\n if min_visibility == :public then\n array.reject! { |e|\n e.visibility != :public and not e.force_documentation\n }\n else\n array.reject! { |e|\n e.visibility == :private and not e.force_documentation\n }\n end\n end",
"def not_hidden?\n not hidden\n end",
"def hide(*values)\n values.inject(self) { |res, val| res._hide(val) or fail ArgumentError, \"Unknown value for hide: #{val}\" }\n end",
"def remove_method(sym) end",
"def hidden?()\n @view__.hidden?\n end",
"def hidden!\n @hidden = true\n self\n end",
"def privatize_non_exported_methods(singleton, symbols)\n singleton.instance_methods(false).each do |sym|\n next if symbols.include?(sym)\n\n singleton.send(:private, sym)\n end\n end",
"def class_unmock(*methods)\n return self.class.class_unmock(*methods) if !self.is_a?(Module)\n do_unmock(methods, :instance, self)\n end",
"def make_hidden\n @linkage_vis = :hidden\n end",
"def internal_methods\n controller = self\n\n controller = controller.superclass until controller.abstract?\n controller.public_instance_methods(true)\n end",
"def private(name)\n if entry = @method_table.lookup(name)\n entry.visibility = :private\n end\n end",
"def exposed_methods\n @exposed_methods ||= from_superclass(:exposed_methods, {}).dup\n end",
"def test_Method_InstanceMethods_unbind\n\t\tpass\n\tend",
"def remove_all_methods!\n instance_methods.each do |method_name|\n # Important -- we use Class#remove_method, not Class#undef_method, which does something that's different in\n # some important ways.\n remove_method(method_name) if @methods_defined[method_name.to_sym]\n end\n end",
"def protected_instance_methods(include_super=true) end",
"def not_a_member_hops\n $tracer.trace(__method__)\n #unit_test_no_generate: not_a_member_hops, a.className(create_ats_regex_string(\"ats-nonmember\"))\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-nonmember\")), __method__, self)\n end",
"def invisible(stream = $stdout)\n stream.print(hide)\n yield\n ensure\n stream.print(show)\n end",
"def hidden?\n false\n end",
"def reveal(name)\n bound_method = nil\n unbound_method = find_hidden_method(name)\n fail \"Don't know how to reveal method '#{name}'\" unless unbound_method\n define_method(name) do |*args|\n bound_method ||= unbound_method.bind(self)\n bound_method.call(*args)\n end\n end",
"def private_class_method(*rest) end",
"def remove_existing_instance_methods(mod)\n methods = Module === mod ?\n (mod.public_instance_methods(false) + mod.private_instance_methods(false) + mod.protected_instance_methods(false)) : Array(mod)\n\n methods.each do |m|\n remove_method(m) rescue nil\n end\n end",
"def undef_method (sym) end",
"def other_public_method\n end",
"def unhide\n post(\"/api/unhide\", id: fullname)\n end",
"def uncalled_signed_methods\n HasType.method_names_where(self) {|sig| ! sig.method_called? }\n end",
"def filtered_methods\n @filtered_methods ||= []\n end"
] |
[
"0.74670506",
"0.73156226",
"0.7253108",
"0.7253108",
"0.7168337",
"0.68939155",
"0.6478169",
"0.64228195",
"0.6387643",
"0.6336886",
"0.6305707",
"0.6305707",
"0.6213538",
"0.61817646",
"0.6139916",
"0.6134049",
"0.61283636",
"0.6051383",
"0.6033084",
"0.60263807",
"0.59120244",
"0.59120244",
"0.58953464",
"0.5886654",
"0.5854462",
"0.5851193",
"0.5837527",
"0.57837933",
"0.5770873",
"0.5753782",
"0.5739892",
"0.57396287",
"0.5735827",
"0.57308364",
"0.57025784",
"0.5688627",
"0.5676429",
"0.56732714",
"0.5670731",
"0.56550115",
"0.565308",
"0.5651706",
"0.5648773",
"0.5642628",
"0.56330365",
"0.56259495",
"0.5624211",
"0.5612208",
"0.561083",
"0.5570745",
"0.5566924",
"0.5545912",
"0.55401045",
"0.5537465",
"0.5531242",
"0.55266416",
"0.5520812",
"0.5520138",
"0.5517012",
"0.5515389",
"0.5510311",
"0.55055624",
"0.5502865",
"0.5498861",
"0.54822916",
"0.54822916",
"0.5455414",
"0.5452265",
"0.5451353",
"0.54492164",
"0.544838",
"0.5443242",
"0.5439497",
"0.54290307",
"0.539893",
"0.53750587",
"0.536905",
"0.5361659",
"0.5361353",
"0.5360703",
"0.53583574",
"0.5357147",
"0.53569",
"0.5352553",
"0.5344823",
"0.53381103",
"0.53298944",
"0.5329615",
"0.53290904",
"0.5327365",
"0.53210413",
"0.5308013",
"0.5307192",
"0.5305075",
"0.5303087",
"0.5297995",
"0.52860576",
"0.5281277",
"0.52753186",
"0.5268897"
] |
0.6622074
|
6
|
The shared bits of hide and hide_singletons
|
def hide_methods(mod, except_defaults, *stuff)
options = stuff.last.is_a?(Hash) ? stuff.pop : {}
include_ancestors = options.fetch(:ancestors){false}
except = Array(options.fetch(:except){except_defaults})
protect = Array(options[:protect])
except_methods = collect_methods(true, *except)
protect_methods = collect_methods(true, *protect)
methods_to_hide = collect_methods(include_ancestors, *stuff)
(methods_to_hide - except_methods).each do |method_name|
mod.module_eval do
next unless method_defined?(method_name)
if protect_methods.include?(method_name)
protected method_name
else
private method_name
end
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hide_singletons(*stuff)\n hide_methods(singleton_class, [Class], *stuff)\n end",
"def hide!\n singleton_class.send(:define_method, :nodoc) { true }\n end",
"def hide; end",
"def hide; end",
"def singleton_methods; end",
"def hide_current_state\n\t\t@classes = Array.new\n\t\tObjectSpace.each_object(Class) do |klass|\n\t\t\t@classes.push klass\n\t\tend\n\t\t@modules = Hash.new\n\t\tObjectSpace.each_object(Module) do |mod|\n\t\t\t@modules[mod] = true\n\t\tend\n\tend",
"def unexpose_singleton_method(*methods)\n _sumac_singleton_expose_preferences.unexpose(methods)\n end",
"def singleton_methods(all=true) end",
"def hide(*stuff)\n hide_methods(self, [Object], *stuff)\n end",
"def exposed_singleton_methods\n exposing_class_ancestors = self.class.ancestors.select { |ancestor| ancestor < LocalObject }\n preferences = exposing_class_ancestors.reverse\n .map(&:_sumac_instance_expose_preferences)\n preferences << _sumac_singleton_expose_preferences\n cumulative_preferences = preferences.inject(:merge)\n cumulative_preferences.exposed\n end",
"def eliminate_singletons\n @cfg.counts.inject(false) do |found, (nonterm, count)|\n next found if count != 1\n @cfg.inline! nonterm\n true\n end\n end",
"def hide_secret\n @is_showing_secret = false\n # TODO secret should be using a JPanel or something, not a dialog.\n end",
"def hiddens\n @hiddens ||= fields.select { |f| f.class == Hidden }\n end",
"def hide(*classOrModules)\n\t\tclassOrModules.each do |classOrModule|\n\t\t\t@ignored[classOrModule] = true\n\t\tend\n\tend",
"def unhide app\n app.perform :unhide\n end",
"def hide app\n app.perform :hide\n end",
"def private(*syms) end",
"def privatize_non_exported_methods(singleton, symbols)\n singleton.instance_methods(false).each do |sym|\n next if symbols.include?(sym)\n\n singleton.send(:private, sym)\n end\n end",
"def singleton_state\n super\n end",
"def getHideFrom _obj, _args\n \"_obj getHideFrom _args;\" \n end",
"def singleton!\n include Singleton\n end",
"def isolated; end",
"def isolated; end",
"def sharing \n end",
"def hidden\n hidden = @pack.sample(2)\n @pack.delete_if { |el| hidden.include?(el) }\n hidden\n end",
"def hidden?\n end",
"def hide!\n self[:hidden] = true\n self\n end",
"def all_hidden(&block)\n @all_hidden = true\n yield\n ensure\n @all_hidden = nil\n end",
"def meta_singletonify\n meta_eval { include Singleton }\n end",
"def singleton\n @singleton = true\n end",
"def make_hidden\n @linkage_vis = :hidden\n end",
"def hidden_apis; end",
"def remove_invisible min_visibility\n return if [:private, :nodoc].include? min_visibility\n remove_invisible_in @method_list, min_visibility\n remove_invisible_in @attributes, min_visibility\n remove_invisible_in @constants, min_visibility\n end",
"def hidden_apis=(_arg0); end",
"def hidden?; self[:hidden] ||= false; end",
"def use_hidden_objects?\n end",
"def hideObject _obj, _args\n \"_obj hideObject _args;\" \n end",
"def private_instance_methods(include_super=true) end",
"def hide_multitrip\n if multitrip\n true\n else\n false\n end\n end",
"def hide(symbols)\n RegLang.new(fa.hide(symbols))\n end",
"def singleton_ancestors_cache; end",
"def shared?\n sharing != 'none'\n end",
"def singleton?\n false\n end",
"def expose; end",
"def hide_word\t\n\t\thidden_word\n\tend",
"def toggle(instance)\n # do nothing\n end",
"def shared?\n sharing != 'none'\n end",
"def hideObjectGlobal _args\n \"hideObjectGlobal _args;\" \n end",
"def set_visibility_for(methods, visibility, singleton = false)\n methods_matching methods, singleton do |m|\n m.visibility = visibility\n end\n end",
"def set_visibility_for(methods, visibility, singleton = false)\n methods_matching methods, singleton do |m|\n m.visibility = visibility\n end\n end",
"def other_instances\n\t\tinstances.reject { |i| i == self }\n\tend",
"def protected(*syms) end",
"def only_once\n end",
"def exclude_from_registry; end",
"def isHidden _args\n \"isHidden _args;\" \n end",
"def hidden_namespaces; end",
"def hide\n @hidd = 1\n\n # A hidden worksheet shouldn't be active or selected.\n @selecte = 0\n @activesheet = 0\n @firstsheet = 0\n end",
"def singleton_cache; end",
"def hide_hid!\n @hide_hid = true\n end",
"def hide_elements\n true\n end",
"def hidden?(*)\n false\n end",
"def invisible(stream = $stdout)\n stream.print(hide)\n yield\n ensure\n stream.print(show)\n end",
"def one_singleton_ancestors_cache; end",
"def use_hidden_objects=(setting)\n end",
"def private_methods(all=true) end",
"def possibly_include_hidden?; end",
"def internal; end",
"def is_shared? \n if self.library_entries.where(shared: true).empty?\n return false\n else \n return true\n end \n end",
"def _shared_configuration #:nodoc:\n {:invocations => @_invocations}\n end",
"def hide()\n @view__.hide\n end",
"def private_visibility!\n super\n set_discover_groups([], discover_groups)\n end",
"def is_shared\n return @is_shared\n end",
"def hide(&block)\n visible block ? proc { false == (instance_eval &block) } : false\n end",
"def singleton0_cache; end",
"def private_delegate_methods(*symbols); end",
"def hidden_class\n model.is_hidden? ? [\"kono_utils-hidden\"] : []\n end",
"def hide?\n @hide\n end",
"def hiddens; end",
"def helper\n \"This module leaves the instance of the loaded analysis module.\"\n end",
"def hidden?\n false\n end",
"def instance_methods\n all_methods().find_all{|m| (!m.singleton) && (@options.show_all || m.visibility == :public || m.visibility == :protected)}.collect{|m| method_hash(m)}\n end",
"def hidden?\n hooked? && currently_defined?\n end",
"def hide\n \tupdate_attribute(:hidden, true)\n end",
"def hideElements \n @hideElements.each do |element|\n element.hide\n end\n end",
"def isolate_constants\n existing_constants = Object.constants\n yield\nensure\n (Object.constants - existing_constants).each do |constant|\n Object.send(:remove_const, constant)\n end\nend",
"def isolate_constants\n existing_constants = Object.constants\n yield\nensure\n (Object.constants - existing_constants).each do |constant|\n Object.send(:remove_const, constant)\n end\nend",
"def public(*syms) end",
"def non_aliases\n @non_aliases ||= classes_and_modules.reject { |cm| cm.is_alias_for }\n end",
"def shared\n Types::Boolean.deserialize(@shared)\n end",
"def unboring_methods\n if [::Class,::Module].include? self\n # Only those instance methods that we have not by virtue of being an instance of ourself\n self.methods - (self.instance_methods - self.singleton_methods)\n elsif self.is_a? ::Class\n # Only those instance methods that we have not by virtue of being a Class, unless we have overridden them\n self.methods - (::Class.instance_methods - self.singleton_methods)\n else\n # Only those instance methods that we have not by virtue of being a Module, unless we have overridden them\n self.methods - (::Module.instance_methods - self.singleton_methods)\n end\n end",
"def extend(mod)\n @singleton_setter_added = true\n super\n end",
"def extend(mod)\n @singleton_setter_added = true\n super\n end",
"def hide_loader\n end",
"def hidden_entities\n end",
"def singleton_method_added(*) end",
"def secret_method_2 # :nodoc:\n end",
"def private=(_); end",
"def instance_helper\n\tend",
"def expose_exported_constants(mod, singleton, symbols)\n defined_constants = singleton.constants(false)\n process_module_constants(mod, singleton, symbols, defined_constants)\n end",
"def hidden\n context.hidden.map(&:name)\n end"
] |
[
"0.79157335",
"0.69547397",
"0.64441645",
"0.64441645",
"0.627906",
"0.61161685",
"0.61122936",
"0.6045546",
"0.59848046",
"0.59499705",
"0.5918739",
"0.5915255",
"0.5819455",
"0.57647055",
"0.5707038",
"0.5651175",
"0.56025565",
"0.55724657",
"0.5494261",
"0.5470526",
"0.5457809",
"0.5445438",
"0.5445438",
"0.54335827",
"0.54294723",
"0.54062337",
"0.5404016",
"0.54037356",
"0.5389565",
"0.5384591",
"0.53764015",
"0.53484464",
"0.5339677",
"0.53338253",
"0.5329558",
"0.53004104",
"0.528864",
"0.5276754",
"0.5276586",
"0.5254273",
"0.5253861",
"0.52456075",
"0.5245164",
"0.5220911",
"0.52107733",
"0.5203522",
"0.5195206",
"0.5191478",
"0.5185565",
"0.5185565",
"0.51804906",
"0.5176917",
"0.51731884",
"0.5158752",
"0.51553905",
"0.51446927",
"0.5139093",
"0.5134797",
"0.51343906",
"0.51337004",
"0.513076",
"0.5124596",
"0.511765",
"0.5099534",
"0.50983596",
"0.50977784",
"0.5095023",
"0.50812626",
"0.50666827",
"0.5054945",
"0.5048237",
"0.50450623",
"0.5040826",
"0.50396603",
"0.50390595",
"0.50252336",
"0.5022409",
"0.5022169",
"0.5008353",
"0.49954724",
"0.49891356",
"0.49859297",
"0.49806854",
"0.4974996",
"0.49620587",
"0.49620587",
"0.49608707",
"0.4958473",
"0.49354714",
"0.49341103",
"0.49297854",
"0.49297854",
"0.49249545",
"0.49243575",
"0.49225375",
"0.4919927",
"0.49174926",
"0.4909881",
"0.4901125",
"0.49003533"
] |
0.5458246
|
20
|
Given a list of classes, modules, strings, and symbols, compile a combined list of methods. Classes and modules will be queried for their instance methods; strings and symbols will be treated as methods names. +include_ancestors+ determines whether to include methods defined by class/module ancestors.
|
def collect_methods(include_ancestors, *methods_or_modules)
methods_or_modules.inject([]) {|methods, method_or_module|
case method_or_module
when Symbol, String
methods << method_or_module.to_sym
when Module # also includes classes
methods.concat(method_or_module.instance_methods(include_ancestors))
when Array
methods.concat(method_or_module)
else
raise ArgumentError, "Bad argument: #{method_or_module.inspect}"
end
}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def child_methods\n literals.select {|lit| lit.kind_of? CompiledMethod }\n end",
"def with_methods\n method_names = @director ? @director.methods_wrapped.map {|m| m.name } : []\n [self.code.methods].flatten.each do |method|\n next if do_not_wrap?(method)\n next if method_names.include?(method.name)\n\n arguments = [method.arguments].flatten\n\n # Ignore methods that have non-public arguments anywhere\n if !arguments.empty? && !arguments.select {|a| !a.cpp_type.base_type.public?}.empty?\n Logger.info \"Ignoring method #{method.qualified_name} due to non-public argument type(s)\"\n next\n end\n\n if method.static?\n add_child StaticMethodNode.new(method, self)\n else\n add_child MethodNode.new(method, self)\n end\n end\n end",
"def all_c_methods\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_c_methods\n end\n end",
"def methods(src)\n\n # TODO This leaves out methods like [], <<, etc...maybe just check for first non-space?\n method_sigs = /def\\s+[a-z_!?.]+/\n method_names = src.scan(method_sigs).map { |sig| sig.sub(/^def /, '') }\n\n bodies = src.split(method_sigs)[1..-1] # strip off first chunk, the class beginning\n\n method_names.zip(bodies)\n end",
"def delegate_methods(*symbols); end",
"def included_methods\n included_modules.map(&:instance_methods).flatten\n end",
"def expand_methods(code, mdefs, meths = mdefs.keys)\n code.gsub(/^( *)\\b(#{ meths * \"|\" })\\b(?:\\((.*?)\\))?\\n/) do\n indent, meth, args = $1, $2, $3\n body = mdefs[meth.to_sym]\n body = body.body if body.is_a?(MethodDef)\n if args\n mdefs[meth.to_sym].params.zip(args.split(\", \")) do |param, arg|\n body = replace_var(body, param, arg)\n end\n end\n indent(indent.size, body)\n end\n end",
"def list_methods_matching_orig name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n found.push(*matches)\n end\n end\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n found.push(*matches)\n end\n end\n found.uniq\n end",
"def emit_methods_arrays\n @symbol_table.map do |cname, chash|\n if chash.has_key? :functions_def\n id2fun_records = chash[:functions_def].map do |fname,farray|\n fdef = farray.first\n args_number = fdef[2].rest.length\n if fdef[0] == :stdlib_defn\n # Method defined in stdlib\n [fname, ('&'+fdef[1].to_s).to_sym, :NULL]\n else\n # Method defined in user code\n [fname, :NULL, :NULL]\n end \n end\n HashBuilder.emit_table(cname, HashElemStruct, id2fun_records)\n end\n end.join\n end",
"def matchMethodsInClasses(classList, type, mname)\n res = []\n \n for cname in classList\n cl = findClass(cname)\n res.concat cl.findMethods(mname, type == \"::\")\n# meths.each {|m| res << \"#{cname}#{m.type=='class'?'::':'#'}#{m.name}\" }\n end\n\n return res\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(res)\n end\n end",
"def all_methods_with_source(string:, match_case: true)\n return [] if string.empty?\n\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_matching_methods(string, match_case)\n end\n end",
"def list_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n if types == :instance or types == :both then\n methods = store.instance_methods[ancestor]\n\n if methods then\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}##{match}\"\n end\n\n found.concat matches\n end\n end\n\n if types == :class or types == :both then\n methods = store.class_methods[ancestor]\n\n next unless methods\n matches = methods.grep(/^#{Regexp.escape method.to_s}/)\n\n matches = matches.map do |match|\n \"#{klass}::#{match}\"\n end\n\n found.concat matches\n end\n end\n\n found.uniq\n end",
"def translate_methods(translator)\n method_compilers.collect do |compiler|\n #log.debug \"Translate method #{compiler.method.name}\"\n translate_method(compiler , translator)\n end.flatten\n end",
"def all_rb_methods\n self.all_classes_and_modules.flat_map do |klassmod|\n klassmod.select_rb_methods\n end\n end",
"def included_meths(opts = T.unsafe(nil)); end",
"def load_methods_matching name\n found = []\n find_methods name do |store, klass, ancestor, types, method|\n methods = []\n methods << load_method(store, :class_methods, ancestor, '::', method) if\n [:class, :both].include? types\n methods << load_method(store, :instance_methods, ancestor, '#', method) if\n [:instance, :both].include? types\n found << [store, methods.compact]\n end\n found.reject do |path, methods| methods.empty? end\n end",
"def load_methods_matching name\n found = []\n\n find_methods name do |store, klass, ancestor, types, method|\n methods = []\n\n methods << load_method(store, :class_methods, ancestor, '::', method) if\n [:class, :both].include? types\n\n methods << load_method(store, :instance_methods, ancestor, '#', method) if\n [:instance, :both].include? types\n\n found << [store, methods.compact]\n end\n\n found.reject do |path, methods| methods.empty? end\n end",
"def define_helpers(list)\n list.each do |method_name, method_info|\n # puts \"define #{method_name}\"\n params = parse_param(method_info[\"params\"])\n if method_name[0] == \".\"\n class_eval %(\n private def #{method_name[1..-1]} (params = { #{params} })\n request(\"#{method_name}\", params)\n end\n ), __FILE__, __LINE__ - 4\n else\n class_eval %(\n def #{method_name} (params = { #{params} })\n request(\"#{method_name}\", params)\n end\n ), __FILE__, __LINE__ - 4\n end\n end\n end",
"def apply_to_methods\n # If method/methods option is set and all are String or Symbol, apply to those only, instead of\n # iterating through all methods\n methods = [@options[:method] || @options[:methods]]\n methods.compact!\n methods.flatten!\n\n if !methods.empty? && methods.all?{ |method| method.is_a?(String) || method.is_a?(Symbol) }\n methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n return\n end\n\n context.public_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n context.protected_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n\n if @options[:private_methods]\n context.private_instance_methods.each do |method|\n apply_to_method(method.to_s)\n end\n end\n end",
"def get_methods(mod)\n methods = []\n mod.constants.sort.each do |c|\n mod.const_get(c).singleton_methods.sort.each do |m|\n methods << \"#{c}::#{m}\"\n end\n end\n methods\nend",
"def interpret(mods)\n @_extensions ||= []\n [mods].flatten.compact.uniq.each { |mod|\n next if @_extensions.include?(mod)\n @_extensions << mod\n extend(mod)\n }\n self\n end",
"def build_Method_List(fpath_in, fpath_Out = nil)\r\n \r\n #########################\r\n # build: out path\r\n #########################\r\n if fpath_Out == nil\r\n\r\n # use => fpath_in string\r\n fpath_Out = fpath_in + \".METHODS\"\r\n \r\n end#if fpath_Out == nil\r\n\r\n #########################\r\n # build: methods list\r\n #########################\r\n # open file\r\n f_in = File.open(fpath_in, \"r\")\r\n \r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n\r\n # pattern (if multiple, add 'm' after the right hand of '/' char)\r\n # what to detect => 1) method name, 2) parameters \r\n #REF multiple http://stackoverflow.com/questions/5239997/regex-how-to-match-multiple-lines answered Mar 9 '11 at 0:36\r\n pattern = /void (.+)(\\(.*\\)) {/\r\n\r\n # array for method strings \r\n methods = Array.new\r\n \r\n # read lines\r\n while(line)\r\n \r\n res = (line=~ pattern)\r\n \r\n match = line.match pattern\r\n \r\n # match?\r\n if match\r\n\r\n # push matched strings into the array \r\n methods << match[1] + \"\\t\" + match[2]\r\n# methods << match[1] + match[2]\r\n \r\n end\r\n \r\n # next line\r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n \r\n end#while(line)\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_in.close\r\n \r\n #########################\r\n # write: output\r\n #########################\r\n # open file\r\n f_Out = File.open(fpath_Out, \"w\")\r\n\r\n # sort: use '!' for destructive effect\r\n methods.sort!\r\n \r\n # counter\r\n counter = 0\r\n \r\n # write each method string (with a new-line char '\\n')\r\n methods.each_with_index do |m, i|\r\n \r\n f_Out.write(\"#{i + 1}.\\t#{m}\" + \"\\n\")\r\n# f_Out.write(m + \"\\n\")\r\n \r\n counter = counter + 1\r\n \r\n end\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_Out.close\r\n \r\n #########################\r\n # return\r\n #########################\r\n return counter\r\n \r\nend",
"def process_mixins\n controller = @tracker.controllers[@current_class]\n\n controller[:includes].each do |i|\n mixin = @tracker.libs[i]\n\n next unless mixin\n\n #Process methods in alphabetical order for consistency\n methods = mixin[:public].keys.map { |n| n.to_s }.sort.map { |n| n.to_sym }\n\n methods.each do |name|\n #Need to process the method like it was in a controller in order\n #to get the renders set\n processor = Brakeman::ControllerProcessor.new(@app_tree, @tracker)\n method = mixin[:public][name][:src].deep_clone\n\n if node_type? method, :methdef\n method = processor.process_defn method\n else\n #Should be a methdef, but this will catch other cases\n method = processor.process method\n end\n\n #Then process it like any other method in the controller\n process method\n end\n end\n end",
"def get_methods(obj)\n meths = obj.methods.grep(/impl/)\n meths.map { |m| m.to_s.gsub('impl_', '') + '!' }\n end",
"def all(*methods, include_all: false)\n ducks = flockify methods, include_all: include_all\n\n ->(obj) { ducks.all? { |duck| duck.call obj } }\n end",
"def resolve_component_methods( components, component_plan = [] )\n components.map do |comp|\n mths = []\n if component_plan.empty?\n mths = [ :install ] if comp.respond_to?( :install )\n else\n found = component_plan.select { |cls,_| comp.kind_of?( cls ) }\n mths = found.map { |_,mth| mth }\n mths = [ :install ] if mths.include?( :install ) #trumps\n end\n [ comp, mths ] unless mths.empty?\n end.compact\n end",
"def get_yard_meths(meths, files = [])\n ## TODO: handle YARD options tags\n ## filter out meths without types\n meths.keep_if { |m| (!m.tags(:param).empty? && m.tags(:param).any? { |t| !t.types.nil? }) || (!m.tags(:return).empty? && m.tags(:return).any? { |t| !t.types.nil? }) } \n\n ## these methods have types automatically generated for them based on their names\n ## for our purposes, not interested in these automatically generated types\n meths.keep_if { |m| !(m[:name] == :initialize) && !m[:name].to_s.end_with?(\"?\") && !(m[:name] == :==) } \n meths_hash = {}\n meths.each { |m|\n files << m.file unless files.include? m.file\n klass = m.namespace\n meth = m.name\n meths_hash[klass] ||= {} ## class\n meths_hash[klass][meth] ||= {} ## meth\n meths_hash[klass][meth][:attr_meth] = m.reader? || m.writer? ## %bool indicating whether meth is attribute reader or writer\n meths_hash[klass][meth][:params] ||= {} ## params\n m.tags(:param).each { |param|\n if param.types\n meths_hash[klass][meth][:params][param.name] = {}\n begin\n meths_hash[klass][meth][:params][param.name][:type] = YARDTC::Parser.parse(param.types) if param.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Parameter: #{param.name}, Type: #{param.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:params][param.name][:doc] = param.text.force_encoding 'utf-8' if param.text && !param.text.empty?\n end\n }\n m.tags(:return).each { |ret|\n ## should be at most 1 return type\n if ret.types\n meths_hash[klass][meth][:return] = {}\n begin\n meths_hash[klass][meth][:return][:type] = YARDTC::Parser.parse(ret.types) if ret.types \n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Return, Type: #{ret.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:return][:doc] = ret.text.force_encoding 'utf-8' if ret.text && !ret.text.empty?\n end\n }\n\n ## handle block types\n if m.tag(:yield) || !m.tags(:yieldparam).empty? || m.tag(:yieldreturn)\n meths_hash[klass][meth][:block] = {}\n meths_hash[klass][meth][:block][:doc] = m.tag(:yield).text if m.tag(:yield) && m.tag(:yield).text && !m.tag(:yield).text.empty?\n meths_hash[klass][meth][:block][:params] = {} \n if !m.tags(:yieldparam).empty?\n m.tags(:yieldparam).each { |yp|\n if yp.types\n meths_hash[klass][meth][:block][:params][yp.name] = {}\n ## TODO: handle multiple types\n begin\n meths_hash[klass][meth][:block][:params][yp.name][:type] = YARDTC::Parser.parse(yp.types) if yp.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Block Parameter: #{yp.name}, Type: #{yp.types}, File: #{m.file}\") }\n end\n meths_hash[klass][meth][:block][:params][yp.name][:doc] = yp.text if yp.text && !yp.text.empty?\n end\n }\n end\n\n if (yr = m.tag(:yieldreturn))\n meths_hash[klass][meth][:block][:return] = {}\n ## TODO: handle multiple types\n begin\n meths_hash[klass][meth][:block][:return][:type] = YARDTC::Parser.parse(yr.types) if yr.types\n rescue SyntaxError\n File.open(ERROR_LOG, \"a\") { |f| f.puts(\"Class: #{m.namespace}, Method: #{meth}, Block Return, Type: #{yr.types}, File: #{m.file}\") } \n end\n meths_hash[klass][meth][:block][:return][:doc] = yr.text if yr.text && !yr.text.empty?\n end\n \n end\n\n ## m.source is the source code for the method\n ## m.is_explicit? is true iff the method is defined explicitly in source.\n ## e.g., attribute methods are often not explicitly defined.\n if m.source && m.is_explicit?\n source = m.source.force_encoding 'utf-8'\n meths_hash[klass][meth][:source] = source\n begin\n parsed = Parser::CurrentRuby.parse source\n #meths_hash[klass][meth][:source_parsed] = parsed.to_s.force_encoding 'utf-8'\n meths_hash[klass][meth][:source_tokenized] = $tokens.to_s.force_encoding 'utf-8'\n $tokens = []\n rescue; end\n end\n meths_hash[klass][meth][:docstring] = m.docstring.force_encoding 'utf-8' if m.docstring\n }\n return meths_hash\nend",
"def all_methods\n self.all_classes_and_modules.map do |klassmod|\n klassmod.own_methods.as_array\n end.flatten\n end",
"def better_with_ruby_methods(*arrays)\n combined_array = arrays.flatten!.sort!\nend",
"def not_sandboxed_methods(include_superclasses = false, allowed_mixins=[], *disallowed_methods)\n\n __the_methods_to_check = public_instance_methods(false)\n puts \"#{self.name}: direct: #{__the_methods_to_check.inspect}\" if $DEBUG\n if include_superclasses\n clz = self.superclass\n while !clz.nil?\n unless clz == Object || (defined? BasicObject && clz == BasicObject)\n puts \"#{self.name}: #{clz.name}: #{clz.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += clz.public_instance_methods(false)\n end\n clz = clz.superclass\n end\n \n if allowed_mixins.length > 0\n #we include any mixins\n for m in self.included_modules\n if allowed_mixins.include?(m)\n puts \"#{self.name}: #{m.name}: #{m.public_instance_methods(false).inspect}\" if $DEBUG\n __the_methods_to_check += m.public_instance_methods(false)\n end\n end\n end\n end\n \n __the_methods_to_check << \"nil?\".intern\n \n __the_methods_to_check.uniq!\n \n unless disallowed_methods.nil? || disallowed_methods.length == 0\n not_bang = false\n if disallowed_methods.include?(:bang_methods) #just remove all xxx! methods that modify in place\n __the_methods_to_check.reject! { |meth| meth.to_s[-1, 1] == \"!\"}\n not_bang = true\n end\n unless not_bang || disallowed_methods.length > 1\n __the_methods_to_check.reject! { |meth| disallowed_methods.include?(meth)}\n end\n end\n \n puts \"#{self.name}: #{__the_methods_to_check.inspect}\" if $DEBUG\n \n sandboxed_methods(*__the_methods_to_check)\n \n \n \n end",
"def find_methods name\n klass, selector, method = parse_name name\n types = method_type selector\n klasses = nil\n ambiguous = klass.empty?\n if ambiguous then\n klasses = classes.keys\n else\n klasses = ancestors_of klass\n klasses.unshift klass\n end\n methods = []\n klasses.each do |ancestor|\n ancestors = classes[ancestor]\n next unless ancestors\n klass = ancestor if ambiguous\n ancestors.each do |store|\n methods << [store, klass, ancestor, types, method]\n end\n end\n methods = methods.sort_by do |_, k, a, _, m|\n [k, a, m].compact\n end\n methods.each do |item|\n yield(*item) # :yields: store, klass, ancestor, types, method\n end\n self\n end",
"def public_method_source_ranges(mod)\n class_ranges = mod.public_methods(false).map do |m|\n FullMethodSourceLocation.range(mod.method(m))\n end.compact\n instance_ranges = mod.public_instance_methods(false).map do |m|\n FullMethodSourceLocation.range(mod.instance_method(m))\n end.compact\n class_ranges + instance_ranges\n end",
"def get_methods(fqns, scope: T.unsafe(nil), visibility: T.unsafe(nil), deep: T.unsafe(nil)); end",
"def all_methods(instance_methods = false)\n methods = if instance_methods || @instance_methods_switch\n Pry::Method.all_from_class(@interrogatee)\n else\n Pry::Method.all_from_obj(@interrogatee)\n end\n\n if Pry::Helpers::Platform.jruby? && !@jruby_switch\n methods = trim_jruby_aliases(methods)\n end\n\n methods.select { |method| @ppp_switch || method.visibility == :public }\n end",
"def method_definitions(*selection)\n list = []\n\n if selection.empty?\n list.concat bind_call(:instance_methods)\n end\n\n selection.each do |s|\n case s\n when :public, :all\n list.concat bind_call(:public_instance_methods)\n when :protected, :all\n list.concat bind_call(:protected_instance_methods)\n when :private, :all\n list.concat bind_call(:private_instance_methods)\n end\n end\n\n return list\n end",
"def find_methods name\n klass, selector, method = parse_name name\n\n types = method_type selector\n\n klasses = nil\n ambiguous = klass.empty?\n\n if ambiguous then\n klasses = classes.keys\n else\n klasses = ancestors_of klass\n klasses.unshift klass\n end\n\n methods = []\n\n klasses.each do |ancestor|\n ancestors = classes[ancestor]\n\n next unless ancestors\n\n klass = ancestor if ambiguous\n\n ancestors.each do |store|\n methods << [store, klass, ancestor, types, method]\n end\n end\n\n methods = methods.sort_by do |_, k, a, _, m|\n [k, a, m].compact\n end\n\n methods.each do |item|\n yield(*item) # :yields: store, klass, ancestor, types, method\n end\n\n self\n end",
"def methods(*names)\n methods = []\n ast.traverse do |node|\n if match?(:method, node, names)\n methods << node\n yield node if block_given?\n end\n end\n methods\n end",
"def extend!(spec, methods)\n methods.each do |method|\n if (spec.respond_to?(method))\n self.class.send(:define_method, method, lambda { spec.send(method) })\n end\n end\n end",
"def methods(include_ancestors = true)\n super + @driver.methods(false)\n end",
"def _magic_insight_methods\n # We want to keep the longer of the methods by num chars in the method name, because these are the ones meant for\n # humans to see (e.g. human_time, filtered_backtrace, display_time)\n sorted = _sorted_methods\n idiomatic = _idiomatic_methods\n # So we delete the shorter of the two\n idiomatic.each do |idiom|\n sorted.each_with_index do |meth, index|\n # first one found will be the shortest, so delete and move to next idiom\n if meth.to_s =~ /#{idiom}/\n sorted.delete_at(index)\n break # to idiomatic loop\n end\n end\n end\n sorted\n end",
"def uses(*classes)\n class_helpers.push(*classes).uniq!\n end",
"def parsed_methods\n parsed_include(:method)\n end",
"def methods_to_try(obj)\n ret = obj.methods.map(&:intern)\n blacklist = obj.is_a?(Module) ? CLASS_METHOD_BLACKLIST : INSTANCE_METHOD_BLACKLIST\n klass = obj.is_a?(Module) ? obj : obj.class\n\n klass.ancestors.each { |ancestor| ret -= blacklist[ancestor.to_s.intern] }\n\n # 1.8.7 lacks Symbol#<=>\n ret.sort_by(&:to_s)\n end",
"def helper_method(*methods); end",
"def dynamic_define_methods_apply(targetModule, *methodSpecsNom, &dynBlok)\n eye = :ddm_apl\n eyeTale = 'DDM APL'\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_me(eye, eyeTale, \"targetModule >#{targetModule.class}< >#{targetModule}< specs >#{methodSpecsNom.class}< >#{methodSpecsNom.size}< >#{methodSpecsNom.class}< dynBlok >#{dynBlok}<\")\n\n # validate specs\n methodSpecsRdc = dynamic_define_methods_reduce_specifications(targetModule, *methodSpecsNom)\n \n # any methods specs with logic to apply?\n methodSpecs = methodSpecsRdc\n \n # try to merge all the text methods together\n\n textMethods = []\n \n methodSpecs.each_with_index do | methodSpec, methodNdx |\n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_ms(eye, eyeTale, \"methodNdx >#{methodNdx}< methodSpec >#{methodSpec.class}< >#{methodSpec.class}<\")\n\n potrubi_bootstrap_mustbe_hash_or_croak(methodSpec)\n \n case (specType = methodSpec[:spec])\n when Proc then\n\n specName = potrubi_bootstrap_mustbe_string_or_croak((r = methodSpec[:name]) ? r.to_s : nil, eye, \"proc name is nil\")\n specProc = specType # potrubi_bootstrap_mustbe_proc_or_croak(mustbe_key_or_croak(methodSpec, :proc))\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"PROC BEG specName >#{specName.class}< >#{specName}< specProc >#{specProc.class}< >#{specProc}<\")\n\n if (! textMethods.empty?) then # any text methods \"waiting\"; must be defined before proc\n dynamic_define_methods_apply_texts(targetModule, *textMethods)\n textMethods.clear # none wating now\n end\n \n targetModule.__send__(:define_method, specName.to_sym, &specProc) \n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"PROC FIN specName >#{specName.class}< >#{specName}< specProc >#{specProc.class}< >#{specProc}<\")\n\n when String then textMethods << methodSpec \n when Array then textMethods << methodSpec\n else\n potrubi_bootstrap_surprise_exception(specType, \"methodSpec >#{methodSpec.class}< >#{methodSpec.class}< specType >#{specType.class}< is what?\")\n end\n\n end\n\n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger(eye, eyeTale, \"TXTSZ\", potrubi_bootstrap_logger_fmt_kls(textMethods: textMethods))\n \n textMethods.empty? || dynamic_define_methods_apply_texts(targetModule, *textMethods)\n \n $DEBUG_POTRUBI_BOOTSTRAP && potrubi_bootstrap_logger_mx(eye, eyeTale, \"targetModule >#{targetModule.class}< >#{targetModule}< specs >#{methodSpecs.class}< >#{methodSpecs.size}<\")\n\n self\n \n end",
"def chain_methods(methods)\n methods.inject(nil) do |memo, acc|\n target = memo ? memo : self\n target.respond_to?(acc) ? target.send(acc) : memo\n end\n end",
"def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end",
"def inspect_methods\n return [] unless constant.respond_to?(:methods)\n\n methods = get_methods.map do |name|\n method_information(:method, name)\n end\n\n return methods.sort_by(&:name)\n end",
"def include_in_phi(*methods)\n self.__phi_include_methods = methods.map(&:to_s)\n end",
"def defined_methods\n # TODO: check content type before scanning\n content.scan(/\\s*def\\s+([A-Za-z0-9_\\.]*)/).flatten\n end",
"def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end",
"def methods_matching(cname, type, mname)\n cl = findClass(cname)\n\n case cl\n when Array\n matchMethodsInClasses(cl, type, mname)\n \n when ClassModule\n cl.findMethods(mname, type == \"::\")\n end\n\n end",
"def joins\n\t\tprivate_methods(false).grep(/_joins$/).sort.map { |m| send(m) }.compact\n\tend",
"def define_comparison_method(methods)\n define_method(:cmp?) do |comparator, other|\n methods.all? { |method| send(method).send(comparator, other.send(method)) }\n end\n end",
"def modules_for_helpers(modules_or_helper_prefixes); end",
"def remove_methods *ary\n ary.each do |methd|\n eval \"class << self; remove_method :'#{methd}'; end\"\n end\n end",
"def define_pseudized_method(m)\n @class.class_eval <<-EOT\n define_method('#{pseudized_method_name(m)}') do\n collection = ancestors[0..-2].inject([]) do |result, cls|\n result |= cls.#{m}\n end & pseudo_model.#{m}\n\n head_of_commons = collection.index(:instance_eval)\n collection[0...head_of_commons]\n end\n EOT\n end",
"def include_safely_into(*args)\n [args].flatten.each do |a|\n if a.is_a?(String) || a.is_a?(Symbol)\n a = a.to_s.constantize\n end\n a.send(:include, self.convert_security_of_methods)\n end\n end",
"def methods # rubocop:disable Metrics/AbcSize\n @methods ||= {\n includes?: ->(_, element) { Boolean.new(@value.map(&:value).include?(element.value)) },\n map: ->(context, fn) { map(\"map\", context, fn) },\n each: ->(context, fn) { map(\"each\", context, fn) },\n reduce: ->(context, fn) { reduce(\"reduce\", context, fn) },\n fold: ->(context, fn, iv) { reduce(\"fold\", context, fn, initial_value: iv) },\n foldl: ->(context, fn, iv) { reduce(\"foldl\", context, fn, initial_value: iv) },\n inject: ->(context, fn, iv) { reduce(\"inject\", context, fn, initial_value: iv) },\n foldr: ->(context, fn, iv) { reduce(\"foldr\", context, fn, initial_value: iv, reverse: true) },\n }\n end",
"def index_methods\n debug_msg \" generating method search index\"\n\n list = @classes.uniq.map do |klass|\n klass.method_list\n end.flatten.sort_by do |method|\n [method.name, method.parent.full_name]\n end\n\n list.each do |method|\n debug_msg \" #{method.full_name}\"\n record = method.search_record\n @index[:searchIndex] << \"#{search_string record.shift}()\"\n @index[:longSearchIndex] << \"#{search_string record.shift}()\"\n @index[:info] << record\n end\n end",
"def add_method_list out, methods, name\n return if methods.empty?\n\n out << RDoc::Markup::Heading.new(1, \"#{name}:\")\n out << RDoc::Markup::BlankLine.new\n\n if @use_stdout and !@interactive then\n out.concat methods.map { |method|\n RDoc::Markup::Verbatim.new method\n }\n else\n out << RDoc::Markup::IndentedParagraph.new(2, methods.join(', '))\n end\n\n out << RDoc::Markup::BlankLine.new\n end",
"def attach_outer_class_methods!(inherited = false)\n outer_module = Object.const_get(outer_module_name(name))\n outer_module.methods(inherited).each do |m|\n attach_function m\n end\n end",
"def classes_and_modules\n classes + modules\n end",
"def classes_and_modules\n classes + modules\n end",
"def modulize_include(*mod_consts)\n mod_consts.each do |mod_const|\n modulize *(mod_const.instance_methods)\n include mod_const\n end\n end",
"def registered_methods(as_registry=false)\n methods = {}\n ancestors.reverse.each do |ancestor|\n if ancestor.kind_of?(Attributes)\n methods.merge!(ancestor.lazy_registry)\n end\n end\n \n as_registry ? methods : methods.keys\n end",
"def methods\n return @methods if defined?(@methods)\n @methods = contents_of_type(Entities::InstanceMethod)\n @methods << contents_of_type(Entities::ClassMethod)\n @methods << contents_of_type(Entities::SingletonMethod)\n @methods.flatten!\n end",
"def __list_helper_methods\n # avoiding '__self__' and '__id__' symbols with last regex part\n methods.grep(/^#{@@helper_start_with}.*?[^__]$/) do |method|\n method.to_s\n end\n end",
"def add_methods_to_included_class!(dynamic_methods_module, association_name, target_class, options)\n return if (! flex_column_class.delegation_type)\n\n prefix = if options.has_key?(:prefix) then options[:prefix] else flex_column_class.delegation_prefix end\n is_private = private? || (flex_column_class.delegation_type == :private) || (options[:visibility] == :private)\n\n if is_private && options[:visibility] == :public\n raise ArgumentError, %{You asked for public visibility for methods included from association #{association_name.inspect},\n but the flex column #{flex_column_class.model_class.name}.#{flex_column_class.column_name} has its methods\n defined with private visibility (either in the flex column itself, or at the model level).\n\n You can't have methods be 'more public' in the included class than they are in the class\n they're being included from.}\n end\n\n mn = field_name\n mn = \"#{prefix}_#{mn}\".to_sym if prefix\n\n fcc = flex_column_class\n fn = field_name\n\n if target_class._flex_columns_safe_to_define_method?(mn)\n dynamic_methods_module.define_method(mn) do\n associated_object = send(association_name) || send(\"build_#{association_name}\")\n flex_column_object = associated_object.send(fcc.column_name)\n flex_column_object.send(fn)\n end\n\n dynamic_methods_module.define_method(\"#{mn}=\") do |x|\n associated_object = send(association_name) || send(\"build_#{association_name}\")\n flex_column_object = associated_object.send(fcc.column_name)\n flex_column_object.send(\"#{fn}=\", x)\n end\n\n if is_private\n dynamic_methods_module.private(mn)\n dynamic_methods_module.private(\"#{mn}=\")\n end\n end\n end",
"def methods_matching(methods, singleton = false, &block)\n (@method_list + @attributes).each do |m|\n yield m if methods.include?(m.name) and m.singleton == singleton\n end\n\n each_ancestor do |parent|\n parent.methods_matching(methods, singleton, &block)\n end\n end",
"def create_method_from_expressions; end",
"def to_donate_methods\n if should_donate? and !@methods.empty?\n fragment(\"%s;$opal.donate(self, [%s]);\" % [@compiler.parser_indent, @methods.map(&:inspect).join(', ')])\n else\n fragment(\"\")\n end\n end",
"def codegen\n return [\n codegen_select(),\n codegen_select_all(),\n codegen_merge()\n ].join(\"\\n\")\n end",
"def def_wrapper_methods(*methods)\n methods.each() do |name|\n define_method(name) do |*args|\n (str, pos, len, *opt) = args\n raise(ArgumentError, \"argument pos is negative\") if pos && pos < 0\n str_len = bytesize(str)\n pos ||= 0\n pos = str_len if pos > str_len\n len = str_len - pos if !len || len < 0 || len > str_len - pos\n add_encoding(@unsafe.__send__(name, str, pos, len, *opt))\n end\n end\n end",
"def def_mutation_method(*meths)\n meths.each do |meth|\n instance_eval(\"def #{meth}!(*args, &block); mutation_method(:#{meth}, *args, &block) end\")\n end\n end",
"def test_only_adds_methods_to_host_that_are_part_of_public_api\n host_class = Class.new { include ::NewRelic::Agent::MethodTracer }\n plain_class = Class.new\n\n host_instance_methods = host_class.new.methods\n plain_instance_methods = plain_class.new.methods\n\n added_methods = host_instance_methods - plain_instance_methods\n\n public_api_methods = %w[\n trace_execution_unscoped\n trace_execution_scoped\n ]\n\n assert_equal(public_api_methods.sort, added_methods.map(&:to_s).sort)\n end",
"def methods(*args)\n (super + analyser.delegatable_methods).uniq\n end",
"def translate_method( method_compiler , translator)\n all = []\n all << translate_cpu( method_compiler , translator )\n method_compiler.block_compilers.each do |block_compiler|\n all << translate_cpu(block_compiler , translator)\n end\n all\n end",
"def search_all_methods(namespace)\n done = Hash.new{ |h,k| h[k] = {} }\n matches = []\n\n recurse_namespace(namespace) do |klass|\n (Pry::Method.all_from_class(klass) + Pry::Method.all_from_obj(klass)).each do |method|\n next if done[method.owner][method.name]\n done[method.owner][method.name] = true\n\n matches << method if yield method\n end\n end\n\n matches\n end",
"def alias_methods(*method_names)\r\n trait = self\r\n module_or_self.module_eval do\r\n existing_instance_methods = method_names & trait.instance_methods\r\n existing_instance_methods.each do |method_name|\r\n alias_method trait.aliased_method_name(method_name), method_name\r\n end\r\n end\r\n end",
"def import_methods(source, names)\n names.inject(self) { |a, e| a.import_method(source, e) }\n end",
"def modules_for_helpers(args); end",
"def register_capabilities(methods); end",
"def compile_to_ruby\n statements.collect { |s| s.compile_to_ruby }.join(\"\\n\")\n end",
"def compiled_method(locals_keys, scope_class = T.unsafe(nil)); end",
"def dsl_methods\n (Chef::Node.public_instance_methods +\n Chef::Mixin::RecipeDefinitionDSLCore.included_modules.map{|mixin| mixin.public_instance_methods}).flatten.sort.uniq\n end",
"def load_methods(sexp)\n sexp[3][1].rest.select { |child| child.first == :defn } .each do |defn|\n if not stdlib_method? defn\n raise \"#{@symbol_table.cclass}.#{defn[1]} isn't a stdlib method\"\n end\n mdefn = defn.clone\n mdefn[1] = escape_name mdefn[1]\n @symbol_table.add_function mdefn[1],\n s(:stdlib_defn,\n fun_name(mdefn), mdefn[2]).with_value_type(returned_type mdefn)\n end\n end",
"def parse_tree(*klasses)\n result = []\n klasses.each do |klass|\n klassname = klass.name rescue '' # HACK klass.name should never be nil\n # Tempfile's DelegateClass(File) seems to\n # cause this\n klassname = \"UnnamedClass_#{klass.object_id}\" if klassname.empty?\n klassname = klassname.to_sym\n\n code = if Class === klass then\n sc = klass.superclass\n sc_name = ((sc.nil? or sc.name.empty?) ? \"nil\" : sc.name).intern\n [:class, klassname, [:const, sc_name]]\n else\n [:module, klassname]\n end\n\n method_names = []\n method_names += klass.instance_methods false\n method_names += klass.private_instance_methods false\n # protected methods are included in instance_methods, go figure!\n\n method_names.sort.each do |m|\n r = parse_tree_for_method(klass, m.to_sym)\n code << r\n end\n\n klass.modules.each do |mod| # TODO: add a test for this \n mod.instance_methods.each do |m|\n r = parse_tree_for_method(mod, m.to_sym)\n code << r\n end\n end\n\n klass.singleton_methods(false).sort.each do |m|\n code << parse_tree_for_method(klass, m.to_sym, true)\n end\n\n result << code\n end\n return result\n end",
"def unmodulize(*method_syms)\n method_syms.each do |method_sym|\n methname = method_sym.to_s\n orig_methname_sym = \"#{methname}_before_modulize\".to_sym\n if instance_methods(false).include?(orig_methname_sym) # if it was modulized\n class_eval <<-EOM\n alias_method method_sym, orig_methname_sym\n remove_method orig_methname_sym\n EOM\n end\n end\n end",
"def inherited_meths(opts = T.unsafe(nil)); end",
"def helper_method(*methods)\n methods.flatten.each do |method|\n master_helper_module.module_eval <<-end_eval\n def #{method}(*args, &block)\n @cell.send(%(#{method}), *args, &block)\n end\n end_eval\n end\n end",
"def helper_method(*methods)\n methods.flatten.each do |method|\n master_helper_module.module_eval <<-end_eval\n def #{method}(*args, &block)\n @cell.send(%(#{method}), *args, &block)\n end\n end_eval\n end\n end",
"def delegate_methods(*symbols)\n symbols.each { |symbol| delegate_method(symbol) }\n nil\n end",
"def methods(inherited_too=true)\n ensure_apply_object_class\n target_names = @attr_methods.keys + @attr_aliases.keys\n target_names -= ['objectClass', Inflector.underscore('objectClass')]\n super + target_names.uniq.collect do |x|\n [x, \"#{x}=\", \"#{x}?\", \"#{x}_before_type_cast\"]\n end.flatten\n end",
"def method_missing(meth,*a,&block)\n (methods[meth] ||= []) << a\n methods[meth].flatten!\n end",
"def class_modules(*mods)\n @class_modules ||= [ \n Command::ClassMethods,\n Command::Options::ClassMethods,\n ]\n @class_modules += mods\n end",
"def interesting_methods\n em = extension_modules\n methods-[em.last ? em.last.methods : nil]-self.class.instance_methods\n end",
"def for_each_gosu_method\n require \"yard\"\n YARD::Registry.load!\n \n # Utility functions\n YARD::Registry.at(\"Gosu\").meths.each do |meth|\n args = meth.parameters.map { |arg| arg.compact.join(\" = \") }\n yield \"Module Methods\", \"Gosu.#{meth.name}\", args, nil\n end\n \n # Methods and class methods\n YARD::Registry.all(:class).each do |cls|\n next if %w(Color GLTexInfo).include? cls.name\n \n cls.meths.each do |meth|\n # Ignore methods whose previous comment starts with @deprecated\n if meth.has_tag? :deprecated\n puts \"Skipped #{meth.path} (@deprecated)\"\n next\n end\n \n # Ignore explicit and attr setters (methods that end in a =)\n next if meth.name.to_s[-1, 1] == \"=\"\n \n # Ignore methods with only one argument\n next if meth.parameters.empty?\n \n method_name = meth.name.to_s\n method_name = \"self.#{method_name}\" if meth.scope == :class\n args = meth.parameters.map { |arg| arg.compact.join(\" = \") }\n \n # Support for static methods\n # e.g. self.load_tiles<tab> => Image.load_tiles<tab>\n if cls.name != :Window\n method_name.sub! \"self.\", \"#{cls.name}.\"\n else\n # Not in the window though\n method_name.sub! \"self.\", \"\"\n end\n \n # Ignore methods that are never called directly.\n next if %w(button_up button_down).include? method_name\n \n if method_name == \"initialize\"\n next if cls.name == :Window # Nobody wants to call Window.new\n method_name = \"#{cls.name}.new\"\n end\n \n if args.last[0, 1] == \"&\"\n block_name = args.last[1..-1].gsub(\"_\", \" \") + \" here\"\n args.pop\n end\n \n yield cls.name.to_s, method_name, args, block_name\n end\n end\nend",
"def module_include(base, mod)\n old_methods = {}\n\n mod.instance_methods.each do |sym|\n old_methods[sym] = base.instance_method(sym) if base.method_defined?(sym)\n end\n\n unless UNBOUND_METHODS_BIND_TO_ANY_OBJECT\n base.send(:include, mod) unless base < mod\n end\n\n mod.instance_methods.each do |sym|\n method = mod.instance_method(sym)\n base.send(:define_method, sym, method)\n end\n\n yield\n ensure\n mod.instance_methods.each do |sym|\n base.send(:undef_method, sym) if base.method_defined?(sym)\n end\n old_methods.each do |sym, method|\n base.send(:define_method, sym, method)\n end\n end",
"def callable_methods\n methods.grep(/^_\\w+[^_]$/)\n end"
] |
[
"0.598585",
"0.59137535",
"0.57419205",
"0.56867117",
"0.5633375",
"0.562813",
"0.55664676",
"0.556154",
"0.55500615",
"0.55165553",
"0.5455936",
"0.54237115",
"0.534861",
"0.5342779",
"0.5341936",
"0.5335852",
"0.5322555",
"0.52851593",
"0.52813",
"0.52327096",
"0.5218546",
"0.5217421",
"0.5167045",
"0.51620555",
"0.515576",
"0.51505554",
"0.5138566",
"0.50902843",
"0.5090232",
"0.50798064",
"0.50687534",
"0.50524044",
"0.50475913",
"0.5045049",
"0.5037003",
"0.5032134",
"0.50108624",
"0.50099325",
"0.5006609",
"0.49992618",
"0.49880123",
"0.49752045",
"0.4970432",
"0.49657574",
"0.4931863",
"0.4927603",
"0.4917151",
"0.4917151",
"0.48899776",
"0.4876121",
"0.4876024",
"0.48754275",
"0.4874118",
"0.48739427",
"0.48672813",
"0.48619023",
"0.48494574",
"0.48235023",
"0.482298",
"0.47882354",
"0.47872266",
"0.4785894",
"0.4780963",
"0.4780963",
"0.47781593",
"0.4774654",
"0.47720188",
"0.47704166",
"0.47672623",
"0.47653297",
"0.4760294",
"0.47439435",
"0.47387886",
"0.4737625",
"0.4734128",
"0.47258553",
"0.47175273",
"0.4715003",
"0.47141564",
"0.47075397",
"0.4706068",
"0.46913257",
"0.46912768",
"0.46900117",
"0.46879196",
"0.4677495",
"0.46772557",
"0.4675336",
"0.4673341",
"0.46667504",
"0.465579",
"0.465579",
"0.46474826",
"0.46449423",
"0.4631268",
"0.46298355",
"0.46107933",
"0.46087712",
"0.46066588",
"0.46059272"
] |
0.75555813
|
0
|
Convenience method to allow configuration options to be set in a block
|
def configure
yield self
self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def configure(&block)\n raise ArgumentError, \"Block is required.\" unless block_given?\n yield @options\n end",
"def config(&block)\n instance_eval(&block) if block_given?\n end",
"def configure_with_block(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure_with_block(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure &block\n configuration.tap { |conf| yield conf }\n end",
"def configure(&block)\n block.call Configuration\n end",
"def configure(&block)\n @configure_blocks ||= []\n @configure_blocks << block\n end",
"def config(&block)\n instance_exec(&block)\n end",
"def configure(&block)\n yield config\n end",
"def configure( &block )\n @configuration = block\n end",
"def configure(&block)\n raise ArgumentError, \"Block required in order to configure\" unless block_given?\n \n yield @config\n end",
"def configure(&block)\n yield(configuration)\n end",
"def configure\n yield configuration if block_given?\n end",
"def configure &block\n @config_helper = ConfigHelper.new(&block)\n end",
"def configure\n yield configuration if block_given?\n end",
"def configure(&block)\n yield(configuration)\n end",
"def configure(&block); end",
"def configure(&block); end",
"def configure(&block)\n yield config\n config\n end",
"def configure\n yield config if block_given?\n end",
"def configure(&block)\n self.instance_eval(&block) if block_given?\n end",
"def configure\n yield config if block_given?\n end",
"def configure\n yield config if block_given?\n end",
"def configure(&block)\n instance_eval(&block)\n end",
"def configure(&block)\n instance_eval(&block)\n end",
"def config(&block_)\n ::Blockenspiel.invoke(block_, @config) if block_\n @config\n end",
"def configure &block\n\t\tinstance_eval &block\n\tend",
"def config(&block)\n if block_given?\n block.call(@config)\n else\n @config\n end\n end",
"def configure\n if block_given?\n yield self\n else\n raise LocalJumpError, \"Required configuration block\"\n # TODO: allow users to pass configuration using an environment variable\n end\n end",
"def config(&block)\n yield(self)\n end",
"def configure(&block)\n ConfigBlock.new(self, &block) if block_given?\n nil\n end",
"def configure(&block)\n ConfigBlock.new(self, &block) if block_given?\n nil\n end",
"def with_options(&block); end",
"def configure &blk\n instance_eval &blk\n end",
"def configure(&block)\n default_values!\n yield self\n end",
"def configure(&blk)\n @blk = blk if block_given?\n self\n end",
"def configure(&block)\n self.instance_eval(&block)\n end",
"def configure\n yield flags if block_given?\n end",
"def config\n yield @@config_options\n end",
"def with_options(options = {}, &block)\n return unless block\n backup_options = @stkw_config[:base_opt]\n @stkw_config[:base_opt] = @stkw_config[:base_opt].merge(options)\n begin\n instance_eval &block\n ensure\n @stkw_config[:base_opt] = backup_options\n end\n end",
"def configure\n yield(self.config) if block_given?\n end",
"def configure\n yield(configuration) if block_given?\n end",
"def configure(&blk)\n instance_eval &blk\n end",
"def configure\n yield self if block_given?\n end",
"def configure\n yield self if block_given?\n end",
"def configure\n yield self if block_given?\n end",
"def configure\n yield(config) if block_given?\n config\n end",
"def configure(&block)\n configurator.configure(&block)\n end",
"def configure(config = nil, &block)\n config ||= Util::BlockHashBuilder.build(&block)\n @config = config.dup.freeze\n end",
"def configure(&block)\n config.run_callbacks(:configure) do\n config.instance_eval(&block)\n end\n end",
"def configure(&block)\n yield(self)\n end",
"def configure(&block)\n yield(self)\n end",
"def configure(&block)\n fail InvalidSyntax, '`configure` requires a block.' unless block_given?\n\n Vedeu::Configuration.configure(&block)\n end",
"def configure(&block)\n Fastfood::Configuration.instance_eval( &block )\n end",
"def configure\n yield self if block_given?\n end",
"def config(&block)\n if block_given?\n @@config = Config.new\n @@config.tap(&block)\n else\n @@config\n end\n end",
"def use\n if block_given?\n yield self.config\n end\n self.config\n end",
"def configure\n yield(self) if block_given?\n end",
"def config(&blk)\n scope &blk\n self\n end",
"def configure\n yield self if block_given?\n self\n end",
"def configuration_option(*opts, &block)\n Autoproj.config.declare(*opts, &block)\nend",
"def configure\n configuration.enabled = true if configuration.enabled.nil?\n\n yield(configuration.configured_options)\n end",
"def config(&block)\n if block_given?\n c = Config.new\n c.instance_eval(&block)\n @config = c\n end\n\n @config ||= Config.new\n end",
"def initialize(&block)\n configure(&block) if block_given?\n end",
"def config(&block)\n @config ||= Configuration.new\n instance_exec(@config, &block) if block_given?\n @config\n end",
"def block\n options.fetch(:block)\n end",
"def cxx_configuration(&block)\n @myblock = block\n @all_blocks = []\n end",
"def options(*args, &block); end",
"def configure(&block)\n cfg = self.class::CONFIGURATOR.new(self)\n block.call(cfg)\n # allow configuration tuning for derived recipes\n post_configure\n end",
"def configure\n yield(config)\n end",
"def configure(options = nil)\n if block_given?\n yield default_options\n else\n default_options.deep_merge!(options)\n end\n end",
"def configure\n define_defaults\n yield(self) if block_given?\n true\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield(config)\n end",
"def configuration_defaults(&block)\n @configuration_defaults = block\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def configure\n yield configuration\n end",
"def setup_config(config=nil, &block)\n @config = config || ConfigStruct.block_to_hash(block)\n end",
"def configure\n yield(config)\n config\n end",
"def configure\n self.configuration ||= Configuration.new\n yield(configuration) if block_given?\n end",
"def configure \n yield(configuration)\n end",
"def configure\n yield config\n end",
"def configure\n yield config\n end",
"def configure\n yield config\n end",
"def configure\n yield settings\n end",
"def preconfigure\n yield(configuration.configured_options)\n end",
"def configure(&block)\n @config = BeaconControl::Base::Config.new &block\n end",
"def configure\n yield configuration\n configuration\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end",
"def configure\n yield(configuration)\n end"
] |
[
"0.8478099",
"0.8120963",
"0.81001765",
"0.81001765",
"0.8010885",
"0.7984564",
"0.7981057",
"0.7940716",
"0.79392976",
"0.7935303",
"0.7903023",
"0.7882659",
"0.7882427",
"0.787986",
"0.7873399",
"0.78668606",
"0.78619075",
"0.78619075",
"0.78616524",
"0.7843603",
"0.78432673",
"0.7838412",
"0.7838412",
"0.7831454",
"0.7831454",
"0.7826655",
"0.7815447",
"0.7808675",
"0.77802414",
"0.7776042",
"0.7746711",
"0.7746711",
"0.7730651",
"0.77227014",
"0.76667225",
"0.76571333",
"0.7655739",
"0.7645808",
"0.76377827",
"0.76332766",
"0.76195055",
"0.76036084",
"0.7586643",
"0.75865567",
"0.75865567",
"0.75865567",
"0.75448054",
"0.75367033",
"0.7528843",
"0.7494838",
"0.7491062",
"0.7491062",
"0.7476577",
"0.745863",
"0.74471086",
"0.74246186",
"0.740342",
"0.73720855",
"0.7352097",
"0.7299519",
"0.72974306",
"0.7272902",
"0.72496986",
"0.7240273",
"0.7238123",
"0.7232187",
"0.7226485",
"0.7214181",
"0.7210629",
"0.72028863",
"0.7188643",
"0.71833116",
"0.7167518",
"0.7167518",
"0.7143894",
"0.71436936",
"0.7142376",
"0.7142376",
"0.7142376",
"0.7142376",
"0.7142376",
"0.7142376",
"0.7142376",
"0.7127399",
"0.71184176",
"0.7116745",
"0.7109533",
"0.710098",
"0.710098",
"0.710098",
"0.70955974",
"0.7090751",
"0.7080219",
"0.7068504",
"0.70455074",
"0.70455074",
"0.70455074",
"0.70455074",
"0.70455074",
"0.70455074",
"0.70455074"
] |
0.0
|
-1
|
POST /pumpers POST /pumpers.xml
|
def create
@timesheet = Incident.find(params[:incident_id]).timesheet
@pumper = @timesheet.pumpers.build(params[:pumper])
respond_to do |format|
if @pumper.save
format.html { redirect_to(edit_incident_timesheet_path, :notice => 'Pumper was successfully created.') }
else
format.html { render :new }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pump\n if event_params(:pump)['event'].present? && event_params(:pump)['event'].start_with?('pump')\n @pump_status = PumpStatus.new event_params(:pump)\n handle_event(@pump_status)\n else\n handle_event_missing(event_params(:name))\n end\n end",
"def post\n resource.post(request, response)\n end",
"def create\n @ru_pusk = RuPusk.new(params[:ru_pusk])\n\n respond_to do |format|\n if @ru_pusk.save\n format.html { redirect_to(@ru_pusk, :notice => 'Ru pusk was successfully created.') }\n format.xml { render :xml => @ru_pusk, :status => :created, :location => @ru_pusk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ru_pusk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post\n Rentlinx.client.post(self)\n end",
"def update\n @pumper = Pumper.find(params[:id])\n\n respond_to do |format|\n if @pumper.update_attributes(params[:pumper])\n format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pumper.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end",
"def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end",
"def process_request\n @build_xml = build_xml\n pickup_serv_log('Final XML Request : ' + @build_xml.to_s)\n api_url_srv = api_url + \"/pickup\"\n pickup_serv_log('URL for API : ' + api_url_srv.to_s)\n api_response = self.class.post(api_url_srv, :body => build_xml)\n pickup_serv_log('API Response : ' + api_response.to_s)\n puts api_response if @debug\n response = parse_response(api_response)\n if success?(response)\n pickup_serv_log('Successfully Done : ' + response.to_s)\n success_response(api_response, response)\n else\n failure_response(api_response, response)\n end\n end",
"def create\n @prayer = Prayer.new(params[:prayer])\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render json: @prayer, status: :created, location: @prayer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pneighbour = Pneighbour.new(params[:pneighbour])\n\n respond_to do |format|\n if @pneighbour.save\n format.html { redirect_to(@pneighbour, :notice => 'Pneighbour was successfully created.') }\n format.xml { render :xml => @pneighbour, :status => :created, :location => @pneighbour }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pneighbour.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @bunker = Bunker.new(params[:bunker])\n\n respond_to do |format|\n if @bunker.save\n flash[:notice] = 'Bunker was successfully created.'\n format.html { redirect_to(@bunker) }\n format.xml { render :xml => @bunker, :status => :created, :location => @bunker }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bunker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def POST; end",
"def create\n @porter = Porter.new(params[:porter])\n\n respond_to do |format|\n if @porter.save\n format.html { redirect_to @porter, notice: 'Porter was successfully created.' }\n format.json { render json: @porter, status: :created, location: @porter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @porter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post endpoint, data\n do_request :post, endpoint, data\n end",
"def post(*args)\n request :post, *args\n end",
"def create_feed\n\n @service = Service.new(params[:service])\n respond_to do |format|\n if @service.save\n \n Pusher['post'].trigger('thing-create', @service.attributes)\n #@service.update_followers\n\n format.html { }\n format.xml { render :xml => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service }\n end\n end\n end",
"def create\n @spawner = Spawner.new(spawner_params)\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n if @spawner.save\n format.html { redirect_to @spawner, notice: 'Spawner was successfully created.' }\n format.json { render json: @spawner, status: :created, location: @spawner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spawner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end",
"def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end",
"def post(*args)\n request(:post, *args)\n end",
"def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end",
"def create\n @prayer = Prayer.new(prayer_params)\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render :show, status: :created, location: @prayer }\n else\n format.html { render :new }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def create\n @prayer = current_user.prayers.build(params[:prayer])\n\n respond_to do |format|\n if @prayer.save\n flash[:success] = \"Prayer created!\"\n format.html { redirect_to root_url, notice: 'Prayer was successfully created.' }\n format.json { render json: @prayer, status: :created, location: @prayer }\n else\n @feed_items = []\n format.html { render action: \"static_pages/home\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit\n obj = ActiveSupport::Inflector.constantize(self.class.to_s.gsub(/Builder/, ''))\n obj.new(Client.post_xml_request(to_s))\n end",
"def post_prayer(options)\n raise(Error::ArgumentError, \"Must supply a options[:group_id] for the prayers's originating group\") unless options[:group_id]\n raise(Error::ArgumentError, \"Title (options[:title]) required\") unless options[:title]\n raise(Error::ArgumentError, \"Body (options[:body]) required\") unless options[:body]\n gid = options[:group_id] || 0\n object_from_response(TheCity::Prayer, :post, \"/groups/#{gid}/prayers/\", options, {:client => self})\n end",
"def create\n # @retailer = Retailer.new(params[:retailer])\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend",
"def api_post(action, data)\n api_request(action, data, 'POST')\n end",
"def create\n respond_to do |format|\n if petitioner.save\n format.html { redirect_to candidate_petitioners_url( petitioner.candidate ), flash: { success: 'Petitioner created.' } }\n format.xml { render xml: petitioner, status: :created, location: petitioner }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: petitioner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prayer = Prayer.new(prayer_params)\n\n respond_to do |format|\n if @prayer.save\n format.html { redirect_to @prayer, notice: 'Prayer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prayer }\n else\n format.html { render action: 'new' }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @waiter = Waiter.new(params[:waiter])\n\n respond_to do |format|\n if @waiter.save\n format.html { redirect_to @waiter, notice: 'Waiter was successfully created.' }\n format.json { render json: @waiter, status: :created, location: @waiter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @waiter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_retailer = Admin::Retailer.new(admin_retailer_params)\n\n respond_to do |format|\n if @admin_retailer.save\n format.html { redirect_to @admin_retailer, notice: 'Retailer was successfully created.' }\n format.json { render :show, status: :created, location: @admin_retailer }\n else\n format.html { render :new }\n format.json { render json: @admin_retailer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @retailer = Retailer.new(params[:retailer])\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: \"Retailer was successfully created.\" }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entry }\n end\n end\n end",
"def create\n @retailer = Retailer.new(params[:retailer])\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render json: @retailer, status: :created, location: @retailer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post\n RestClient.post(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def post\n frm.button(:name=>\"post\").click\n AssignmentsList.new(@browser)\n end",
"def post(*args)\n Request.post(*args)\n end",
"def create\n @sifter = Sifter.new(params[:sifter])\n\n respond_to do |format|\n if @sifter.save\n flash[:notice] = 'Sifter was successfully created.'\n format.html { redirect_to(@sifter) }\n format.xml { render :xml => @sifter, :status => :created, :location => @sifter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sifter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def postFlatpackSitemap( flatpack_id, filedata)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['filedata'] = filedata\n return doCurl(\"post\",\"/flatpack/sitemap\",params)\n end",
"def create\n @brother = Brother.new(params[:brother])\n\n respond_to do |format|\n if @brother.save\n flash[:notice] = 'Brother was successfully created.'\n format.html { render :back }\n format.xml { render :xml => @brother, :status => :created, :location => @brother }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @brother.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @medewerker = Medewerker.new(params[:medewerker])\n\n respond_to do |format|\n if @medewerker.save\n flash[:notice] = 'Medewerker was successfully created.'\n format.html { redirect_to(@medewerker) }\n format.xml { render :xml => @medewerker, :status => :created, :location => @medewerker }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @medewerker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post328 = Post328.new(params[:post328])\n\n respond_to do |format|\n if @post328.save\n format.html { redirect_to(@post328, :notice => 'Post328 was successfully created.') }\n format.xml { render :xml => @post328, :status => :created, :location => @post328 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post328.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_senders(sender_request, opts = {})\n data, _status_code, _headers = post_senders_with_http_info(sender_request, opts)\n data\n end",
"def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end",
"def post(path, *args)\n page.driver.post(path, *args)\n page.driver.follow_redirects!\n end",
"def create\n @ministry = Ministry.find(params[:ministry])\n @trip = @ministry.trips.build(params[:trip])\n\n respond_to do |format|\n if @trip.save\n #flash[:notice] = 'Trip was successfully created.'\n format.html { redirect_to(@trip) }\n format.xml { render :xml => @trip, :status => :created,\n :location => @trip }\n else\n @data_files = DataFile.find(:all, :order => :name)\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trip.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @trump = Trump.new(trump_params)\n\n respond_to do |format|\n if @trump.save\n format.html { redirect_to @trump, notice: 'Trump was successfully created.' }\n format.json { render :show, status: :created, location: @trump }\n else\n format.html { render :new }\n format.json { render json: @trump.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post\r\n end",
"def create\n @retailer = Retailer.new(retailer_params)\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, notice: 'Retailer was successfully created.' }\n format.json { render :show, status: :created, location: @retailer }\n else\n format.html { render :new }\n format.json { render json: @retailer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(url, post_vars={})\n send_request url, post_vars, 'POST'\n end",
"def create\n @renter = Renter.new(params[:renter])\n @locals = User.where(:city => @buyer.city)\n @users = @locals.random(5)\n respond_to do |format|\n if @renter.save\n @users.each do |user|\n RenterMailer.registration_welcome(@renter, user).deliver\n Renter.increment_counter(\"times_forwarded\", @renter.id)\n end\n format.html { redirect_to :submitted_page, :notice => 'Seller was successfully created.' }\n format.json { render :json => @renter, :status => :created, :location => @renter }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @renter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @singer = Singer.new(singer_params)\n\n respond_to do |format|\n if @singer.save\n format.html { redirect_to @singer, notice: \"Singer was successfully created.\" }\n format.json { render :show, status: :created, location: @singer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @singer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(action, params={}, options={})\n request(:post, action, params, options)\n end",
"def post\n frm.button(:value=>\"Post\").click\n AssignmentsList.new(@browser)\n end",
"def create\n @usser = Usser.new(usser_params)\n\n respond_to do |format|\n if @usser.save\n format.html { redirect_to @usser, notice: 'Usser was successfully created.' }\n format.json { render :show, status: :created, location: @usser }\n else\n format.html { render :new }\n format.json { render json: @usser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def moip_post\n @nasp_rail = NaspRail.new(params[:nasp_rail])\n\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n end",
"def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end",
"def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end",
"def create\n @uder = Uder.new(uder_params)\n\n respond_to do |format|\n if @uder.save\n format.html { redirect_to @uder, notice: 'Uder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @uder }\n else\n format.html { render action: 'new' }\n format.json { render json: @uder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evil_wizard = EvilWizard.new(params[:evil_wizard])\n\n respond_to do |format|\n if @evil_wizard.save\n format.html { redirect_to(@evil_wizard, :notice => 'Evil wizard was successfully created.') }\n format.xml { render :xml => @evil_wizard, :status => :created, :location => @evil_wizard }\n else\n fetch_dungeons\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evil_wizard.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @prayer_request = PrayerRequest.new(params[:prayer_request])\n\n respond_to do |format|\n if @prayer_request.save\n format.html { redirect_to prayer_requests_path, notice: 'Prayer request was successfully created.' }\n format.json { render json: @prayer_request, status: :created, location: @prayer_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post; end",
"def create\n @wager = Wager.new(params[:wager])\n\n if @wager.save\n render json: @wager, status: :created, location: @wager\n else\n render json: @wager.errors, status: :unprocessable_entity\n end\n end",
"def create\n @pier = Pier.new(pier_params)\n if @pier.save\n redirect_to harbour_piers_path(@pier.harbour), notice: 'Pier was successfully created.'\n else\n render :new\n end\n end",
"def create\n @card_punch = CardPunch.new(params[:card_punch])\n\n respond_to do |format|\n if @card_punch.save\n format.html { redirect_to(@card_punch, :notice => 'CardPunch was successfully created.') }\n format.xml { render :xml => @card_punch, :status => :created, :location => @card_punch }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @card_punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @clicker = Clicker.new(params[:clicker])\n\n respond_to do |format|\n if @clicker.save\n format.html { redirect_to(@clicker, :notice => 'Clicker was successfully created.') }\n format.xml { render :xml => @clicker, :status => :created, :location => @clicker }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @clicker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @peep = Peep.new(params[:peep])\n\n respond_to do |format|\n if @peep.save\n format.html { redirect_to(@peep, :notice => 'Peep was successfully created.') }\n format.xml { render :xml => @peep, :status => :created, :location => @peep }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @peep.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @my_prayer_request = PrayerRequest.new(params[:my_prayer_request])\n\n respond_to do |format|\n if @my_prayer_request.save\n format.html { redirect_to @my_prayer_request, notice: 'My prayer request was successfully created.' }\n format.json { render json: @my_prayer_request, status: :created, location: @my_prayer_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @u_ser = USer.new(params[:u_ser])\n\n respond_to do |format|\n if @u_ser.save\n format.html { redirect_to @u_ser, notice: 'U ser was successfully created.' }\n format.json { render json: @u_ser, status: :created, location: @u_ser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @u_ser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def poteti_post(action, parameters = nil, session = nil, flash = nil)\n process_action(action, parameters, session, flash, 'POST')\n end",
"def create\n @post246 = Post246.new(params[:post246])\n\n respond_to do |format|\n if @post246.save\n format.html { redirect_to(@post246, :notice => 'Post246 was successfully created.') }\n format.xml { render :xml => @post246, :status => :created, :location => @post246 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post246.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @kennel = Kennel.new(params[:kennel])\n\n respond_to do |format|\n if @kennel.save\n flash[:notice] = 'Kennel was successfully created.'\n format.html { redirect_to(@kennel) }\n format.xml { render :xml => @kennel, :status => :created, :location => @kennel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @kennel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @insurer = Insurer.new(params[:insurer])\n\n respond_to do |format|\n if @insurer.save\n format.html { redirect_to(@insurer, :notice => 'Insurer was successfully created.') }\n format.xml { render :xml => @insurer, :status => :created, :location => @insurer }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @insurer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(data = {})\n call data, method: :post\n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @director = Director.find(params[:director_id])\n @soaps = @director.soaps.create(soap_params)\n redirect_to director_path(@director)\n\n\n end",
"def post(data)\n response_data = []\n data.each do |xml|\n req = send_request(xml)\n\n if req[:code].to_i.between?(200, 201)\n response_data << req[:data]\n else\n if req[:code] == \"401\"\n raise ResponseError, \"Could not authenticate with the Pomegranate API. Ensure that your credentials are correct.\"\n elsif req[:code] == \"400\"\n raise ResponseError, \"Bad asset value formatting. Please reformat and try again.\"\n else\n raise StandardError, \"An unknown error has occured.\"\n end\n response_data = false\n break\n end\n end\n\n response_data\n end",
"def create\n @plains_walker = PlainsWalker.new(plains_walker_params)\n\n respond_to do |format|\n if @plains_walker.save\n format.html { redirect_to @plains_walker, notice: 'Plains walker was successfully created.' }\n format.json { render :show, status: :created, location: @plains_walker }\n else\n format.html { render :new }\n format.json { render json: @plains_walker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(path, **args); end",
"def create\n @pushup = Pushup.new(params[:pushup])\n\n respond_to do |format|\n if @pushup.save\n format.html { redirect_to @pushup, notice: 'Pushup was successfully created.' }\n format.json { render json: @pushup, status: :created, location: @pushup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pushup.errors, status: :unprocessable_entity }\n end\n end \n end",
"def snooze!\n log \"Sending #{@method} to Snooze.io\"\n handle_post_response { Snooze::Post.send(@method, @clock_id) }\n end",
"def create\n @scraper = Scraper.new(params[:scraper])\n\n respond_to do |format|\n if @scraper.save\n format.html { redirect_to(@scraper, :notice => 'Scraper was successfully created.') }\n format.xml { render :xml => @scraper, :status => :created, :location => @scraper }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @scraper.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @spieler = Spieler.new(params[:spieler])\n\n respond_to do |format|\n if @spieler.save\n format.html { redirect_to @spieler, notice: 'Spieler was successfully created.' }\n format.json { render json: @spieler, status: :created, location: @spieler }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spieler.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prayer_request = PrayerRequest.new(params[:prayer_request])\n\n respond_to do |format|\n if @prayer_request.save\n format.html { redirect_to @prayer_request, notice: 'PrayerRequest was successfully created.' }\n format.json { render json: @prayer_request, status: :created, location: @prayer_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prayer_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make_request\n if @test\n host = 'wwwcie.ups.com'\n else\n host = 'www.ups.com'\n end\n\n path = \"/ups.app/xml/Rate\"\n server = Net::HTTP.new(host, 443)\n data = @xml_pieces.collect{|p| p.to_s}.join(\"\\n\")\n if @debug\n File.open(@debug_request_path, 'w') do |file|\n file.puts data\n end\n end\n headers = { \"Content-Type\" => \"text/xml\"}\n server.use_ssl = true\n resp = server.post(path, data, headers)\n if @debug\n File.open(@debug_response_path, 'w') do |file|\n file.puts resp.body\n end\n end\n prices = parse_response(resp.body)\n end",
"def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end",
"def create_ping\n post 'ping'\n end",
"def create\n @wave = Wave.find(params[:wave_id])\n @surfer = @wave.surfers.create(surfers_params)\n\n redirect_to waves_path\n end",
"def create\n @booker = Booker.new(params[:booker])\n\n respond_to do |format|\n if @booker.save\n format.html { redirect_to(@booker, :notice => 'Booker was successfully created.') }\n format.xml { render :xml => @booker, :status => :created, :location => @booker }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @booker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(action, **args); end",
"def create\n @waiter = Waiter.new(waiter_params)\n\n respond_to do |format|\n if @waiter.save\n format.html { redirect_to waiters_manager_path(current_user), notice: i18n_notice('created',@waiter) }\n format.json { render action: 'show', status: :created, location: @waiter }\n else\n @workstations = current_user.workstations.select(:id, :name).map {|w| [w.name, w.id] }\n format.html { render action: 'new' }\n format.json { render json: @waiter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prospect = Prospect.new(params[:prospect])\n\n respond_to do |format|\n if @prospect.save\n ReservationMailer.deliver_sent(@prospect, @prospect.house)\n flash[:notice] = \"Votre demande d'informations a été pris en compte.\"\n format.html { redirect_to(house_path(@prospect.house)) }\n format.xml { render :xml => @prospect, :status => :created, :location => @prospect }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @prospect.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def notify_travellers\n if current_user.nil?\n trip = session[:trip]\n else\n trip = Trip.find(params[:id])\n end\n\n drivers = []\n passengers = []\n\n trip.travellers.each do |t|\n if t.type == 'Driver'\n drivers << t\n else\n passengers << t\n end\n end\n\n trip_output_data = params[:data]\n\n drivers.each { |driver| DriverMailer.trip_email(trip, driver, trip_output_data, current_user).deliver_now }\n passengers.each { |passenger| PassengerMailer.trip_email(trip, passenger, trip_output_data, current_user).deliver_now }\n\n render json: {message: 'Emails were successfully sent.'}\n end",
"def create\n @post58 = Post58.new(params[:post58])\n\n respond_to do |format|\n if @post58.save\n format.html { redirect_to(@post58, :notice => 'Post58 was successfully created.') }\n format.xml { render :xml => @post58, :status => :created, :location => @post58 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post58.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post\n end",
"def api_call(action, xml_data)\n require 'net/http'\n require 'uri'\n current_url = URL;\n if action != 'get-queue'\n get_server(@@_target_type_options[@@_target_type]);\n end\n uri = URI.parse(current_url+\"/\"+action)\n http = Net::HTTP.new(uri.host,uri.port)\n request=Net::HTTP::Post.new(uri.request_uri);\n request.set_form_data({ \"queue\"=> array_to_xml(xml_data,\"\")})\n return http.request(request).body\n end",
"def create\n megam_rest.post_node(to_hash)\n end",
"def create\n\t# 把訊息寫進 log 內, 可用heroku logs -a rescue-team 看.\n Rails.logger.info request.body.read\n\t\n\t# parse 警訊, 翻譯成 object 存起來.\n\t#@doc = Nokogiri::XML(request.body.read)\n\talert = RCAP::Alert.from_xml(request.body.read)\n\tRails.logger.info alert.sent\n\t#Rails.logger.info alert.to_h['identifier']\n\t#Rails.logger.info alert.infos\n\n\t# 把訊息寫進 database 內, 等 ifttt 來收新資料.\n\talert.infos.first.parameters.each do |para|\n\t\tif para.to_s =~ /\\\"/\n\t\t\tary = para.to_s.split(\";\")\n\t\t\t#ary[0] #級數\n\t\t\t#ary[1] #城市\n\t\t\tRails.logger.info ary[1].gsub(\"\\\"\", \"\") + \" \" + ary[0].split(\" \")[1]\n\t\t\t@uploader = Uploader.new :place => ary[1].gsub(\"\\\"\", \"\"), :content => ary[0].split(\" \")[1], :time => alert.sent\n\t\t\t@uploader.save\n\t\tend\n\tend\n\t#hash[\"alert\"][\"info\"][\"description\"]\n\t\t\n\n\t# 處理 ruby on rails 網頁介面的資料\n\t#@uploader = Uploader.new(uploader_params)\n\t#@uploader.save\n\t\n\t# 通知 ifttt 來收新資料\n\tRails.logger.info \"Ping IFTTT...\"\n\tThread.new {ping_ifttt}\n\t\n\t# 傳回 response, 讓 push 端知道我們成功收到訊息了.\n\trender :xml => \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?> <Data><Status>true</Status></Data>\"\n end"
] |
[
"0.52776605",
"0.5221963",
"0.52193856",
"0.5156656",
"0.50978374",
"0.50968605",
"0.5079734",
"0.50520784",
"0.5052003",
"0.50402105",
"0.50212264",
"0.501424",
"0.50077546",
"0.50070643",
"0.5002505",
"0.49670017",
"0.4966316",
"0.4966118",
"0.4963846",
"0.49554917",
"0.49386072",
"0.49359217",
"0.49304715",
"0.49303913",
"0.4921622",
"0.49208254",
"0.4894155",
"0.48935682",
"0.48869482",
"0.48843542",
"0.4877318",
"0.48736626",
"0.48705432",
"0.4856903",
"0.48558757",
"0.48538917",
"0.4842205",
"0.4839344",
"0.4835348",
"0.4829358",
"0.48217133",
"0.4810619",
"0.47987217",
"0.4786883",
"0.47867504",
"0.4786729",
"0.47670594",
"0.4764495",
"0.47602493",
"0.47594637",
"0.4753642",
"0.47514445",
"0.47514027",
"0.47507107",
"0.4750085",
"0.47466812",
"0.4738215",
"0.4733128",
"0.4727487",
"0.4725737",
"0.47192505",
"0.471676",
"0.47166026",
"0.4714067",
"0.47139394",
"0.47116825",
"0.47036976",
"0.47032052",
"0.47007805",
"0.46981838",
"0.46979484",
"0.46969745",
"0.46923867",
"0.46908256",
"0.46894053",
"0.46876308",
"0.468436",
"0.46833542",
"0.4683146",
"0.46749705",
"0.46748954",
"0.46738088",
"0.46715006",
"0.4670486",
"0.46680826",
"0.46669257",
"0.46637222",
"0.4663081",
"0.46598426",
"0.4656157",
"0.4655375",
"0.4652831",
"0.4648095",
"0.46419308",
"0.4641121",
"0.46406466",
"0.46399993",
"0.4635174",
"0.46336514",
"0.46331468"
] |
0.55116343
|
0
|
PUT /pumpers/1 PUT /pumpers/1.xml
|
def update
@pumper = Pumper.find(params[:id])
respond_to do |format|
if @pumper.update_attributes(params[:pumper])
format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @pumper.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def update\n respond_to do |format|\n if @singer.update_attributes(params[:singer])\n flash[:notice] = 'Singer was successfully updated.'\n format.html { redirect_to(@singer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @singer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n @sifter = Sifter.find(params[:id])\n\n respond_to do |format|\n if @sifter.update_attributes(params[:sifter])\n flash[:notice] = 'Sifter was successfully updated.'\n format.html { redirect_to(@sifter) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sifter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoofer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n connection.put(element_path, to_xml)\n end",
"def update\n @shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n flash[:notice] = 'Shelf was successfully updated.'\n format.html { redirect_to(@shelf) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shelf.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n\n update_params = {inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool}\n respond_to do |format|\n if @checklisten_vorlage.update(update_params)\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n else\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error />'}\n end\n end\n end",
"def update\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n if @shot.update_attributes(params[:shot])\n format.html { redirect_to(@shot, :notice => 'Shot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pneighbour = Pneighbour.find(params[:id])\n\n respond_to do |format|\n if @pneighbour.update_attributes(params[:pneighbour])\n format.html { redirect_to(@pneighbour, :notice => 'Pneighbour was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pneighbour.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end",
"def update\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n if @rooster.update_attributes(params[:rooster])\n format.html { redirect_to @rooster, notice: 'Rooster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rooster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spawner = Spawner.find(params[:id])\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n if @spawner.update_attributes(spawner_params)\n format.html { redirect_to @spawner, notice: 'Spawner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spawner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @booker = Booker.find(params[:id])\n\n respond_to do |format|\n if @booker.update_attributes(params[:booker])\n format.html { redirect_to(@booker, :notice => 'Booker was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @booker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pump_line = PumpLine.find(params[:id])\n\n respond_to do |format|\n if @pump_line.update_attributes(params[:pump_line])\n format.html {render :template => 'shared/close', :layout => \"fancybox\"}\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pump_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pocket = Pocket.find_pocket(params[:id])\n\n respond_to do |format|\n if @pocket.update_attributes(params[:pocket])\n flash[:notice] = 'Pocket was successfully updated.'\n format.html { redirect_to(@pocket) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pocket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @peep = Peep.find(params[:id])\n\n respond_to do |format|\n if @peep.update_attributes(params[:peep])\n format.html { redirect_to(@peep, :notice => 'Peep was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @peep.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n @draft_partnership = DraftPartnership.find(params[:id])\n\n respond_to do |format|\n if @draft_partnership.update_attributes(params[:partnership])\n\n format.xml \n else\n \n format.xml { render :xml => @draft_partnership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @brother = Brother.find(params[:id])\n\n respond_to do |format|\n if @brother.update_attributes(params[:brother])\n flash[:notice] = 'Brother was successfully updated.'\n format.html { redirect_to roster_show_path(@brother) }\n format.xml { head :ok }\n else\n #debugger\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @brother.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @wrestler = Wrestler.find(params[:id])\n\n respond_to do |format|\n if @wrestler.update_attributes(params[:wrestler])\n format.html { redirect_to(@wrestler, :notice => 'Wrestler was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wrestler.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @timesheet = Incident.find(params[:incident_id]).timesheet\n\t@pumper = @timesheet.pumpers.build(params[:pumper])\n\n respond_to do |format|\n if @pumper.save\n format.html { redirect_to(edit_incident_timesheet_path, :notice => 'Pumper was successfully created.') }\n else\n format.html { render :new }\n end\n end\n end",
"def update\n @snippit = Snippit.find(params[:id])\n\n respond_to do |format|\n if @snippit.update_attributes(params[:snippit])\n format.html { redirect_to(@snippit, :notice => 'Snippit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @snippit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tourpoint = Tourpoint.find(params[:id])\n\n respond_to do |format|\n if @tourpoint.update_attributes(params[:tourpoint])\n flash[:notice] = 'Tourpoint was successfully updated.'\n format.html { redirect_to(@tourpoint) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tourpoint.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @roaster = Roaster.find(params[:id])\n\n respond_to do |format|\n if @roaster.update_attributes(params[:roaster])\n flash[:notice] = 'Roaster was successfully updated.'\n format.html { redirect_to(@roaster) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @roaster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @serie = Serie.find(params[:id])\n\n respond_to do |format|\n if @serie.update_attributes(serie_params)\n format.html { redirect_to(@serie, :notice => 'Serie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @newspapper = Newspapper.find(params[:id])\n\n respond_to do |format|\n if @newspapper.update_attributes(params[:newspapper])\n flash[:notice] = 'Newspapper was successfully updated.'\n format.html { redirect_to(@newspapper) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @newspapper.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n put :update\n end",
"def update\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n if @snap.update_attributes(params[:snap])\n format.html { redirect_to(@snap, :notice => 'Snap was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @snap.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def update\n @insurer = Insurer.find(params[:id])\n\n respond_to do |format|\n if @insurer.update_attributes(params[:insurer])\n format.html { redirect_to(@insurer, :notice => 'Insurer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @insurer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @punch = Punch.find(params[:id])\n\n respond_to do |format|\n if @punch.update_attributes(params[:punch])\n format.html { redirect_to @punch, notice: 'Punch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @punch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @streamer = Streamer.find(params[:id])\n\n respond_to do |format|\n if @streamer.update_attributes(params[:streamer])\n format.html { redirect_to @streamer, notice: 'Streamer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @streamer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.find(params[:id])\n \n #Sicherstellen, dass Benutzer synchronisiert wird auch wenn nur Objekt-Zuordnungen anders sind!\n @benutzer.updated_at = DateTime.now \n\n if bNode.xpath('objekt_zuordnungs').length > 0\n @benutzer.setze_objekt_zuordnungen(bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i})\n end\n if @benutzer.update(benutzer_params(bNode))\n success(nil)\n else\n error(@benutzer.errors)\n end\n end",
"def destroy\n @pumper = Pumper.find(params[:id])\n @pumper.destroy\n\n respond_to do |format|\n format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully deleted.') }\n format.xml { head :ok }\n end\n end",
"def update\n @promos = Promos.find(params[:id])\n\n respond_to do |format|\n if @promos.update_attributes(params[:promos])\n flash[:notice] = 'Promos was successfully updated.'\n format.html { redirect_to(@promos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @promos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @spiel = Spiel.find(params[:id])\n\n respond_to do |format|\n if @spiel.update_attributes(params[:spiel])\n format.html { redirect_to(@spiel, :notice => 'Spiel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spiel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tournament = @resource_finder.find(params[:id])\n\n respond_to do |format|\n if @tournament.update_attributes(params[:tournament])\n flash[:notice] = 'Tournament was successfully updated.'\n format.html { redirect_to_resource }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tournament.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @sticker = Sticker.find(params[:id])\n \n respond_to do |format|\n if @sticker.update_attributes(params[:sticker])\n format.html { redirect_to(@sticker, :notice => 'Sticker was successfully updated.') }\n format.json { render :json => @sticker.to_json }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sticker.errors.to_json }\n format.xml { render :xml => @sticker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @waiter = Waiter.find(params[:id])\n\n respond_to do |format|\n if @waiter.update_attributes(params[:waiter])\n format.html { redirect_to @waiter, notice: 'Waiter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @waiter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def update\n\n respond_to do |format|\n if @publisher.update_attributes(params[:publisher])\n flash[:notice] = 'Publisher was successfully updated.'\n format.html { redirect_to(@publisher) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @publisher.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @card_punch = CardPunch.find(params[:id])\n\n respond_to do |format|\n if @card_punch.update_attributes(params[:card_punch])\n format.html { redirect_to(@card_punch, :notice => 'CardPunch was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @card_punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @prayer = Prayer.find(params[:id])\n\n respond_to do |format|\n if @prayer.update_attributes(params[:prayer])\n format.html { redirect_to @prayer, notice: 'Prayer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spieler = Spieler.find(params[:id])\n\n respond_to do |format|\n if @spieler.update_attributes(params[:spieler])\n format.html { redirect_to @spieler, notice: 'Spieler was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spieler.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @probe = Probe.find(params[:id])\n\n respond_to do |format|\n if @probe.update_attributes(params[:probe])\n flash[:notice] = 'Probe was successfully updated.'\n format.html { redirect_to(@probe) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @probe.errors }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\r\n @uom = Uom.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @uom.update_attributes(params[:uom])\r\n format.html { redirect_to(@uom, :notice => 'Uom was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n \r\n end\r\n end\r\n end",
"def put(*args)\n request :put, *args\n end",
"def update\n respond_to do |format|\n if @usser.update(usser_params)\n format.html { redirect_to @usser, notice: 'Usser was successfully updated.' }\n format.json { render :show, status: :ok, location: @usser }\n else\n format.html { render :edit }\n format.json { render json: @usser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @u_ser = USer.find(params[:id])\n\n respond_to do |format|\n if @u_ser.update_attributes(params[:u_ser])\n format.html { redirect_to @u_ser, notice: 'U ser was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @u_ser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @spouse = Spouse.find(params[:id])\n\n respond_to do |format|\n if @spouse.update_attributes(params[:spouse])\n flash[:notice] = 'Spouse was successfully updated.'\n format.html { redirect_to(@spouse) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spouse.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @scouter = Scouter.find(params[:id])\n\n respond_to do |format|\n if @scouter.update_attributes(params[:scouter])\n format.html { redirect_to(@scouter, :notice => 'Scouter was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scouter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @fucker = Fucker.find(params[:id])\n\n respond_to do |format|\n if @fucker.update_attributes(params[:fucker])\n format.json { head :no_content }\n else\n format.json { render json: @fucker.errors, status: :internal_server_error }\n end\n end\n end",
"def update\n @geoname = Geoname.find(params[:id])\n\n respond_to do |format|\n if @geoname.update_attributes(params[:geoname])\n flash[:notice] = 'Geoname was successfully updated.'\n format.html { redirect_to(@geoname) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @geoname.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\n end",
"def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"def update\n @washing_station = WashingStation.find(params[:id])\n\n respond_to do |format|\n if @washing_station.update_attributes(params[:washing_station])\n format.html { redirect_to(@washing_station, :notice => 'WashingStation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @washing_station.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @singer.update(singer_params)\n format.html { redirect_to @singer, notice: \"Singer was successfully updated.\" }\n format.json { render :show, status: :ok, location: @singer }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @singer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n @ministry = @trip.ministry\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n #flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n @data_files = DataFile.find(:all, :order => :name)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pokemon = Pokemon.find(params[:id])\n\n respond_to do |format|\n if @pokemon.update_attributes(params[:pokemon])\n flash[:notice] = 'Pokemon was successfully updated.'\n format.html { redirect_to(@pokemon) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pokemon.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @post328 = Post328.find(params[:id])\n\n respond_to do |format|\n if @post328.update_attributes(params[:post328])\n format.html { redirect_to(@post328, :notice => 'Post328 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post328.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @simperson = Simperson.find(params[:id])\n\n respond_to do |format|\n if @simperson.update_attributes(params[:simperson])\n flash[:notice] = 'Simperson was successfully updated.'\n format.html { redirect_to(@simperson) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @simperson.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pier.update(pier_params)\n format.html { redirect_to @pier, notice: 'Pier was successfully updated.' }\n format.json { render :show, status: :ok, location: @pier }\n else\n format.html { render :edit }\n format.json { render json: @pier.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @taller.update(taller_params)\n format.html { redirect_to @taller, notice: 'Taller was successfully updated.' }\n format.json { render :show, status: :ok, location: @taller }\n else\n format.html { render :edit }\n format.json { render json: @taller.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @moniker.update(moniker_params)\n format.html { redirect_to @moniker, notice: \"Moniker was successfully updated.\" }\n format.json { render :show, status: :ok, location: @moniker }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @moniker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tape = Tape.find(params[:id])\n\n respond_to do |format|\n if @tape.update_attributes(params[:tape])\n flash[:notice] = 'Tape was successfully updated.'\n format.html { redirect_to(@tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end",
"def update\n @setor = Setor.find(params[:id])\n\n respond_to do |format|\n if @setor.update_attributes(params[:setor])\n format.html { redirect_to(setors_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @setor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @poopstation = Poopstation.find(params[:id])\n\n respond_to do |format|\n if @poopstation.locations.create(:name => params[:location], :city => params[:city], :state => params[:state])\n format.html { redirect_to @poopstation, notice: 'Spanks!' }\n format.json { head :no_content }\n format.mobile { redirect_to @poopstation, notice: 'Spanks!' }\n else\n format.html { render action: \"edit\" }\n format.mobile { render action: \"edit\" }\n format.json { render json: @poopstation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(*args)\n put(*args)\n end",
"def update(*args)\n put(*args)\n end",
"def update\n @volunteer = Volunteer.find(params[:id])\n\n respond_to do |format|\n if @volunteer.update_attributes(params[:volunteer])\n flash[:notice] = 'Volunteer was successfully updated.'\n format.html { redirect_to(@volunteer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @volunteer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @volunteer = Volunteer.find(params[:id])\n\n respond_to do |format|\n if @volunteer.update_attributes(params[:volunteer])\n flash[:notice] = 'Volunteer was successfully updated.'\n format.html { redirect_to(@volunteer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @volunteer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @punch.update(punch_params)\n format.html { redirect_to @punch, notice: 'Punch was successfully updated.' }\n format.json { render :show, status: :ok, location: @punch }\n else\n format.html { render :edit }\n format.json { render json: @punch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @foyer = Foyer.find(params[:id])\n\n respond_to do |format|\n if @foyer.update_attributes(params[:foyer])\n flash[:notice] = 'Le foyer a bien été mis à jour.'\n format.html { redirect_to(@foyer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @foyer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])\n\n respond_to do |format|\n if @<%= file_name %>.save\n flash[:notice] = '<%= class_name %> was successfully created.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end\n\n # PUT /<%= table_name %>/1\n # PUT /<%= table_name %>/1.xml\n def update\n @<%= file_name %> = <%= class_name %>.find(params[:id])\n\n respond_to do |format|\n if @<%= file_name %>.update_attributes(params[:<%= file_name %>])\n flash[:notice] = '<%= class_name %> was successfully updated.'\n format.html { redirect_to(@<%= file_name %>) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @server_rack = ServerRack.find(params[:id])\n\n respond_to do |format|\n if @server_rack.update_attributes(params[:server_rack])\n format.html { redirect_to(@server_rack, :notice => 'Server rack was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server_rack.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ru_pusk = RuPusk.find(params[:id])\n\n respond_to do |format|\n if @ru_pusk.update_attributes(params[:ru_pusk])\n format.html { redirect_to(@ru_pusk, :notice => 'Ru pusk was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ru_pusk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def template_update(id, type, filename)\n check_id_or_raise id\n check_template_type_or_raise type\n check_filename_or_raise filename\n response = http_request_multipart :put, @base_url + \"/templates/#{id}.xml\", 200,\n { :provider_key => @provider_key,\n :draft => File.read(filename), \n :multipart => true}\n puts 'at update call'\n _id, _updated_at = parse_response response, type\n response = http_request :put, \"#{@base_url}/templates/#{id}/publish\", 200,\n { :params => { :provider_key => @provider_key } }\n puts 'at publish call'\n parse_response response, 'page'\n end",
"def update\n @tower = Tower.find(params[:id])\n\n respond_to do |format|\n if @tower.update_attributes(params[:tower])\n format.html { redirect_to @tower, :notice => 'Tower was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tower.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @team_roaster = TeamRoaster.find(params[:id])\n\n respond_to do |format|\n if @team_roaster.update_attributes(params[:team_roaster])\n format.html { redirect_to(@team_roaster, :notice => 'Team roaster was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team_roaster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def publish_mapping_update(mapping)\n nutella.net.publish('mapping/updated', mapping)\n puts 'Sent mapping/updated'\nend",
"def update\n @painter = Painter.find(params[:id])\n\n respond_to do |format|\n if @painter.update_attributes(params[:painter])\n format.html { redirect_to(@painter, :notice => 'Painter was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @painter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @spit = Spit.find(params[:id])\n\n respond_to do |format|\n if @spit.update_attributes(params[:spit])\n format.html { redirect_to(@spit, :notice => 'Spit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @bunker = Bunker.find(params[:id])\n\n respond_to do |format|\n if @bunker.update_attributes(params[:bunker])\n flash[:notice] = 'Bunker was successfully updated.'\n format.html { redirect_to(@bunker) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bunker.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @serie = Serie.find(params[:id])\n\n respond_to do |format|\n if @serie.update_attributes(params[:serie])\n format.html { redirect_to(niveis_ensino_serie_url(@nivel,@serie), :notice => 'Serie atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @officer = Officer.find(params[:id])\n\n respond_to do |format|\n if @officer.update_attributes(params[:officer])\n flash[:notice] = 'Officer was successfully updated.'\n format.html { redirect_to(@officer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @officer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pushup = Pushup.find(params[:id])\n\n respond_to do |format|\n if @pushup.update_attributes(params[:pushup])\n format.html { redirect_to @pushup, notice: 'Pushup was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pushup.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.593859",
"0.56422377",
"0.5545055",
"0.5525065",
"0.54254895",
"0.5371809",
"0.5352304",
"0.52863914",
"0.52292246",
"0.5166626",
"0.51535314",
"0.51159924",
"0.5077766",
"0.50560397",
"0.5049244",
"0.5030347",
"0.50280684",
"0.5011187",
"0.5009801",
"0.50001967",
"0.49911296",
"0.49893722",
"0.498784",
"0.49810797",
"0.49789336",
"0.4975521",
"0.4970606",
"0.49702105",
"0.4968415",
"0.4967119",
"0.496656",
"0.4965503",
"0.49547985",
"0.49497736",
"0.4948592",
"0.49476886",
"0.49397984",
"0.49391678",
"0.49342206",
"0.49318856",
"0.4923238",
"0.49212176",
"0.49198335",
"0.49183145",
"0.49180275",
"0.4917882",
"0.4913421",
"0.49117804",
"0.49114218",
"0.49057823",
"0.48942965",
"0.48858324",
"0.48858324",
"0.48858324",
"0.48771533",
"0.487601",
"0.48734415",
"0.48667356",
"0.4865288",
"0.48650426",
"0.48638844",
"0.48594514",
"0.4848845",
"0.48455352",
"0.4842763",
"0.48369813",
"0.4836334",
"0.48337004",
"0.48286194",
"0.4828568",
"0.48262137",
"0.4826034",
"0.48211977",
"0.4817405",
"0.48166734",
"0.48123142",
"0.48096764",
"0.48024425",
"0.4797431",
"0.47972184",
"0.47954473",
"0.47954473",
"0.47929186",
"0.47929186",
"0.47910526",
"0.47865278",
"0.47840098",
"0.47826365",
"0.47767732",
"0.47749135",
"0.47722027",
"0.47710395",
"0.47684607",
"0.47680202",
"0.47659996",
"0.47646317",
"0.47595087",
"0.4755803",
"0.47520182",
"0.47501117"
] |
0.6492535
|
0
|
DELETE /pumpers/1 DELETE /pumpers/1.xml
|
def destroy
@pumper = Pumper.find(params[:id])
@pumper.destroy
respond_to do |format|
format.html { redirect_to(incident_timesheet_path, :notice => 'Pumper was successfully deleted.') }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @pump_line = PumpLine.find(params[:id])\n @pump_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(pump_lines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bail = Bail.find(params[:id])\n# @bail.destroy\n\n respond_to do |format|\n format.html { redirect_to(bails_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @pneighbour = Pneighbour.find(params[:id])\n @pneighbour.destroy\n\n respond_to do |format|\n format.html { redirect_to(pneighbours_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @services_charger = ServicesCharger.find(params[:id])\n @services_charger.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_chargers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @snap = Snap.find(params[:id])\n @snap.destroy\n\n respond_to do |format|\n format.html { redirect_to(snaps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ru_pusk = RuPusk.find(params[:id])\n @ru_pusk.destroy\n\n respond_to do |format|\n format.html { redirect_to(ru_pusks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @brother = Brother.find(params[:id])\n @brother.destroy\n\n respond_to do |format|\n format.html { redirect_to(brothers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @allergy = Allergy.find(params[:id])\n @allergy.destroy\n\n respond_to do |format|\n format.html { redirect_to(allergies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @plantilla = Plantilla.find(params[:id])\n @plantilla.destroy\n\n respond_to do |format|\n format.html { redirect_to(plantillas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(dossiers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @child_dupa2 = ChildDupa2.find(params[:id])\n @child_dupa2.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_dupa2s_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @allergen = Allergen.find(params[:id])\n @allergen.destroy\n\n respond_to do |format|\n format.html { redirect_to(allergens_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @probe = Probe.find(params[:id])\n @probe.destroy\n\n respond_to do |format|\n format.html { redirect_to(probes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @clicker = Clicker.find(params[:id])\n @clicker.destroy\n\n respond_to do |format|\n format.html { redirect_to(clickers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sifter = Sifter.find(params[:id])\n @sifter.destroy\n\n respond_to do |format|\n format.html { redirect_to(sifters_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @peep = Peep.find(params[:id])\n @peep.destroy\n\n respond_to do |format|\n format.html { redirect_to(peeps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @beer.destroy\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end",
"def purge\n \n @job = DialJob.find(params[:id])\n\t@job.dial_results.each do |r|\n\t\tr.destroy\n\tend\n\t@job.destroy\n\t\n\tdir = nil\n\tjid = @job.id\n\tdfd = Dir.new(WarVOX::Config.data_path)\n\tdfd.entries.each do |ent|\n\t\tj,m = ent.split('-', 2)\n\t\tif (m and j == jid)\n\t\t\tdir = File.join(WarVOX::Config.data_path, ent)\n\t\tend\n\tend\n\t\n\tFileUtils.rm_rf(dir) if dir\n\n respond_to do |format|\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bouncer = Bouncer.find(params[:id])\n @bouncer.destroy\n\n respond_to do |format|\n format.html { redirect_to(bouncers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @uom = Uom.find(params[:id])\r\n @uom.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_back_or_default(uoms_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @officer = Officer.find(params[:id])\n @officer.destroy\n\n respond_to do |format|\n format.html { redirect_to(officers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @shelf = Shelf.find(params[:id])\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to(shelves_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @periode = Periode.find(params[:id])\n @periode.destroy\n\n respond_to do |format|\n format.html { redirect_to(periodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @promos = Promos.find(params[:id])\n @promos.destroy\n\n respond_to do |format|\n format.html { redirect_to(promos_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n \n @clicker = Clicker.find(params[:id])\n \n@clicker.destroy\n\n \n respond_to do |format|\n \n format.html { redirect_to(clickers_url) }\n \n format.xml { head :ok }\n \nend\n \nend",
"def destroy\n @diaper = Diaper.find(params[:id])\n @diaper.destroy\n\n respond_to do |format|\n format.html { redirect_to(diapers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @booker = Booker.find(params[:id])\n @booker.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @chirp = Chirp.find(params[:id])\n @chirp.destroy\n\n respond_to do |format|\n format.html { redirect_to(chirps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @roaster = Roaster.find(params[:id])\n @roaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(roasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ministerios = Ministerios.find(params[:id])\n @ministerios.destroy\n\n respond_to do |format|\n format.html { redirect_to(ministerios_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wrestler = Wrestler.find(params[:id])\n @wrestler.destroy\n\n respond_to do |format|\n format.html { redirect_to(wrestlers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n pedigree = @person.pedigree\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to(pedigree_url(pedigree)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @test_plant = TestPlant.find(params[:id])\n @test_plant.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_plants_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appoiment = Appoiment.find(params[:id])\n @appoiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appoiments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pdig = Pdig.find(params[:id])\n @pdig.destroy\n\n respond_to do |format|\n format.html { redirect_to(pdigs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @spiel = Spiel.find(params[:id])\n @spiel.destroy\n\n respond_to do |format|\n format.html { redirect_to(spiels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @backup = Backup.find(params[:id])\n @backup.destroy\n\n respond_to do |format|\n format.html { redirect_to(backups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lunch = Lunch.find(params[:id])\n @lunch.destroy\n\n respond_to do |format|\n format.html { redirect_to(lunches_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @foyer = Foyer.find(params[:id])\n @foyer.destroy\n\n respond_to do |format|\n format.html { redirect_to(foyers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bap = Bap.find(params[:id])\n @bap.destroy\n\n respond_to do |format|\n format.html { redirect_to(baps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip = Trip.find(params[:id])\n @ministry = @trip.ministry\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(@ministry) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @galerie = Galerie.find(params[:id])\n @galerie.destroy\n\n respond_to do |format|\n format.html { redirect_to(galeries_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @refferalmaster = Refferalmaster.find(params[:id])\n @refferalmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(refferalmasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cattle_id = CattleId.find(params[:id])\n @cattle_id.destroy\n\n respond_to do |format|\n format.html { redirect_to(cattle_ids_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pig = Pig.find(params[:id])\n @pig.destroy\n\n respond_to do |format|\n format.html { redirect_to(pigs_url) }\n format.xml { head :ok }\n end\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def destroy\n @bunker = Bunker.find(params[:id])\n @bunker.destroy\n\n respond_to do |format|\n format.html { redirect_to(bunkers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post445 = Post445.find(params[:id])\n @post445.destroy\n\n respond_to do |format|\n format.html { redirect_to(post445s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to(monkeys_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dragon = Dragon.find(params[:id])\n @dragon.destroy\n\n respond_to do |format|\n format.html { redirect_to(dragons_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rute = Rute.find(params[:id])\n @rute.destroy\n\n respond_to do |format|\n format.html { redirect_to(rutes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatorios = Relatorio.find(params[:id])\n @relatorios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"def rm(*path)\n super; on_success{ nil }\n end",
"def destroy\n @dinosaur = Dinosaur.find(params[:id])\n @dinosaur.destroy\n\n respond_to do |format|\n format.html { redirect_to(dinosaurs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @uitgelicht = Uitgelicht.find(params[:id])\n @uitgelicht.destroy\n\n respond_to do |format|\n format.html { redirect_to(uitgelichts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @matchup = Matchup.find(params[:id])\n @matchup.destroy\n\n respond_to do |format|\n format.html { redirect_to(matchups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hookup = Hookup.find(params[:id])\n @hookup.destroy\n\n respond_to do |format|\n format.html { redirect_to(hookups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @server_rack = ServerRack.find(params[:id])\n @server_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(server_racks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feria2010observacion = Feria2010observacion.find(params[:id])\n @feria2010observacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(feria2010observaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @finger = Finger.find(params[:id])\n @finger.destroy\n\n respond_to do |format|\n format.html { redirect_to(fingers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @razdel1 = Razdel1.find(params[:id])\r\n @razdel1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(razdel1s_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def destroy\n @destination = Destination.find(params[:id])\n @destination.destroy\n\n respond_to do |format|\n format.html { redirect_to(destinations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @echo = Echo.find(params[:id])\n @echo.destroy\n\n respond_to do |format|\n format.html { redirect_to(echoes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @puppy = Puppy.find(params[:id])\n @puppy.destroy\n\n respond_to do |format|\n format.html { redirect_to(puppies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post328 = Post328.find(params[:id])\n @post328.destroy\n\n respond_to do |format|\n format.html { redirect_to(post328s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy; delete end",
"def destroy\n @draught = Draught.find(params[:id])\n @draught.destroy\n\n respond_to do |format|\n format.html { redirect_to(draughts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @burger = Burger.find(params[:id])\n @burger.destroy\n\n respond_to do |format|\n format.html { redirect_to(burgers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @goodsrecieptnotemaster = Goodsrecieptnotemaster.find(params[:id])\n @goodsrecieptnotemaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(goodsrecieptnotemasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @medewerker = Medewerker.find(params[:id])\n @medewerker.destroy\n\n respond_to do |format|\n format.html { redirect_to(medewerkers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post58 = Post58.find(params[:id])\n @post58.destroy\n\n respond_to do |format|\n format.html { redirect_to(post58s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tourpoint = Tourpoint.find(params[:id])\n @tourpoint.destroy\n\n respond_to do |format|\n format.html { redirect_to(tourpoints_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @colonoscopytest = Colonoscopytest.find(params[:id])\n @colonoscopytest.destroy\n\n respond_to do |format|\n format.html { redirect_to(colonoscopytests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tape = Tape.find(params[:id])\n @tape.destroy\n\n respond_to do |format|\n format.html { redirect_to(tapes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pokemon = Pokemon.find(params[:id])\n @pokemon.destroy\n\n respond_to do |format|\n format.html { redirect_to(pokemons_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @bedding = Bedding.find(params[:id])\n @bedding.destroy\n\n respond_to do |format|\n format.html { redirect_to(beddings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @saved_tape = SavedTape.find(params[:id])\n @saved_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'mytapes' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post481 = Post481.find(params[:id])\n @post481.destroy\n\n respond_to do |format|\n format.html { redirect_to(post481s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @insurer = Insurer.find(params[:id])\n @insurer.destroy\n\n respond_to do |format|\n format.html { redirect_to(insurers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n \t@courier = Courier.find(params[:courier_id])\n @delivery = @courier.deliveries.find(params[:delivery_id])\n @dropoff = @delivery.dropoffs.find(params[:id])\n @dropoff.destroy\n\n respond_to do |format|\n format.html { redirect_to(dropoffs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @floormaster = Floormaster.find(params[:id])\n @floormaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(floormasters_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @installation = Installation.find(params[:installation_id]) \n @eat = Eat.find(params[:id])\n @eat.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@pool = Pool.find(params[:id])\n @pool.destroy\n\n respond_to do |format|\n format.html { redirect_to(pools_url) }\n format.xml { head :ok }\n end\n end"
] |
[
"0.6565413",
"0.6254016",
"0.6202946",
"0.6142241",
"0.61337095",
"0.60871947",
"0.6065154",
"0.6047012",
"0.60249954",
"0.6003987",
"0.59886503",
"0.5985449",
"0.59829986",
"0.59601116",
"0.5948457",
"0.5939455",
"0.5933279",
"0.5933271",
"0.5929426",
"0.59246683",
"0.5923815",
"0.5911367",
"0.5898482",
"0.58810294",
"0.58779395",
"0.5875835",
"0.5861478",
"0.585061",
"0.5847995",
"0.5847884",
"0.584457",
"0.58433217",
"0.5842218",
"0.58377385",
"0.58335245",
"0.5832925",
"0.5824937",
"0.58235264",
"0.58142453",
"0.5812124",
"0.5809527",
"0.5804452",
"0.57969594",
"0.5792361",
"0.57902074",
"0.5787093",
"0.57822627",
"0.57788205",
"0.57760686",
"0.577237",
"0.5760784",
"0.5759938",
"0.5758547",
"0.5757415",
"0.5753472",
"0.5750996",
"0.57504916",
"0.57499665",
"0.5749826",
"0.574908",
"0.574643",
"0.57450795",
"0.574445",
"0.57392925",
"0.5739075",
"0.573592",
"0.57340884",
"0.5732718",
"0.57303613",
"0.57219136",
"0.57200456",
"0.57193613",
"0.5715363",
"0.57123816",
"0.57041115",
"0.5699668",
"0.5692377",
"0.5692029",
"0.5689531",
"0.5684205",
"0.56838644",
"0.56829715",
"0.5679343",
"0.5679063",
"0.56782323",
"0.56780785",
"0.5677158",
"0.56767094",
"0.56763595",
"0.56756747",
"0.5674091",
"0.5671037",
"0.5667868",
"0.5661102",
"0.56586397",
"0.565377",
"0.5652862",
"0.56490403",
"0.5647834",
"0.564625"
] |
0.7027457
|
0
|
Creates a new tape drive. API Key Scope: tape_drives / create
|
def create_tape_drive_by_tape_library(tape_library_id, tape_drive_body, opts = {})
data, _status_code, _headers = create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.create_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.create_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.create_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#create_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @drive_type = DriveType.new(params[:drive_type])\n\n respond_to do |format|\n if @drive_type.save\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully created.') }\n format.xml { render :xml => @drive_type, :status => :created, :location => @drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @trip_driver = TripDriver.new(trip_driver_params)\n\n respond_to do |format|\n if @trip_driver.save\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully created.' }\n format.json { render json: @trip_driver, status: :created, location: @trip_driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @beattape = Beattape.new(params[:beattape])\n\n respond_to do |format|\n if @beattape.save\n format.html { redirect_to @beattape, notice: 'Beattape was successfully created.' }\n format.json { render json: @beattape, status: :created, location: @beattape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tape = Tape.new(params[:tape])\n\n respond_to do |format|\n if @tape.save\n flash[:notice] = 'Tape was successfully created.'\n format.html { redirect_to(@tape) }\n format.xml { render :xml => @tape, :status => :created, :location => @tape }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tape_type = TapeType.new(params[:tape_type])\n\n respond_to do |format|\n if @tape_type.save\n flash[:notice] = 'TapeType was successfully created.'\n format.html { redirect_to tape_types_path }\n format.xml { render :xml => @tape_type, :status => :created, :location => @tape_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tape = Tape.new(tape_params)\n\n respond_to do |format|\n if @tape.save\n format.html { redirect_to @tape, notice: 'Tape was successfully created.' }\n format.json { render :show, status: :created, location: @tape }\n else\n format.html { render :new }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def create\n @drives = Drives.new(params[:drives])\n\n respond_to do |format|\n if @drives.save\n flash[:notice] = 'Drives was successfully created.'\n format.html { redirect_to(@drives) }\n format.xml { render :xml => @drives, :status => :created, :location => @drives }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @drive_system = DriveSystem.new(params[:drive_system])\n @drive_system.truck_id = @drive_system.driver.truck_id\n respond_to do |format|\n if @drive_system.save\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully created.' }\n format.json { render json: @drive_system, status: :created, location: @drive_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_pipe_drive_deal\n\n path = GlobalConstant::Base.pipedrive['deals_end_point'] + \"?api_token=#{GlobalConstant::Base.pipedrive['api_token']}\"\n\n pipe_drive_request = PipeDrive::HttpHelper.new()\n\n r = pipe_drive_request.send_request_of_type('post', path, @request_params)\n return r unless r.success?\n\n success\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n # build a 'temporary' post which is written to DB later (create-method)\n @drive = Drive.new\n end",
"def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend",
"def create_station\n request = ['Enter station name: ']\n getting(request, :approve_station, :create_station!)\n end",
"def create\n @vdisk = Vdisk.new(params[:vdisk])\n\n respond_to do |format|\n if @vdisk.save\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully created.' }\n format.json { render json: @vdisk, status: :created, location: @vdisk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @machine_drive_type = MachineDriveType.new(params[:machine_drive_type])\n\n respond_to do |format|\n if @machine_drive_type.save\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully created.') }\n format.xml { render :xml => @machine_drive_type, :status => :created, :location => @machine_drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tap = Tap.new\n\n respond_to do |format|\n if @tap.save\n format.html { redirect_to taps_path, notice: 'Tap was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tap }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n save_file\n @tablet = Tablet.new(params[:tablet])\n\n respond_to do |format|\n if @tablet.save\n format.html { redirect_to @tablet, notice: 'Tablet was successfully created.' }\n format.json { render json: @tablet, status: :created, location: @tablet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @moto_drive_type = MotoDriveType.new(params[:moto_drive_type])\n\n respond_to do |format|\n if @moto_drive_type.save\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully created.') }\n format.xml { render :xml => @moto_drive_type, :status => :created, :location => @moto_drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @driver_trip_seat = DriverTripSeat.new(driver_trip_seat_params)\n\n respond_to do |format|\n if @driver_trip_seat.save\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully created.' }\n format.json { render :show, status: :created, location: @driver_trip_seat }\n else\n format.html { render :new }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @templete = Templete.new(params[:templete])\n\n respond_to do |format|\n if @templete.save\n format.html { redirect_to @templete, :notice => 'Templete was successfully created.' }\n format.json { render :json => @templete, :status => :created, :location => @templete }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @trip_type = TripType.new(trip_type_params)\n\n respond_to do |format|\n if @trip_type.save\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully created.' }\n format.json { render :show, status: :created, location: @trip_type }\n else\n format.html { render :new }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n HTTParty.post(create_url, :options => { :headers => HEADERS })\n end",
"def drive_params\n params.require(:drive).permit(:name)\n end",
"def create\n @drive = Drive.new(drive_params)\n # write drive to database\n if @drive.save\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n # Einträge in drive_suppliers für alle FU-Lieferanten mit neuem FU erstellen\n @drivesuppliers.each do |drivesupplier|\n driveSupplierEntry = DriveSupplier.new\n driveSupplierEntry.drive_id = @drive.id\n driveSupplierEntry.supplier_id = drivesupplier.id\n driveSupplierEntry.save!\n end\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich erstellt.'\n else\n render 'new'\n end\n end",
"def drive_params\n params.require(:drive).permit!\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n refuse_access and return if contest_started\n\n @mixtape = Mixtape.new(mixtape_params)\n\n if @mixtape.save\n flash[:info] = \"Mixtape created successfully\"\n session[:mixtape] = @mixtape.id\n redirect_to @mixtape\n else\n render 'new'\n end\n end",
"def create\n trip = Trip.create(trip_params)\n\n respond_with trip\n end",
"def create\n @peptide = Peptide.new(params[:peptide])\n\n respond_to do |format|\n if @peptide.save\n format.html { redirect_to @peptide, :notice => 'Peptide was successfully created.' }\n format.json { render :json => @peptide, :status => :created, :location => @peptide }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @peptide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @t = T.new(params[:t])\n\n respond_to do |format|\n if @t.save\n format.html { redirect_to @t, notice: 'T was successfully created.' }\n format.json { render json: @t, status: :created, location: @t }\n else\n format.html { render action: \"new\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @physical_disk = PhysicalDisk.new(params[:physical_disk])\n\n respond_to do |format|\n if @physical_disk.save\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully created.' }\n format.json { render json: @physical_disk, status: :created, location: @physical_disk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createvolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n req = {}\n req[\"name\"] = \"oe-#{@thevolume.name}\"\n req[\"description\"] = @thevolume.description\n req[\"sizeGb\"] = @thevolume.size\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks', :method => 'post', :options => '', :data => req.to_json, :access_token => @thezone.toekn )\n d = checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n data = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{req[\"name\"]}', :method => 'get', :options => '', :access_token => @thezone.token) if d\n data ? data[\"name\"] : false\n end",
"def tape_params\n params.require(:tape).permit(:tp_site, :tp_date, :tp_article, :tp_url, :tp_status, :tp_tag, :tp_comments)\n end",
"def create\n @tcard = Tcard.new(tcard_params)\n\n respond_to do |format|\n if @tcard.save\n format.html { redirect_to @tcard, notice: 'Tcard was successfully created.' }\n format.json { render :show, status: :created, location: @tcard }\n else\n format.html { render :new }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t\t\tcurrent_driver.create_car(car_params)\n\t\t\tend",
"def create\n @guide_trip = GuideTrip.new(guide_trip_params)\n\n respond_to do |format|\n if @guide_trip.save\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @guide_trip }\n else\n format.html { render :new }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ride_type = RideType.new(ride_type_params)\n\n respond_to do |format|\n if @ride_type.save\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully created.' }\n format.json { render :show, status: :created, location: @ride_type }\n else\n format.html { render :new }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gtfs_trip = GtfsTrip.new(params[:gtfs_trip])\n\n respond_to do |format|\n if @gtfs_trip.save\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully created.') }\n format.xml { render :xml => @gtfs_trip, :status => :created, :location => @gtfs_trip }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def trip_create_params\n defaults = {\n car_id: account.cars.first.try(:id)\n }\n\n defaults.merge(\n params.require(:trip).permit(:car_id, :destination_longitude, :destination_latitude)\n )\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trip = Trip.new({\"name\" => \"New Trip\",\n \"beginning\" => Time.now.strftime(\"%d/%m/%Y\"),\n \"duration\" => \"0\",\n \"user\" => current_user})\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render home_path }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @turkey = Turkey.new(turkey_params)\n\n respond_to do |format|\n if @turkey.save\n format.html { redirect_to @turkey, notice: 'Turkey was successfully created.' }\n format.json { render :show, status: :created, location: @turkey }\n else\n format.html { render :new }\n format.json { render json: @turkey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @brake_type = BrakeType.new(brake_type_params)\n\n respond_to do |format|\n if @brake_type.save\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully created.' }\n format.json { render :show, status: :created, location: @brake_type }\n else\n format.html { render :new }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ride = current_user.create_ride(ride_params)\n create_resource @ride\n end",
"def create(path)\n output { post(path, params) }\n end",
"def create\n @lun_disk = LunDisk.new(params[:lun_disk])\n\n respond_to do |format|\n if @lun_disk.save\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully created.' }\n format.json { render json: @lun_disk, status: :created, location: @lun_disk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tccapi = Tccapi.new(tccapi_params)\n\n respond_to do |format|\n if @tccapi.save\n format.html { redirect_to @tccapi, notice: 'Tccapi was successfully created.' }\n format.json { render :show, status: :created, location: @tccapi }\n else\n format.html { render :new }\n format.json { render json: @tccapi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tune = Tune.new(params[:tune])\n\n respond_to do |format|\n if @tune.save\n format.html { redirect_to root_path notice: 'Tune was successfully created.' }\n format.json { render json: @tune, status: :created, location: @tune }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n err_objs=[]\n error=false\n user_id=MobileDevice.where(:access_token=>params[:access_token]).first.user_id\n if params.has_key?('trips')\n params[:trips].each do |trip|\n trip_id=trip[1][:trip_id] #save ref to trip id in case @trip.save fails (used in return response)\n if !create_trip(trip[1],user_id)\n error=true\n err_objs.push(trip_id)\n end\n end\n else\n error=true\n end\n respond_to do |format|\n if !error\n format.json { render json: {:msg => \"success\"}, status: :created }\n else\n format.json { render json: {:msg => \"Could not save the following trips. Please check that all required fields are filled out (license_plate, cargo, start_location, end_location, start_timestamp, end_timestamp)\", :err_ids => err_objs}, status: :unprocessable_entity }\n end\n end\n end",
"def create_train(title = '[CREATE] Please choose Train type:')\n train_type = ask_choose_train_type(title)\n\n user_input_number = ask_enter('Train number')\n\n train = train_type.new(user_input_number)\n @trains << train\n puts \"\\n[SUCCESS] #{train} created!\"\n rescue StandardError => e\n show_error_message(e)\n retry\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to trips_path, notice: 'Cesta byla vytvořena.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tarot = Tarot.new(tarot_params)\n\n respond_to do |format|\n if @tarot.save\n format.html { redirect_to @tarot, notice: 'Tarot was successfully created.' }\n format.json { render :show, status: :created, location: @tarot }\n else\n format.html { render :new }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @douga = Douga.new(douga_params)\n\n \n session = GoogleDrive::Session.from_config(\"client_secret.json\")\n\n\n file = session.upload_from_file(\"#{douga_params[:douga].tempfile.to_path}\",\"#{douga_params[:douga].tempfile.to_path}\", convert: false)\n # respond_to do |format|\n\n folder = session.collection_by_title(\"Movies\")\n folder.add(file)\n\n redirect_to root_path\n #\n # respond_to do |format|\n # if @douga.save\n # format.html { redirect_to @douga, notice: 'Douga was successfully created.' }\n # format.json { render :show, status: :created, location: @douga }\n # else\n # format.html { render :new }\n # format.json { render json: @douga.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @trip = Trip.new(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, :notice => 'Trip was successfully created.' }\n format.json { render :json => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_kit(params)\n Kit.create(params)\n end",
"def create\n @tablet = Tablet.new(tablet_params)\n\n respond_to do |format|\n if @tablet.save\n format.html { redirect_to @tablet, notice: 'Tablet was successfully created.' }\n format.json { render :show, status: :created, location: @tablet }\n else\n format.html { render :new }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_disk(disk_id, location, size, storage_account_type)\n @logger.info(\"create_disk(#{disk_id}, #{location}, #{size}, #{storage_account_type})\")\n resource_group_name = disk_id.resource_group_name()\n disk_name = disk_id.disk_name()\n caching = disk_id.caching()\n tags = AZURE_TAGS.merge({\n \"caching\" => caching\n })\n disk_params = {\n :name => disk_name,\n :location => location,\n :tags => tags,\n :disk_size => size,\n :account_type => storage_account_type\n }\n @logger.info(\"Start to create an empty managed disk `#{disk_name}' in resource group `#{resource_group_name}'\")\n @azure_client2.create_empty_managed_disk(resource_group_name, disk_params)\n end",
"def create\n trip = current_user.trips.new(trip_params)\n if trip.save\n render json: {\n status: :created,\n trip: trip\n }\n else\n render json: {\n status: 500,\n errors: trip.errors.full_messages\n }\n end\n end",
"def create\n response = Codeclimate::Api.client.post(@path)\n response.code == \"200\"\n end",
"def create\n @mag_tape = MagTape.new(params[:mag_tape])\n\n respond_to do |format|\n if @mag_tape.save\n format.html { redirect_to @mag_tape, notice: 'Mag Tape was successfully created.' }\n format.json { render json: @mag_tape, status: :created, location: @mag_tape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_test_disk(connection, zone)\n zone = 'us-central1-a'\n random_string = SecureRandom.hex\n\n disk = connection.disks.create({\n :name => \"fog-test-disk-#{random_string}\",\n :size_gb => \"10\",\n :zone => zone,\n :source_image => \"debian-7-wheezy-v20140408\",\n })\n disk.wait_for { ready? }\n disk\nend",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def create\n @fundamental_treasure = Fundamental::Treasure.new(params[:fundamental_treasure])\n\n respond_to do |format|\n if @fundamental_treasure.save\n format.html { redirect_to @fundamental_treasure, notice: 'Treasure was successfully created.' }\n format.json { render json: @fundamental_treasure, status: :created, location: @fundamental_treasure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fundamental_treasure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trip_params\n params.require(:trip).permit(:name, :description, :user_id, :start_date, :airport_id, :base64, attendee_ids:[], leg_ids:[])\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to current_user, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { redirect_to current_user, notice: \"Trip can't be created\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @device_type = DeviceType.new(device_type_params)\n\n respond_to do |format|\n if @device_type.save\n format.html { redirect_to browse_url(protocol: redirect_protocol), notice: 'Device type was successfully created.' }\n format.json { render :show, status: :created, location: @device_type }\n else\n format.html { render :new }\n format.json { render json: @device_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n make_create_request\n end",
"def create\n @trip = Trip.new(trip_params)\n @trip.user_id = current_user.id\n\n authorize @trip, :create?\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create body = {}\n @connection.request(method: :post, path: \"/volumes/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"def create\n @dtpic = Dtpic.new(params[:dtpic])\n\n respond_to do |format|\n if @dtpic.save\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully created.' }\n format.json { render json: @dtpic, status: :created, location: @dtpic }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trip_params\n params.require(:trip).permit(:code, :name, :price, :temperature, :depart_at, :return_at, :url)\n end",
"def create\n @controltltkt = Controltltkt.new(controltltkt_params)\n\n respond_to do |format|\n if @controltltkt.save\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controltltkt }\n else\n format.html { render :new }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trip = current_user.trips.build(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render json: @trip, status: :created, location: @trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ty = Tie.new(ty_params)\n\n respond_to do |format|\n if @ty.save\n format.html { redirect_to @ty, notice: 'Tie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ty }\n else\n format.html { render action: 'new' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @typing = Typing.new(typing_params)\n\n respond_to do |format|\n if @typing.save\n format.html { redirect_to @typing, notice: 'Typing was successfully created.' }\n format.json { render :show, status: :created, location: @typing }\n else\n format.html { render :new }\n format.json { render json: @typing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tetramod = Tetramod.new(params[:tetramod])\n\n respond_to do |format|\n if @tetramod.save\n format.html { redirect_to @tetramod, notice: 'Tetramod was successfully created.' }\n format.json { render json: @tetramod, status: :created, location: @tetramod }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tetramod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_disk(name, size_mb, vm = nil, retries = @retries[\"default\"])\n new_disk = Xml::WrapperFactory.create_instance(\"DiskCreateParams\")\n new_disk.name = name\n new_disk.size_bytes = size_mb * 1024 * 1024 # VCD expects bytes\n new_disk.bus_type = Xml::HARDWARE_TYPE[:SCSI_CONTROLLER]\n new_disk.bus_sub_type = Xml::BUS_SUB_TYPE[:LSILOGIC]\n new_disk.add_locality(vm) if vm\n vdc = get_ovdc\n @logger.info(\"Creating independent disk #{name} of #{size_mb}MB.\")\n @logger.info(\"Disk locality ist set to #{vm.name} #{vm.urn}.\") if vm\n disk = @connection.post(vdc.add_disk_link, new_disk,\n Xml::MEDIA_TYPE[:DISK_CREATE_PARAMS])\n raise ApiRequestError unless disk.respond_to?(:running_tasks)\n # Creating a disk returns a disk with tasks inside\n retries.times do |try|\n return disk if disk.running_tasks.nil? || disk.running_tasks.empty?\n @logger.info(\"Disk #{disk.urn} has running tasks. Waiting for \" +\n \"tasks to finish. Try: #{try}/#{retries} .\" )\n disk.running_tasks.each do |t|\n monitor_task(t)\n end\n disk = @connection.get(disk)\n end\n end",
"def create\n @trip_waypoint = TripWaypoint.new\n @trip_waypoint.place_id = params[:place_id]\n @trip_waypoint.trip_id = params[:trip_id]\n @trip_waypoint.save\n\n respond_to do |format|\n if @trip_waypoint.save\n format.html { redirect_to edit_partner_trip_path(params[:trip_id]), notice: \"Le lieu a été ajouté à l'itinéraire\" }\n # format.json { render :show, status: :created, location: @trip_waypoint }\n else\n format.html { render :new }\n # format.json { render json: @trip_waypoint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_vbox_hdd(client_name,vbox_disk_name)\n message = \"Creating:\\tVM hard disk for \"+client_name\n command = \"VBoxManage createhd --filename \\\"#{vbox_disk_name}\\\" --size \\\"#{$default_vm_size}\\\"\"\n execute_command(message,command)\n return\nend",
"def trip_params\n params.require(:trip).permit(\n :license_plate,\n :device_id,\n :cargo,\n :start_location,\n :start_address, \n :end_location,\n :end_address,\n :start_timestamp,\n :end_timestamp,\n :weight,\n :costumer,\n :start_comments,\n :end_comments)\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create(params = {})\n submit(base_url, :post, params)\n end",
"def create\n @header.merge!({'Content-Type' => \"application/json\"})\n query = {name: \"Default\", region: \"sfo1\", size: \"512mb\", image: '5141286'}\n response = self.class.post('/droplets', {query: query, headers: @header})\n tratar_response(response)\n end",
"def create\n @trip = Trip.new(trip_params)\n\n\n if @trip.save\n flash[:success] = \"Trip Created for #{@trip.student.name}!\"\n redirect_to @trip\n else\n render 'new'\n end\n end",
"def create_vault(**args)\n request_post('/vault', **args)\n end",
"def create\n @protocol_drug = ProtocolDrug.new(protocol_drug_params)\n\n respond_to do |format|\n if @protocol_drug.save\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully created.' }\n format.json { render :show, status: :created, location: @protocol_drug }\n else\n format.html { render :new }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(api_params)\n keygen = SSHKey.generate\n api_params[:privatekey] = keygen.private_key\n api_params[:publickey] = keygen.ssh_public_key\n api_request(SSHKEYS, CREATE, api_params)\n end",
"def trip_params\n params.require(:trip).permit(:location, :latitude, :longitude, :start_date, :end_date, :days, :notes, :name, clips_attributes: [:uri, :day_list, :date_list, :type_list, :day, :date, :external_reference])\n end",
"def create\n @trips_connect = TripsConnect.new(params[:trips_connect])\n\n respond_to do |format|\n if @trips_connect.save\n format.html { redirect_to @trips_connect, notice: 'Trips connect was successfully created.' }\n format.json { render json: @trips_connect, status: :created, location: @trips_connect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trips_connect.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @tarefa = Tarefa.new(params[:tarefa])\n\n respond_to do |format|\n if @tarefa.save\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully created.' }\n format.json { render json: @tarefa, status: :created, location: @tarefa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n trip = Trip.new(trip_params)\n trip.rand_code = generate_code(6)\n\n # checks to see if photo was sent, and assigns default if none sent\n if params[:photo_base]\n trip.photo = params[:photo_base]\n else\n trip.photo = default_photo\n end\n\n trip.save!\n\n # creates a UserTrip object as a reference between Users and Trips\n tripid = Trip.last.id\n userid = params[:user_id]\n UserTrip.create(user_id: userid, trip_id: tripid)\n render json: trip\n end",
"def create\n @trip = current_user.trips.build(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.63021094",
"0.60428596",
"0.59717923",
"0.59068936",
"0.58905965",
"0.58591753",
"0.57933575",
"0.5792216",
"0.5778003",
"0.5736325",
"0.5676669",
"0.5657668",
"0.56458384",
"0.56000763",
"0.55858815",
"0.554533",
"0.5535135",
"0.55304056",
"0.5523044",
"0.5489486",
"0.5471866",
"0.5454921",
"0.54429334",
"0.5418859",
"0.53966653",
"0.5378806",
"0.53722787",
"0.5364418",
"0.5343616",
"0.53330153",
"0.5328767",
"0.5326682",
"0.52507263",
"0.5243236",
"0.5240381",
"0.5236682",
"0.5233304",
"0.5230307",
"0.5219118",
"0.52112937",
"0.517541",
"0.51720726",
"0.51698315",
"0.51595026",
"0.51498723",
"0.51488453",
"0.51472217",
"0.5121723",
"0.5120406",
"0.51056445",
"0.5100341",
"0.5093273",
"0.5090951",
"0.50893813",
"0.5089182",
"0.5085848",
"0.50821435",
"0.5078847",
"0.50756055",
"0.5072249",
"0.5065798",
"0.5065172",
"0.5058874",
"0.50427336",
"0.502665",
"0.5020897",
"0.49891835",
"0.49882567",
"0.49820793",
"0.49805793",
"0.4980535",
"0.49787614",
"0.49757174",
"0.4973256",
"0.4968484",
"0.49594098",
"0.49584064",
"0.4958052",
"0.4956679",
"0.49564984",
"0.49493352",
"0.4942685",
"0.493801",
"0.49378294",
"0.49308547",
"0.49299306",
"0.49281394",
"0.49269614",
"0.49205902",
"0.4918888",
"0.49146423",
"0.49096993",
"0.49033618",
"0.49025276",
"0.4900179",
"0.48932955",
"0.48894885",
"0.48857117",
"0.48851642",
"0.4883797"
] |
0.6305188
|
0
|
Creates a new tape drive. API Key Scope: tape_drives / create
|
def create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.create_tape_drive_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.create_tape_drive_by_tape_library"
end
# verify the required parameter 'tape_drive_body' is set
if @api_client.config.client_side_validation && tape_drive_body.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.create_tape_drive_by_tape_library"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body)
# return_type
return_type = opts[:return_type] || 'TapeDrive'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#create_tape_drive_by_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_tape_drive_by_tape_library(tape_library_id, tape_drive_body, opts = {})\n data, _status_code, _headers = create_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_body, opts)\n data\n end",
"def create\n @drive_type = DriveType.new(params[:drive_type])\n\n respond_to do |format|\n if @drive_type.save\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully created.') }\n format.xml { render :xml => @drive_type, :status => :created, :location => @drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @trip_driver = TripDriver.new(trip_driver_params)\n\n respond_to do |format|\n if @trip_driver.save\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully created.' }\n format.json { render json: @trip_driver, status: :created, location: @trip_driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @beattape = Beattape.new(params[:beattape])\n\n respond_to do |format|\n if @beattape.save\n format.html { redirect_to @beattape, notice: 'Beattape was successfully created.' }\n format.json { render json: @beattape, status: :created, location: @beattape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tape = Tape.new(params[:tape])\n\n respond_to do |format|\n if @tape.save\n flash[:notice] = 'Tape was successfully created.'\n format.html { redirect_to(@tape) }\n format.xml { render :xml => @tape, :status => :created, :location => @tape }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tape_type = TapeType.new(params[:tape_type])\n\n respond_to do |format|\n if @tape_type.save\n flash[:notice] = 'TapeType was successfully created.'\n format.html { redirect_to tape_types_path }\n format.xml { render :xml => @tape_type, :status => :created, :location => @tape_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tape = Tape.new(tape_params)\n\n respond_to do |format|\n if @tape.save\n format.html { redirect_to @tape, notice: 'Tape was successfully created.' }\n format.json { render :show, status: :created, location: @tape }\n else\n format.html { render :new }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def create\n @drives = Drives.new(params[:drives])\n\n respond_to do |format|\n if @drives.save\n flash[:notice] = 'Drives was successfully created.'\n format.html { redirect_to(@drives) }\n format.xml { render :xml => @drives, :status => :created, :location => @drives }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @drive_system = DriveSystem.new(params[:drive_system])\n @drive_system.truck_id = @drive_system.driver.truck_id\n respond_to do |format|\n if @drive_system.save\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully created.' }\n format.json { render json: @drive_system, status: :created, location: @drive_system }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_pipe_drive_deal\n\n path = GlobalConstant::Base.pipedrive['deals_end_point'] + \"?api_token=#{GlobalConstant::Base.pipedrive['api_token']}\"\n\n pipe_drive_request = PipeDrive::HttpHelper.new()\n\n r = pipe_drive_request.send_request_of_type('post', path, @request_params)\n return r unless r.success?\n\n success\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n # build a 'temporary' post which is written to DB later (create-method)\n @drive = Drive.new\n end",
"def create_trip trip, driver_name\n\t\tif @drivers.has_key? driver_name\t\t\t\n\t\t\t@drivers[driver_name].add_trip trip\n\t\telse\n\t\t\tputs \"No driver #{driver_name} registered, created a new driver\"\n\t\t\tdriver = self.create_driver driver_name\n\t\t\tdriver.add_trip trip\n\t\tend\t\n\tend",
"def create_station\n request = ['Enter station name: ']\n getting(request, :approve_station, :create_station!)\n end",
"def create\n @vdisk = Vdisk.new(params[:vdisk])\n\n respond_to do |format|\n if @vdisk.save\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully created.' }\n format.json { render json: @vdisk, status: :created, location: @vdisk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @machine_drive_type = MachineDriveType.new(params[:machine_drive_type])\n\n respond_to do |format|\n if @machine_drive_type.save\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully created.') }\n format.xml { render :xml => @machine_drive_type, :status => :created, :location => @machine_drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tap = Tap.new\n\n respond_to do |format|\n if @tap.save\n format.html { redirect_to taps_path, notice: 'Tap was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tap }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n save_file\n @tablet = Tablet.new(params[:tablet])\n\n respond_to do |format|\n if @tablet.save\n format.html { redirect_to @tablet, notice: 'Tablet was successfully created.' }\n format.json { render json: @tablet, status: :created, location: @tablet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @moto_drive_type = MotoDriveType.new(params[:moto_drive_type])\n\n respond_to do |format|\n if @moto_drive_type.save\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully created.') }\n format.xml { render :xml => @moto_drive_type, :status => :created, :location => @moto_drive_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @driver_trip_seat = DriverTripSeat.new(driver_trip_seat_params)\n\n respond_to do |format|\n if @driver_trip_seat.save\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully created.' }\n format.json { render :show, status: :created, location: @driver_trip_seat }\n else\n format.html { render :new }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @templete = Templete.new(params[:templete])\n\n respond_to do |format|\n if @templete.save\n format.html { redirect_to @templete, :notice => 'Templete was successfully created.' }\n format.json { render :json => @templete, :status => :created, :location => @templete }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @trip_type = TripType.new(trip_type_params)\n\n respond_to do |format|\n if @trip_type.save\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully created.' }\n format.json { render :show, status: :created, location: @trip_type }\n else\n format.html { render :new }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n HTTParty.post(create_url, :options => { :headers => HEADERS })\n end",
"def drive_params\n params.require(:drive).permit(:name)\n end",
"def create\n @drive = Drive.new(drive_params)\n # write drive to database\n if @drive.save\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n # Einträge in drive_suppliers für alle FU-Lieferanten mit neuem FU erstellen\n @drivesuppliers.each do |drivesupplier|\n driveSupplierEntry = DriveSupplier.new\n driveSupplierEntry.drive_id = @drive.id\n driveSupplierEntry.supplier_id = drivesupplier.id\n driveSupplierEntry.save!\n end\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich erstellt.'\n else\n render 'new'\n end\n end",
"def drive_params\n params.require(:drive).permit!\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n refuse_access and return if contest_started\n\n @mixtape = Mixtape.new(mixtape_params)\n\n if @mixtape.save\n flash[:info] = \"Mixtape created successfully\"\n session[:mixtape] = @mixtape.id\n redirect_to @mixtape\n else\n render 'new'\n end\n end",
"def create\n trip = Trip.create(trip_params)\n\n respond_with trip\n end",
"def create\n @peptide = Peptide.new(params[:peptide])\n\n respond_to do |format|\n if @peptide.save\n format.html { redirect_to @peptide, :notice => 'Peptide was successfully created.' }\n format.json { render :json => @peptide, :status => :created, :location => @peptide }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @peptide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @t = T.new(params[:t])\n\n respond_to do |format|\n if @t.save\n format.html { redirect_to @t, notice: 'T was successfully created.' }\n format.json { render json: @t, status: :created, location: @t }\n else\n format.html { render action: \"new\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @physical_disk = PhysicalDisk.new(params[:physical_disk])\n\n respond_to do |format|\n if @physical_disk.save\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully created.' }\n format.json { render json: @physical_disk, status: :created, location: @physical_disk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createvolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n req = {}\n req[\"name\"] = \"oe-#{@thevolume.name}\"\n req[\"description\"] = @thevolume.description\n req[\"sizeGb\"] = @thevolume.size\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks', :method => 'post', :options => '', :data => req.to_json, :access_token => @thezone.toekn )\n d = checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n data = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{req[\"name\"]}', :method => 'get', :options => '', :access_token => @thezone.token) if d\n data ? data[\"name\"] : false\n end",
"def tape_params\n params.require(:tape).permit(:tp_site, :tp_date, :tp_article, :tp_url, :tp_status, :tp_tag, :tp_comments)\n end",
"def create\n @tcard = Tcard.new(tcard_params)\n\n respond_to do |format|\n if @tcard.save\n format.html { redirect_to @tcard, notice: 'Tcard was successfully created.' }\n format.json { render :show, status: :created, location: @tcard }\n else\n format.html { render :new }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t\t\tcurrent_driver.create_car(car_params)\n\t\t\tend",
"def create\n @guide_trip = GuideTrip.new(guide_trip_params)\n\n respond_to do |format|\n if @guide_trip.save\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @guide_trip }\n else\n format.html { render :new }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ride_type = RideType.new(ride_type_params)\n\n respond_to do |format|\n if @ride_type.save\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully created.' }\n format.json { render :show, status: :created, location: @ride_type }\n else\n format.html { render :new }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gtfs_trip = GtfsTrip.new(params[:gtfs_trip])\n\n respond_to do |format|\n if @gtfs_trip.save\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully created.') }\n format.xml { render :xml => @gtfs_trip, :status => :created, :location => @gtfs_trip }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def trip_create_params\n defaults = {\n car_id: account.cars.first.try(:id)\n }\n\n defaults.merge(\n params.require(:trip).permit(:car_id, :destination_longitude, :destination_latitude)\n )\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trip = Trip.new({\"name\" => \"New Trip\",\n \"beginning\" => Time.now.strftime(\"%d/%m/%Y\"),\n \"duration\" => \"0\",\n \"user\" => current_user})\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render home_path }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @turkey = Turkey.new(turkey_params)\n\n respond_to do |format|\n if @turkey.save\n format.html { redirect_to @turkey, notice: 'Turkey was successfully created.' }\n format.json { render :show, status: :created, location: @turkey }\n else\n format.html { render :new }\n format.json { render json: @turkey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @brake_type = BrakeType.new(brake_type_params)\n\n respond_to do |format|\n if @brake_type.save\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully created.' }\n format.json { render :show, status: :created, location: @brake_type }\n else\n format.html { render :new }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ride = current_user.create_ride(ride_params)\n create_resource @ride\n end",
"def create(path)\n output { post(path, params) }\n end",
"def create\n @lun_disk = LunDisk.new(params[:lun_disk])\n\n respond_to do |format|\n if @lun_disk.save\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully created.' }\n format.json { render json: @lun_disk, status: :created, location: @lun_disk }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tccapi = Tccapi.new(tccapi_params)\n\n respond_to do |format|\n if @tccapi.save\n format.html { redirect_to @tccapi, notice: 'Tccapi was successfully created.' }\n format.json { render :show, status: :created, location: @tccapi }\n else\n format.html { render :new }\n format.json { render json: @tccapi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tune = Tune.new(params[:tune])\n\n respond_to do |format|\n if @tune.save\n format.html { redirect_to root_path notice: 'Tune was successfully created.' }\n format.json { render json: @tune, status: :created, location: @tune }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n err_objs=[]\n error=false\n user_id=MobileDevice.where(:access_token=>params[:access_token]).first.user_id\n if params.has_key?('trips')\n params[:trips].each do |trip|\n trip_id=trip[1][:trip_id] #save ref to trip id in case @trip.save fails (used in return response)\n if !create_trip(trip[1],user_id)\n error=true\n err_objs.push(trip_id)\n end\n end\n else\n error=true\n end\n respond_to do |format|\n if !error\n format.json { render json: {:msg => \"success\"}, status: :created }\n else\n format.json { render json: {:msg => \"Could not save the following trips. Please check that all required fields are filled out (license_plate, cargo, start_location, end_location, start_timestamp, end_timestamp)\", :err_ids => err_objs}, status: :unprocessable_entity }\n end\n end\n end",
"def create_train(title = '[CREATE] Please choose Train type:')\n train_type = ask_choose_train_type(title)\n\n user_input_number = ask_enter('Train number')\n\n train = train_type.new(user_input_number)\n @trains << train\n puts \"\\n[SUCCESS] #{train} created!\"\n rescue StandardError => e\n show_error_message(e)\n retry\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to trips_path, notice: 'Cesta byla vytvořena.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tarot = Tarot.new(tarot_params)\n\n respond_to do |format|\n if @tarot.save\n format.html { redirect_to @tarot, notice: 'Tarot was successfully created.' }\n format.json { render :show, status: :created, location: @tarot }\n else\n format.html { render :new }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @douga = Douga.new(douga_params)\n\n \n session = GoogleDrive::Session.from_config(\"client_secret.json\")\n\n\n file = session.upload_from_file(\"#{douga_params[:douga].tempfile.to_path}\",\"#{douga_params[:douga].tempfile.to_path}\", convert: false)\n # respond_to do |format|\n\n folder = session.collection_by_title(\"Movies\")\n folder.add(file)\n\n redirect_to root_path\n #\n # respond_to do |format|\n # if @douga.save\n # format.html { redirect_to @douga, notice: 'Douga was successfully created.' }\n # format.json { render :show, status: :created, location: @douga }\n # else\n # format.html { render :new }\n # format.json { render json: @douga.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @trip = Trip.new(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, :notice => 'Trip was successfully created.' }\n format.json { render :json => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_kit(params)\n Kit.create(params)\n end",
"def create\n @tablet = Tablet.new(tablet_params)\n\n respond_to do |format|\n if @tablet.save\n format.html { redirect_to @tablet, notice: 'Tablet was successfully created.' }\n format.json { render :show, status: :created, location: @tablet }\n else\n format.html { render :new }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_disk(disk_id, location, size, storage_account_type)\n @logger.info(\"create_disk(#{disk_id}, #{location}, #{size}, #{storage_account_type})\")\n resource_group_name = disk_id.resource_group_name()\n disk_name = disk_id.disk_name()\n caching = disk_id.caching()\n tags = AZURE_TAGS.merge({\n \"caching\" => caching\n })\n disk_params = {\n :name => disk_name,\n :location => location,\n :tags => tags,\n :disk_size => size,\n :account_type => storage_account_type\n }\n @logger.info(\"Start to create an empty managed disk `#{disk_name}' in resource group `#{resource_group_name}'\")\n @azure_client2.create_empty_managed_disk(resource_group_name, disk_params)\n end",
"def create\n trip = current_user.trips.new(trip_params)\n if trip.save\n render json: {\n status: :created,\n trip: trip\n }\n else\n render json: {\n status: 500,\n errors: trip.errors.full_messages\n }\n end\n end",
"def create\n response = Codeclimate::Api.client.post(@path)\n response.code == \"200\"\n end",
"def create\n @mag_tape = MagTape.new(params[:mag_tape])\n\n respond_to do |format|\n if @mag_tape.save\n format.html { redirect_to @mag_tape, notice: 'Mag Tape was successfully created.' }\n format.json { render json: @mag_tape, status: :created, location: @mag_tape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_test_disk(connection, zone)\n zone = 'us-central1-a'\n random_string = SecureRandom.hex\n\n disk = connection.disks.create({\n :name => \"fog-test-disk-#{random_string}\",\n :size_gb => \"10\",\n :zone => zone,\n :source_image => \"debian-7-wheezy-v20140408\",\n })\n disk.wait_for { ready? }\n disk\nend",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def create\n @fundamental_treasure = Fundamental::Treasure.new(params[:fundamental_treasure])\n\n respond_to do |format|\n if @fundamental_treasure.save\n format.html { redirect_to @fundamental_treasure, notice: 'Treasure was successfully created.' }\n format.json { render json: @fundamental_treasure, status: :created, location: @fundamental_treasure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fundamental_treasure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trip_params\n params.require(:trip).permit(:name, :description, :user_id, :start_date, :airport_id, :base64, attendee_ids:[], leg_ids:[])\n end",
"def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to current_user, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { redirect_to current_user, notice: \"Trip can't be created\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @device_type = DeviceType.new(device_type_params)\n\n respond_to do |format|\n if @device_type.save\n format.html { redirect_to browse_url(protocol: redirect_protocol), notice: 'Device type was successfully created.' }\n format.json { render :show, status: :created, location: @device_type }\n else\n format.html { render :new }\n format.json { render json: @device_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n make_create_request\n end",
"def create\n @trip = Trip.new(trip_params)\n @trip.user_id = current_user.id\n\n authorize @trip, :create?\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create body = {}\n @connection.request(method: :post, path: \"/volumes/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"def create\n @dtpic = Dtpic.new(params[:dtpic])\n\n respond_to do |format|\n if @dtpic.save\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully created.' }\n format.json { render json: @dtpic, status: :created, location: @dtpic }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def trip_params\n params.require(:trip).permit(:code, :name, :price, :temperature, :depart_at, :return_at, :url)\n end",
"def create\n @controltltkt = Controltltkt.new(controltltkt_params)\n\n respond_to do |format|\n if @controltltkt.save\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controltltkt }\n else\n format.html { render :new }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trip = current_user.trips.build(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render json: @trip, status: :created, location: @trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ty = Tie.new(ty_params)\n\n respond_to do |format|\n if @ty.save\n format.html { redirect_to @ty, notice: 'Tie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ty }\n else\n format.html { render action: 'new' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @typing = Typing.new(typing_params)\n\n respond_to do |format|\n if @typing.save\n format.html { redirect_to @typing, notice: 'Typing was successfully created.' }\n format.json { render :show, status: :created, location: @typing }\n else\n format.html { render :new }\n format.json { render json: @typing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tetramod = Tetramod.new(params[:tetramod])\n\n respond_to do |format|\n if @tetramod.save\n format.html { redirect_to @tetramod, notice: 'Tetramod was successfully created.' }\n format.json { render json: @tetramod, status: :created, location: @tetramod }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tetramod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_disk(name, size_mb, vm = nil, retries = @retries[\"default\"])\n new_disk = Xml::WrapperFactory.create_instance(\"DiskCreateParams\")\n new_disk.name = name\n new_disk.size_bytes = size_mb * 1024 * 1024 # VCD expects bytes\n new_disk.bus_type = Xml::HARDWARE_TYPE[:SCSI_CONTROLLER]\n new_disk.bus_sub_type = Xml::BUS_SUB_TYPE[:LSILOGIC]\n new_disk.add_locality(vm) if vm\n vdc = get_ovdc\n @logger.info(\"Creating independent disk #{name} of #{size_mb}MB.\")\n @logger.info(\"Disk locality ist set to #{vm.name} #{vm.urn}.\") if vm\n disk = @connection.post(vdc.add_disk_link, new_disk,\n Xml::MEDIA_TYPE[:DISK_CREATE_PARAMS])\n raise ApiRequestError unless disk.respond_to?(:running_tasks)\n # Creating a disk returns a disk with tasks inside\n retries.times do |try|\n return disk if disk.running_tasks.nil? || disk.running_tasks.empty?\n @logger.info(\"Disk #{disk.urn} has running tasks. Waiting for \" +\n \"tasks to finish. Try: #{try}/#{retries} .\" )\n disk.running_tasks.each do |t|\n monitor_task(t)\n end\n disk = @connection.get(disk)\n end\n end",
"def create\n @trip_waypoint = TripWaypoint.new\n @trip_waypoint.place_id = params[:place_id]\n @trip_waypoint.trip_id = params[:trip_id]\n @trip_waypoint.save\n\n respond_to do |format|\n if @trip_waypoint.save\n format.html { redirect_to edit_partner_trip_path(params[:trip_id]), notice: \"Le lieu a été ajouté à l'itinéraire\" }\n # format.json { render :show, status: :created, location: @trip_waypoint }\n else\n format.html { render :new }\n # format.json { render json: @trip_waypoint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_vbox_hdd(client_name,vbox_disk_name)\n message = \"Creating:\\tVM hard disk for \"+client_name\n command = \"VBoxManage createhd --filename \\\"#{vbox_disk_name}\\\" --size \\\"#{$default_vm_size}\\\"\"\n execute_command(message,command)\n return\nend",
"def trip_params\n params.require(:trip).permit(\n :license_plate,\n :device_id,\n :cargo,\n :start_location,\n :start_address, \n :end_location,\n :end_address,\n :start_timestamp,\n :end_timestamp,\n :weight,\n :costumer,\n :start_comments,\n :end_comments)\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create(params = {})\n submit(base_url, :post, params)\n end",
"def create\n @header.merge!({'Content-Type' => \"application/json\"})\n query = {name: \"Default\", region: \"sfo1\", size: \"512mb\", image: '5141286'}\n response = self.class.post('/droplets', {query: query, headers: @header})\n tratar_response(response)\n end",
"def create\n @trip = Trip.new(trip_params)\n\n\n if @trip.save\n flash[:success] = \"Trip Created for #{@trip.student.name}!\"\n redirect_to @trip\n else\n render 'new'\n end\n end",
"def create_vault(**args)\n request_post('/vault', **args)\n end",
"def create\n @protocol_drug = ProtocolDrug.new(protocol_drug_params)\n\n respond_to do |format|\n if @protocol_drug.save\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully created.' }\n format.json { render :show, status: :created, location: @protocol_drug }\n else\n format.html { render :new }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(api_params)\n keygen = SSHKey.generate\n api_params[:privatekey] = keygen.private_key\n api_params[:publickey] = keygen.ssh_public_key\n api_request(SSHKEYS, CREATE, api_params)\n end",
"def trip_params\n params.require(:trip).permit(:location, :latitude, :longitude, :start_date, :end_date, :days, :notes, :name, clips_attributes: [:uri, :day_list, :date_list, :type_list, :day, :date, :external_reference])\n end",
"def create\n @trips_connect = TripsConnect.new(params[:trips_connect])\n\n respond_to do |format|\n if @trips_connect.save\n format.html { redirect_to @trips_connect, notice: 'Trips connect was successfully created.' }\n format.json { render json: @trips_connect, status: :created, location: @trips_connect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trips_connect.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @tarefa = Tarefa.new(params[:tarefa])\n\n respond_to do |format|\n if @tarefa.save\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully created.' }\n format.json { render json: @tarefa, status: :created, location: @tarefa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n trip = Trip.new(trip_params)\n trip.rand_code = generate_code(6)\n\n # checks to see if photo was sent, and assigns default if none sent\n if params[:photo_base]\n trip.photo = params[:photo_base]\n else\n trip.photo = default_photo\n end\n\n trip.save!\n\n # creates a UserTrip object as a reference between Users and Trips\n tripid = Trip.last.id\n userid = params[:user_id]\n UserTrip.create(user_id: userid, trip_id: tripid)\n render json: trip\n end",
"def create\n @trip = current_user.trips.build(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6305188",
"0.60428596",
"0.59717923",
"0.59068936",
"0.58905965",
"0.58591753",
"0.57933575",
"0.5792216",
"0.5778003",
"0.5736325",
"0.5676669",
"0.5657668",
"0.56458384",
"0.56000763",
"0.55858815",
"0.554533",
"0.5535135",
"0.55304056",
"0.5523044",
"0.5489486",
"0.5471866",
"0.5454921",
"0.54429334",
"0.5418859",
"0.53966653",
"0.5378806",
"0.53722787",
"0.5364418",
"0.5343616",
"0.53330153",
"0.5328767",
"0.5326682",
"0.52507263",
"0.5243236",
"0.5240381",
"0.5236682",
"0.5233304",
"0.5230307",
"0.5219118",
"0.52112937",
"0.517541",
"0.51720726",
"0.51698315",
"0.51595026",
"0.51498723",
"0.51488453",
"0.51472217",
"0.5121723",
"0.5120406",
"0.51056445",
"0.5100341",
"0.5093273",
"0.5090951",
"0.50893813",
"0.5089182",
"0.5085848",
"0.50821435",
"0.5078847",
"0.50756055",
"0.5072249",
"0.5065798",
"0.5065172",
"0.5058874",
"0.50427336",
"0.502665",
"0.5020897",
"0.49891835",
"0.49882567",
"0.49820793",
"0.49805793",
"0.4980535",
"0.49787614",
"0.49757174",
"0.4973256",
"0.4968484",
"0.49594098",
"0.49584064",
"0.4958052",
"0.4956679",
"0.49564984",
"0.49493352",
"0.4942685",
"0.493801",
"0.49378294",
"0.49308547",
"0.49299306",
"0.49281394",
"0.49269614",
"0.49205902",
"0.4918888",
"0.49146423",
"0.49096993",
"0.49033618",
"0.49025276",
"0.4900179",
"0.48932955",
"0.48894885",
"0.48857117",
"0.48851642",
"0.4883797"
] |
0.63021094
|
1
|
Destroys a specific tape drive. API Key Scope: tape_drives / destroy
|
def destroy_tape_drive(tape_drive_id, opts = {})
destroy_tape_drive_with_http_info(tape_drive_id, opts)
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @drive_system = DriveSystem.find(params[:id])\n @drive_system.destroy\n\n respond_to do |format|\n format.html { redirect_to drive_systems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = Drive.find(params[:id])\n @drive.destroy\n redirect_to drives_path, :notice => 'Frequenzumrichter wurde gelöscht.'\n end",
"def destroy\n @drive_type = DriveType.find(params[:id])\n @drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_with ApidDrive.find(params[:id])\n end",
"def destroy\n @machine_drive_type = MachineDriveType.find(params[:id])\n @machine_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @moto_drive_type = MotoDriveType.find(params[:id])\n @moto_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tape_type = TapeType.find(params[:id])\n @tape_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(tape_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip_driver = TripDriver.find(params[:id])\n @trip_driver.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_drivers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vdisk = Vdisk.find(params[:id])\n @vdisk.destroy\n\n respond_to do |format|\n format.html { redirect_to vdisks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tape.destroy\n respond_to do |format|\n format.html { redirect_to tapes_url, notice: 'Tape was successfully destroyed.' }\n format.json { head :no_content }\n end #do\n end",
"def destroy_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n nil\n end",
"def destroy\n @tape = Tape.find(params[:id])\n @tape.destroy\n\n respond_to do |format|\n format.html { redirect_to(tapes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.destroy_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.destroy_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#destroy_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @physical_disk = PhysicalDisk.find(params[:id])\n @physical_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @etape = Etape.find(params[:id])\n @etape.destroy\n\n respond_to do |format|\n format.html { redirect_to etapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lun_disk = LunDisk.find(params[:id])\n @lun_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to lun_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_tape = SavedTape.find(params[:id])\n @saved_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'mytapes' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tccapi.destroy\n respond_to do |format|\n format.html { redirect_to tccapis_url, notice: 'Tccapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune.destroy\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy; delete end",
"def destroy\n @tablet.destroy\n respond_to do |format|\n format.html { redirect_to tablets_url, notice: 'Tablet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sector = Sector.find(params[:id])\n @sector.destroy\n redirect_to(sectors_url)\n end",
"def destroy\n @tcard.destroy\n respond_to do |format|\n format.html { redirect_to tcards_url, notice: 'Tcard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = @object\n begin\n @drive.destroy\n rescue Exception => destroy_error\n respond_to do |format|\n flash[:error] = destroy_error.message\n format.html { redirect_to drive_url(@drive) and return}\n format.xml { head :error } # FIXME?\n end\n end\n \n # Success!\n respond_to do |format|\n format.html { redirect_to drives_url }\n format.js {\n render(:update) { |page|\n if request.env[\"HTTP_REFERER\"].include? \"nodes\"\n page.replace_html 'drive_served', {:partial => 'nodes/drive_served', :locals => { :node => @drive.drive_server } }\n page.hide 'create_drive_served'\n page.show 'add_drive_served_link'\n end\n }\n }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune = Tune.find(params[:id])\n @tune.destroy\n\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy!\r\n self.class.service_instance.delete_blob(path)\r\n end",
"def delete_from_disk; end",
"def destroy\n @mag_tape = MagTape.find(params[:id])\n @mag_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to mag_tapes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @driver_trip_seat.destroy\n respond_to do |format|\n format.html { redirect_to driver_trip_seats_url, notice: 'Driver trip seat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy!\n Dropio::Resource.client.delete_drop(self)\n end",
"def destroy\n @terminal_device.destroy\n respond_to do |format|\n format.html { redirect_to terminal_devices_url, notice: 'Terminal device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_tape(tape_id, opts = {})\n destroy_tape_with_http_info(tape_id, opts)\n nil\n end",
"def destroy\n @ride_driver.destroy\n respond_to do |format|\n format.html { redirect_to @root }\n format.json { head :no_content }\n end\n end",
"def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end",
"def destroy\n @trip_type.destroy\n respond_to do |format|\n format.html { redirect_to trip_types_url, notice: 'Trip type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @templete = Templete.find(params[:id])\n @templete.destroy\n\n respond_to do |format|\n format.html { redirect_to templetes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard = Timecard.find(params[:id])\n @timecard.destroy\n\n redirect_to(timecards_url)\n end",
"def destroy\n @tuning.destroy\n respond_to do |format|\n format.html { redirect_to tunings_url, notice: 'Tuning was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n @magnetic_finger_print.destroy\n\n respond_to do |format|\n format.html { redirect_to magnetic_finger_prints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_admin_user\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n render status: :ok\n end",
"def destroy\n authenticate_request!\n\n @car = Car.find(params[:id])\n @car.destroy\n\n head :no_content\n end",
"def destroy(provision, tf)\n Terraform.p_load\n\n terraform = Terraform.singleton(@provider, tf)\n terraform.destroy_network(provision, @one.id)\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @ethernet.destroy\n respond_to do |format|\n format.html { redirect_to ethernets_url, notice: 'Ethernet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trip.destroy\n\n head :no_content\n end",
"def destroy\n @apt = Apt.find(params[:id])\n @apt.destroy\n\n respond_to do |format|\n format.html { redirect_to apts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ride_type.destroy\n respond_to do |format|\n format.html { redirect_to ride_types_url, notice: 'Ride type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @typerelsequence.destroy\n respond_to do |format|\n format.html { redirect_to typerelsequences_url, notice: 'Typerelsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brake_type.destroy\n respond_to do |format|\n format.html { redirect_to brake_types_url, notice: 'Brake type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltnytt.destroy\n respond_to do |format|\n format.html { redirect_to controltnytts_url, notice: 'Controltnytt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n patient = TrashedPatient.get!(params[:id])\n patient.remove_from_trash\n\n head :ok\n end",
"def destory\n @trip = Trips.delete_trip( params[ :id ] )\n flash[:notice] = \"Trip Deleted successfuly\"\n redirect_to(:action => 'list')\n end",
"def destroy\n @typeairplane.destroy\n respond_to do |format|\n format.html { redirect_to typeairplanes_url, notice: 'Typeairplane was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pitch.destroy\n api_success\n end",
"def destroy\n puts(\"Tacos are indestructible\")\n end",
"def destroy\n @tarot.destroy\n respond_to do |format|\n format.html { redirect_to tarots_url, notice: 'Tarot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end",
"def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_vi_place.destroy\n end",
"def destroy(path)\n output { delete(path) }\n end",
"def destroy\n @departuretype.destroy\n respond_to do |format|\n format.html { redirect_to departuretypes_url, notice: 'Departuretype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n file&.delete\n end",
"def destroy\n mountain = Mountain.find params[:id]\n mountain.destroy\n redirect_to (mountains_path)\n end",
"def destroy\n travel = Travel.find(params[:id])\n travel.destroy\n head 204\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @sub_gtp.destroy\n respond_to do |format|\n format.html { redirect_to sub_gtps_url, notice: 'Sub gtp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @trip = Trip.find(params[:id])\n\n stat(@trip, \"del\")\n\n ing = @trip.ing\n if ing\n trip_user_delete(@trip.driver)\n @trip.car.update_attribute(:current_trip, 0)\n @trip.workers.each do |worker|\n trip_user_delete(worker)\n end\n end\n\n @trip.workers.clear\n\n @trip.destroy\n\n respond_to do |format|\n format.html do\n flash[:success] = \"该出车记录已删除!\"\n sign_in(current_user)\n if ing\n redirect_to '/drivers/start'\n else\n redirect_to '/drivers/trips'\n end\n end\n format.json\n end\n end",
"def destroy\n @tank.destroy\n respond_to do |format|\n\n destroy_entry(tanks_url, format)\n end\n end",
"def destroy\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n @vehicle_passcard.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_passcard_personal_detail_path(@vehicle_passcard.personal_detail_id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end",
"def destroy\n\t\t\t\trespond_with Driver.destroy(params[:id])\n end",
"def destroy\n @car = Car.find(params[:id])\n if @car.is_used\n redirect_to trips_path, notice: 'Das Auto wird fuer eine Fahrt genutzt und kann deshalb nicht entfernt werden.'\n else\n @car.destroy\n redirect_to cars_url\n end\n end",
"def destroy\n destroy_resource @ride, rides_url\n end",
"def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @departure_type.destroy\n respond_to do |format|\n format.html { redirect_to departure_types_url, notice: 'Departure type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n head :no_content\n end",
"def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trailer.destroy\n respond_to do |format|\n format.html { redirect_to trailers_url, notice: 'Trailer was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @airport = Airport.find(params[:id])\n @airport.destroy\n\n respond_to do |format|\n format.html { redirect_to airports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tier = Tier.find(params[:id])\n @tier.destroy\n\n respond_to do |format|\n format.html { redirect_to tiers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n end",
"def destroy\n \n end"
] |
[
"0.699584",
"0.66342956",
"0.6464306",
"0.64514256",
"0.6419904",
"0.6408456",
"0.6356012",
"0.63434166",
"0.6201278",
"0.61230373",
"0.6118356",
"0.6091912",
"0.60825187",
"0.607373",
"0.60035104",
"0.5969916",
"0.59588116",
"0.5938809",
"0.5907166",
"0.5881415",
"0.58696675",
"0.58534557",
"0.58316165",
"0.5825509",
"0.5801182",
"0.5777233",
"0.5769817",
"0.5768561",
"0.5765565",
"0.57629436",
"0.575095",
"0.5722471",
"0.57190377",
"0.57117474",
"0.5705472",
"0.57004786",
"0.56972885",
"0.56970865",
"0.5695932",
"0.5692208",
"0.56631345",
"0.5650865",
"0.5637468",
"0.5623944",
"0.5620157",
"0.5619113",
"0.5618496",
"0.5614015",
"0.5613779",
"0.56086195",
"0.5607494",
"0.56073844",
"0.56073225",
"0.56023526",
"0.5600764",
"0.55991524",
"0.55977625",
"0.55939895",
"0.55920833",
"0.5589035",
"0.55870694",
"0.5580753",
"0.55784225",
"0.55710655",
"0.5569742",
"0.5565592",
"0.5565207",
"0.5563708",
"0.556256",
"0.5561432",
"0.5551143",
"0.55441135",
"0.55441135",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5538685",
"0.55384964",
"0.55384964",
"0.5531624",
"0.5530648",
"0.5527385",
"0.5526455",
"0.5525772",
"0.55224323",
"0.55216974",
"0.5520324",
"0.55195177",
"0.5516605",
"0.55148685",
"0.5507782",
"0.5502757",
"0.5496829",
"0.54965174",
"0.54965174"
] |
0.6393509
|
6
|
Destroys a specific tape drive. API Key Scope: tape_drives / destroy
|
def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive"
end
# resource path
local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type]
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#destroy_tape_drive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @drive_system = DriveSystem.find(params[:id])\n @drive_system.destroy\n\n respond_to do |format|\n format.html { redirect_to drive_systems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = Drive.find(params[:id])\n @drive.destroy\n redirect_to drives_path, :notice => 'Frequenzumrichter wurde gelöscht.'\n end",
"def destroy\n @drive_type = DriveType.find(params[:id])\n @drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_with ApidDrive.find(params[:id])\n end",
"def destroy_tape_drive(tape_drive_id, opts = {})\n destroy_tape_drive_with_http_info(tape_drive_id, opts)\n nil\n end",
"def destroy\n @machine_drive_type = MachineDriveType.find(params[:id])\n @machine_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @moto_drive_type = MotoDriveType.find(params[:id])\n @moto_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tape_type = TapeType.find(params[:id])\n @tape_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(tape_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip_driver = TripDriver.find(params[:id])\n @trip_driver.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_drivers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vdisk = Vdisk.find(params[:id])\n @vdisk.destroy\n\n respond_to do |format|\n format.html { redirect_to vdisks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tape.destroy\n respond_to do |format|\n format.html { redirect_to tapes_url, notice: 'Tape was successfully destroyed.' }\n format.json { head :no_content }\n end #do\n end",
"def destroy_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n nil\n end",
"def destroy\n @tape = Tape.find(params[:id])\n @tape.destroy\n\n respond_to do |format|\n format.html { redirect_to(tapes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.destroy_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.destroy_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#destroy_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @physical_disk = PhysicalDisk.find(params[:id])\n @physical_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @etape = Etape.find(params[:id])\n @etape.destroy\n\n respond_to do |format|\n format.html { redirect_to etapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lun_disk = LunDisk.find(params[:id])\n @lun_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to lun_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_tape = SavedTape.find(params[:id])\n @saved_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'mytapes' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tccapi.destroy\n respond_to do |format|\n format.html { redirect_to tccapis_url, notice: 'Tccapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune.destroy\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy; delete end",
"def destroy\n @tablet.destroy\n respond_to do |format|\n format.html { redirect_to tablets_url, notice: 'Tablet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sector = Sector.find(params[:id])\n @sector.destroy\n redirect_to(sectors_url)\n end",
"def destroy\n @tcard.destroy\n respond_to do |format|\n format.html { redirect_to tcards_url, notice: 'Tcard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = @object\n begin\n @drive.destroy\n rescue Exception => destroy_error\n respond_to do |format|\n flash[:error] = destroy_error.message\n format.html { redirect_to drive_url(@drive) and return}\n format.xml { head :error } # FIXME?\n end\n end\n \n # Success!\n respond_to do |format|\n format.html { redirect_to drives_url }\n format.js {\n render(:update) { |page|\n if request.env[\"HTTP_REFERER\"].include? \"nodes\"\n page.replace_html 'drive_served', {:partial => 'nodes/drive_served', :locals => { :node => @drive.drive_server } }\n page.hide 'create_drive_served'\n page.show 'add_drive_served_link'\n end\n }\n }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune = Tune.find(params[:id])\n @tune.destroy\n\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy!\r\n self.class.service_instance.delete_blob(path)\r\n end",
"def delete_from_disk; end",
"def destroy\n @mag_tape = MagTape.find(params[:id])\n @mag_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to mag_tapes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @driver_trip_seat.destroy\n respond_to do |format|\n format.html { redirect_to driver_trip_seats_url, notice: 'Driver trip seat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy!\n Dropio::Resource.client.delete_drop(self)\n end",
"def destroy\n @terminal_device.destroy\n respond_to do |format|\n format.html { redirect_to terminal_devices_url, notice: 'Terminal device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_tape(tape_id, opts = {})\n destroy_tape_with_http_info(tape_id, opts)\n nil\n end",
"def destroy\n @ride_driver.destroy\n respond_to do |format|\n format.html { redirect_to @root }\n format.json { head :no_content }\n end\n end",
"def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end",
"def destroy\n @trip_type.destroy\n respond_to do |format|\n format.html { redirect_to trip_types_url, notice: 'Trip type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @templete = Templete.find(params[:id])\n @templete.destroy\n\n respond_to do |format|\n format.html { redirect_to templetes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard = Timecard.find(params[:id])\n @timecard.destroy\n\n redirect_to(timecards_url)\n end",
"def destroy\n @tuning.destroy\n respond_to do |format|\n format.html { redirect_to tunings_url, notice: 'Tuning was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n @magnetic_finger_print.destroy\n\n respond_to do |format|\n format.html { redirect_to magnetic_finger_prints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authenticate_request!\n\n @car = Car.find(params[:id])\n @car.destroy\n\n head :no_content\n end",
"def destroy\n current_admin_user\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n render status: :ok\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy(provision, tf)\n Terraform.p_load\n\n terraform = Terraform.singleton(@provider, tf)\n terraform.destroy_network(provision, @one.id)\n end",
"def destroy\n @ethernet.destroy\n respond_to do |format|\n format.html { redirect_to ethernets_url, notice: 'Ethernet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apt = Apt.find(params[:id])\n @apt.destroy\n\n respond_to do |format|\n format.html { redirect_to apts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ride_type.destroy\n respond_to do |format|\n format.html { redirect_to ride_types_url, notice: 'Ride type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trip.destroy\n\n head :no_content\n end",
"def destroy\n @typerelsequence.destroy\n respond_to do |format|\n format.html { redirect_to typerelsequences_url, notice: 'Typerelsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brake_type.destroy\n respond_to do |format|\n format.html { redirect_to brake_types_url, notice: 'Brake type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltnytt.destroy\n respond_to do |format|\n format.html { redirect_to controltnytts_url, notice: 'Controltnytt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n patient = TrashedPatient.get!(params[:id])\n patient.remove_from_trash\n\n head :ok\n end",
"def destory\n @trip = Trips.delete_trip( params[ :id ] )\n flash[:notice] = \"Trip Deleted successfuly\"\n redirect_to(:action => 'list')\n end",
"def destroy\n @typeairplane.destroy\n respond_to do |format|\n format.html { redirect_to typeairplanes_url, notice: 'Typeairplane was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pitch.destroy\n api_success\n end",
"def destroy\n puts(\"Tacos are indestructible\")\n end",
"def destroy\n @tarot.destroy\n respond_to do |format|\n format.html { redirect_to tarots_url, notice: 'Tarot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end",
"def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_vi_place.destroy\n end",
"def destroy(path)\n output { delete(path) }\n end",
"def destroy\n @departuretype.destroy\n respond_to do |format|\n format.html { redirect_to departuretypes_url, notice: 'Departuretype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n file&.delete\n end",
"def destroy\n mountain = Mountain.find params[:id]\n mountain.destroy\n redirect_to (mountains_path)\n end",
"def destroy\n travel = Travel.find(params[:id])\n travel.destroy\n head 204\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @sub_gtp.destroy\n respond_to do |format|\n format.html { redirect_to sub_gtps_url, notice: 'Sub gtp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @trip = Trip.find(params[:id])\n\n stat(@trip, \"del\")\n\n ing = @trip.ing\n if ing\n trip_user_delete(@trip.driver)\n @trip.car.update_attribute(:current_trip, 0)\n @trip.workers.each do |worker|\n trip_user_delete(worker)\n end\n end\n\n @trip.workers.clear\n\n @trip.destroy\n\n respond_to do |format|\n format.html do\n flash[:success] = \"该出车记录已删除!\"\n sign_in(current_user)\n if ing\n redirect_to '/drivers/start'\n else\n redirect_to '/drivers/trips'\n end\n end\n format.json\n end\n end",
"def destroy\n @tank.destroy\n respond_to do |format|\n\n destroy_entry(tanks_url, format)\n end\n end",
"def destroy\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n @vehicle_passcard.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_passcard_personal_detail_path(@vehicle_passcard.personal_detail_id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t\t\trespond_with Driver.destroy(params[:id])\n end",
"def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end",
"def destroy\n destroy_resource @ride, rides_url\n end",
"def destroy\n @car = Car.find(params[:id])\n if @car.is_used\n redirect_to trips_path, notice: 'Das Auto wird fuer eine Fahrt genutzt und kann deshalb nicht entfernt werden.'\n else\n @car.destroy\n redirect_to cars_url\n end\n end",
"def destroy\n @departure_type.destroy\n respond_to do |format|\n format.html { redirect_to departure_types_url, notice: 'Departure type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n head :no_content\n end",
"def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trailer.destroy\n respond_to do |format|\n format.html { redirect_to trailers_url, notice: 'Trailer was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @airport = Airport.find(params[:id])\n @airport.destroy\n\n respond_to do |format|\n format.html { redirect_to airports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n end",
"def destroy\n \n end",
"def destroy\n @tier = Tier.find(params[:id])\n @tier.destroy\n\n respond_to do |format|\n format.html { redirect_to tiers_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.66342604",
"0.6464231",
"0.64509064",
"0.6419975",
"0.6409487",
"0.63956195",
"0.635544",
"0.6342606",
"0.6198466",
"0.6121878",
"0.6118441",
"0.6088167",
"0.6083707",
"0.60709596",
"0.6001977",
"0.59700847",
"0.5956643",
"0.5937572",
"0.59049886",
"0.5880119",
"0.58669114",
"0.58521247",
"0.58283544",
"0.58257943",
"0.5798555",
"0.577671",
"0.5767433",
"0.57668495",
"0.57635313",
"0.57599753",
"0.5751476",
"0.5722524",
"0.57156754",
"0.57109493",
"0.5706194",
"0.569863",
"0.5697695",
"0.56966615",
"0.5695791",
"0.5689186",
"0.5660652",
"0.56505895",
"0.56351095",
"0.56227636",
"0.5619176",
"0.56185573",
"0.5618285",
"0.5613671",
"0.56132853",
"0.56076336",
"0.56069213",
"0.56057304",
"0.56054795",
"0.5600052",
"0.559817",
"0.559687",
"0.5596107",
"0.55940604",
"0.55893636",
"0.55877405",
"0.55848444",
"0.5577275",
"0.5575888",
"0.5569698",
"0.5567927",
"0.5566136",
"0.5565633",
"0.5562216",
"0.5562045",
"0.55603015",
"0.555063",
"0.5542839",
"0.5542839",
"0.5541943",
"0.5541943",
"0.5541943",
"0.5541943",
"0.5541943",
"0.5541943",
"0.5541943",
"0.5541943",
"0.55367017",
"0.55363864",
"0.55363864",
"0.55309504",
"0.5528151",
"0.55270344",
"0.55258477",
"0.55257744",
"0.55222815",
"0.552196",
"0.5517915",
"0.5517372",
"0.55167735",
"0.5513211",
"0.55048835",
"0.55021936",
"0.54956317",
"0.54956317",
"0.54937536"
] |
0.6995221
|
0
|
Destroys a specific tape drive. API Key Scope: tape_drives / destroy
|
def destroy_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})
destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @drive_system = DriveSystem.find(params[:id])\n @drive_system.destroy\n\n respond_to do |format|\n format.html { redirect_to drive_systems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = Drive.find(params[:id])\n @drive.destroy\n redirect_to drives_path, :notice => 'Frequenzumrichter wurde gelöscht.'\n end",
"def destroy\n @drive_type = DriveType.find(params[:id])\n @drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_with ApidDrive.find(params[:id])\n end",
"def destroy_tape_drive(tape_drive_id, opts = {})\n destroy_tape_drive_with_http_info(tape_drive_id, opts)\n nil\n end",
"def destroy\n @machine_drive_type = MachineDriveType.find(params[:id])\n @machine_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @moto_drive_type = MotoDriveType.find(params[:id])\n @moto_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tape_type = TapeType.find(params[:id])\n @tape_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(tape_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip_driver = TripDriver.find(params[:id])\n @trip_driver.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_drivers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vdisk = Vdisk.find(params[:id])\n @vdisk.destroy\n\n respond_to do |format|\n format.html { redirect_to vdisks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tape.destroy\n respond_to do |format|\n format.html { redirect_to tapes_url, notice: 'Tape was successfully destroyed.' }\n format.json { head :no_content }\n end #do\n end",
"def destroy\n @tape = Tape.find(params[:id])\n @tape.destroy\n\n respond_to do |format|\n format.html { redirect_to(tapes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.destroy_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.destroy_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#destroy_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @physical_disk = PhysicalDisk.find(params[:id])\n @physical_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @etape = Etape.find(params[:id])\n @etape.destroy\n\n respond_to do |format|\n format.html { redirect_to etapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lun_disk = LunDisk.find(params[:id])\n @lun_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to lun_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_tape = SavedTape.find(params[:id])\n @saved_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'mytapes' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tccapi.destroy\n respond_to do |format|\n format.html { redirect_to tccapis_url, notice: 'Tccapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune.destroy\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy; delete end",
"def destroy\n @tablet.destroy\n respond_to do |format|\n format.html { redirect_to tablets_url, notice: 'Tablet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sector = Sector.find(params[:id])\n @sector.destroy\n redirect_to(sectors_url)\n end",
"def destroy\n @tcard.destroy\n respond_to do |format|\n format.html { redirect_to tcards_url, notice: 'Tcard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = @object\n begin\n @drive.destroy\n rescue Exception => destroy_error\n respond_to do |format|\n flash[:error] = destroy_error.message\n format.html { redirect_to drive_url(@drive) and return}\n format.xml { head :error } # FIXME?\n end\n end\n \n # Success!\n respond_to do |format|\n format.html { redirect_to drives_url }\n format.js {\n render(:update) { |page|\n if request.env[\"HTTP_REFERER\"].include? \"nodes\"\n page.replace_html 'drive_served', {:partial => 'nodes/drive_served', :locals => { :node => @drive.drive_server } }\n page.hide 'create_drive_served'\n page.show 'add_drive_served_link'\n end\n }\n }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune = Tune.find(params[:id])\n @tune.destroy\n\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy!\r\n self.class.service_instance.delete_blob(path)\r\n end",
"def delete_from_disk; end",
"def destroy\n @mag_tape = MagTape.find(params[:id])\n @mag_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to mag_tapes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @driver_trip_seat.destroy\n respond_to do |format|\n format.html { redirect_to driver_trip_seats_url, notice: 'Driver trip seat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy!\n Dropio::Resource.client.delete_drop(self)\n end",
"def destroy\n @terminal_device.destroy\n respond_to do |format|\n format.html { redirect_to terminal_devices_url, notice: 'Terminal device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_tape(tape_id, opts = {})\n destroy_tape_with_http_info(tape_id, opts)\n nil\n end",
"def destroy\n @ride_driver.destroy\n respond_to do |format|\n format.html { redirect_to @root }\n format.json { head :no_content }\n end\n end",
"def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end",
"def destroy\n @trip_type.destroy\n respond_to do |format|\n format.html { redirect_to trip_types_url, notice: 'Trip type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @templete = Templete.find(params[:id])\n @templete.destroy\n\n respond_to do |format|\n format.html { redirect_to templetes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard = Timecard.find(params[:id])\n @timecard.destroy\n\n redirect_to(timecards_url)\n end",
"def destroy\n @tuning.destroy\n respond_to do |format|\n format.html { redirect_to tunings_url, notice: 'Tuning was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n @magnetic_finger_print.destroy\n\n respond_to do |format|\n format.html { redirect_to magnetic_finger_prints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_admin_user\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n render status: :ok\n end",
"def destroy\n authenticate_request!\n\n @car = Car.find(params[:id])\n @car.destroy\n\n head :no_content\n end",
"def destroy(provision, tf)\n Terraform.p_load\n\n terraform = Terraform.singleton(@provider, tf)\n terraform.destroy_network(provision, @one.id)\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @ethernet.destroy\n respond_to do |format|\n format.html { redirect_to ethernets_url, notice: 'Ethernet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trip.destroy\n\n head :no_content\n end",
"def destroy\n @apt = Apt.find(params[:id])\n @apt.destroy\n\n respond_to do |format|\n format.html { redirect_to apts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ride_type.destroy\n respond_to do |format|\n format.html { redirect_to ride_types_url, notice: 'Ride type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @typerelsequence.destroy\n respond_to do |format|\n format.html { redirect_to typerelsequences_url, notice: 'Typerelsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brake_type.destroy\n respond_to do |format|\n format.html { redirect_to brake_types_url, notice: 'Brake type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltnytt.destroy\n respond_to do |format|\n format.html { redirect_to controltnytts_url, notice: 'Controltnytt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n patient = TrashedPatient.get!(params[:id])\n patient.remove_from_trash\n\n head :ok\n end",
"def destory\n @trip = Trips.delete_trip( params[ :id ] )\n flash[:notice] = \"Trip Deleted successfuly\"\n redirect_to(:action => 'list')\n end",
"def destroy\n @typeairplane.destroy\n respond_to do |format|\n format.html { redirect_to typeairplanes_url, notice: 'Typeairplane was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pitch.destroy\n api_success\n end",
"def destroy\n puts(\"Tacos are indestructible\")\n end",
"def destroy\n @tarot.destroy\n respond_to do |format|\n format.html { redirect_to tarots_url, notice: 'Tarot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end",
"def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_vi_place.destroy\n end",
"def destroy(path)\n output { delete(path) }\n end",
"def destroy\n @departuretype.destroy\n respond_to do |format|\n format.html { redirect_to departuretypes_url, notice: 'Departuretype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n file&.delete\n end",
"def destroy\n mountain = Mountain.find params[:id]\n mountain.destroy\n redirect_to (mountains_path)\n end",
"def destroy\n travel = Travel.find(params[:id])\n travel.destroy\n head 204\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @sub_gtp.destroy\n respond_to do |format|\n format.html { redirect_to sub_gtps_url, notice: 'Sub gtp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @trip = Trip.find(params[:id])\n\n stat(@trip, \"del\")\n\n ing = @trip.ing\n if ing\n trip_user_delete(@trip.driver)\n @trip.car.update_attribute(:current_trip, 0)\n @trip.workers.each do |worker|\n trip_user_delete(worker)\n end\n end\n\n @trip.workers.clear\n\n @trip.destroy\n\n respond_to do |format|\n format.html do\n flash[:success] = \"该出车记录已删除!\"\n sign_in(current_user)\n if ing\n redirect_to '/drivers/start'\n else\n redirect_to '/drivers/trips'\n end\n end\n format.json\n end\n end",
"def destroy\n @tank.destroy\n respond_to do |format|\n\n destroy_entry(tanks_url, format)\n end\n end",
"def destroy\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n @vehicle_passcard.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_passcard_personal_detail_path(@vehicle_passcard.personal_detail_id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end",
"def destroy\n\t\t\t\trespond_with Driver.destroy(params[:id])\n end",
"def destroy\n @car = Car.find(params[:id])\n if @car.is_used\n redirect_to trips_path, notice: 'Das Auto wird fuer eine Fahrt genutzt und kann deshalb nicht entfernt werden.'\n else\n @car.destroy\n redirect_to cars_url\n end\n end",
"def destroy\n destroy_resource @ride, rides_url\n end",
"def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @departure_type.destroy\n respond_to do |format|\n format.html { redirect_to departure_types_url, notice: 'Departure type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n head :no_content\n end",
"def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trailer.destroy\n respond_to do |format|\n format.html { redirect_to trailers_url, notice: 'Trailer was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @airport = Airport.find(params[:id])\n @airport.destroy\n\n respond_to do |format|\n format.html { redirect_to airports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tier = Tier.find(params[:id])\n @tier.destroy\n\n respond_to do |format|\n format.html { redirect_to tiers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n end",
"def destroy\n \n end"
] |
[
"0.699584",
"0.66342956",
"0.6464306",
"0.64514256",
"0.6419904",
"0.6408456",
"0.6393509",
"0.6356012",
"0.63434166",
"0.6201278",
"0.61230373",
"0.6118356",
"0.6091912",
"0.607373",
"0.60035104",
"0.5969916",
"0.59588116",
"0.5938809",
"0.5907166",
"0.5881415",
"0.58696675",
"0.58534557",
"0.58316165",
"0.5825509",
"0.5801182",
"0.5777233",
"0.5769817",
"0.5768561",
"0.5765565",
"0.57629436",
"0.575095",
"0.5722471",
"0.57190377",
"0.57117474",
"0.5705472",
"0.57004786",
"0.56972885",
"0.56970865",
"0.5695932",
"0.5692208",
"0.56631345",
"0.5650865",
"0.5637468",
"0.5623944",
"0.5620157",
"0.5619113",
"0.5618496",
"0.5614015",
"0.5613779",
"0.56086195",
"0.5607494",
"0.56073844",
"0.56073225",
"0.56023526",
"0.5600764",
"0.55991524",
"0.55977625",
"0.55939895",
"0.55920833",
"0.5589035",
"0.55870694",
"0.5580753",
"0.55784225",
"0.55710655",
"0.5569742",
"0.5565592",
"0.5565207",
"0.5563708",
"0.556256",
"0.5561432",
"0.5551143",
"0.55441135",
"0.55441135",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5538685",
"0.55384964",
"0.55384964",
"0.5531624",
"0.5530648",
"0.5527385",
"0.5526455",
"0.5525772",
"0.55224323",
"0.55216974",
"0.5520324",
"0.55195177",
"0.5516605",
"0.55148685",
"0.5507782",
"0.5502757",
"0.5496829",
"0.54965174",
"0.54965174"
] |
0.60825187
|
13
|
Destroys a specific tape drive. API Key Scope: tape_drives / destroy
|
def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library"
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type]
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @drive_system = DriveSystem.find(params[:id])\n @drive_system.destroy\n\n respond_to do |format|\n format.html { redirect_to drive_systems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = Drive.find(params[:id])\n @drive.destroy\n redirect_to drives_path, :notice => 'Frequenzumrichter wurde gelöscht.'\n end",
"def destroy\n @drive_type = DriveType.find(params[:id])\n @drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @drives = Drives.find(params[:id])\n @drives.destroy\n\n respond_to do |format|\n format.html { redirect_to(drives_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n respond_with ApidDrive.find(params[:id])\n end",
"def destroy_tape_drive(tape_drive_id, opts = {})\n destroy_tape_drive_with_http_info(tape_drive_id, opts)\n nil\n end",
"def destroy\n @machine_drive_type = MachineDriveType.find(params[:id])\n @machine_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @moto_drive_type = MotoDriveType.find(params[:id])\n @moto_drive_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_drive_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tape_type = TapeType.find(params[:id])\n @tape_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(tape_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip_driver = TripDriver.find(params[:id])\n @trip_driver.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_drivers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vdisk = Vdisk.find(params[:id])\n @vdisk.destroy\n\n respond_to do |format|\n format.html { redirect_to vdisks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tape.destroy\n respond_to do |format|\n format.html { redirect_to tapes_url, notice: 'Tape was successfully destroyed.' }\n format.json { head :no_content }\n end #do\n end",
"def destroy_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n nil\n end",
"def destroy\n @tape = Tape.find(params[:id])\n @tape.destroy\n\n respond_to do |format|\n format.html { redirect_to(tapes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.destroy_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.destroy_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#destroy_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def destroy\n @physical_disk = PhysicalDisk.find(params[:id])\n @physical_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @etape = Etape.find(params[:id])\n @etape.destroy\n\n respond_to do |format|\n format.html { redirect_to etapes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lun_disk = LunDisk.find(params[:id])\n @lun_disk.destroy\n\n respond_to do |format|\n format.html { redirect_to lun_disks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @saved_tape = SavedTape.find(params[:id])\n @saved_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'mytapes' }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tccapi.destroy\n respond_to do |format|\n format.html { redirect_to tccapis_url, notice: 'Tccapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune.destroy\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy; delete end",
"def destroy\n @tablet.destroy\n respond_to do |format|\n format.html { redirect_to tablets_url, notice: 'Tablet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sector = Sector.find(params[:id])\n @sector.destroy\n redirect_to(sectors_url)\n end",
"def destroy\n @tcard.destroy\n respond_to do |format|\n format.html { redirect_to tcards_url, notice: 'Tcard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @drive = @object\n begin\n @drive.destroy\n rescue Exception => destroy_error\n respond_to do |format|\n flash[:error] = destroy_error.message\n format.html { redirect_to drive_url(@drive) and return}\n format.xml { head :error } # FIXME?\n end\n end\n \n # Success!\n respond_to do |format|\n format.html { redirect_to drives_url }\n format.js {\n render(:update) { |page|\n if request.env[\"HTTP_REFERER\"].include? \"nodes\"\n page.replace_html 'drive_served', {:partial => 'nodes/drive_served', :locals => { :node => @drive.drive_server } }\n page.hide 'create_drive_served'\n page.show 'add_drive_served_link'\n end\n }\n }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tune = Tune.find(params[:id])\n @tune.destroy\n\n respond_to do |format|\n format.html { redirect_to tunes_url }\n format.json { head :no_content }\n end\n end",
"def destroy!\r\n self.class.service_instance.delete_blob(path)\r\n end",
"def delete_from_disk; end",
"def destroy\n @mag_tape = MagTape.find(params[:id])\n @mag_tape.destroy\n\n respond_to do |format|\n format.html { redirect_to mag_tapes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @driver_trip_seat.destroy\n respond_to do |format|\n format.html { redirect_to driver_trip_seats_url, notice: 'Driver trip seat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy!\n Dropio::Resource.client.delete_drop(self)\n end",
"def destroy\n @terminal_device.destroy\n respond_to do |format|\n format.html { redirect_to terminal_devices_url, notice: 'Terminal device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_tape(tape_id, opts = {})\n destroy_tape_with_http_info(tape_id, opts)\n nil\n end",
"def destroy\n @ride_driver.destroy\n respond_to do |format|\n format.html { redirect_to @root }\n format.json { head :no_content }\n end\n end",
"def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end",
"def destroy\n @trip_type.destroy\n respond_to do |format|\n format.html { redirect_to trip_types_url, notice: 'Trip type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @templete = Templete.find(params[:id])\n @templete.destroy\n\n respond_to do |format|\n format.html { redirect_to templetes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard = Timecard.find(params[:id])\n @timecard.destroy\n\n redirect_to(timecards_url)\n end",
"def destroy\n @tuning.destroy\n respond_to do |format|\n format.html { redirect_to tunings_url, notice: 'Tuning was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n @magnetic_finger_print.destroy\n\n respond_to do |format|\n format.html { redirect_to magnetic_finger_prints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_admin_user\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n render status: :ok\n end",
"def destroy\n authenticate_request!\n\n @car = Car.find(params[:id])\n @car.destroy\n\n head :no_content\n end",
"def destroy(provision, tf)\n Terraform.p_load\n\n terraform = Terraform.singleton(@provider, tf)\n terraform.destroy_network(provision, @one.id)\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @ethernet.destroy\n respond_to do |format|\n format.html { redirect_to ethernets_url, notice: 'Ethernet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trip.destroy\n\n head :no_content\n end",
"def destroy\n @apt = Apt.find(params[:id])\n @apt.destroy\n\n respond_to do |format|\n format.html { redirect_to apts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ride_type.destroy\n respond_to do |format|\n format.html { redirect_to ride_types_url, notice: 'Ride type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @typerelsequence.destroy\n respond_to do |format|\n format.html { redirect_to typerelsequences_url, notice: 'Typerelsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brake_type.destroy\n respond_to do |format|\n format.html { redirect_to brake_types_url, notice: 'Brake type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltnytt.destroy\n respond_to do |format|\n format.html { redirect_to controltnytts_url, notice: 'Controltnytt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n patient = TrashedPatient.get!(params[:id])\n patient.remove_from_trash\n\n head :ok\n end",
"def destory\n @trip = Trips.delete_trip( params[ :id ] )\n flash[:notice] = \"Trip Deleted successfuly\"\n redirect_to(:action => 'list')\n end",
"def destroy\n @typeairplane.destroy\n respond_to do |format|\n format.html { redirect_to typeairplanes_url, notice: 'Typeairplane was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pitch.destroy\n api_success\n end",
"def destroy\n puts(\"Tacos are indestructible\")\n end",
"def destroy\n @tarot.destroy\n respond_to do |format|\n format.html { redirect_to tarots_url, notice: 'Tarot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end",
"def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_vi_place.destroy\n end",
"def destroy(path)\n output { delete(path) }\n end",
"def destroy\n @departuretype.destroy\n respond_to do |format|\n format.html { redirect_to departuretypes_url, notice: 'Departuretype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n file&.delete\n end",
"def destroy\n mountain = Mountain.find params[:id]\n mountain.destroy\n redirect_to (mountains_path)\n end",
"def destroy\n travel = Travel.find(params[:id])\n travel.destroy\n head 204\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timecard.destroy\n respond_to do |format|\n format.html { redirect_to timecards_url, notice: 'Timecard was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n fail ESP::NotImplementedError\n end",
"def destroy\n @sub_gtp.destroy\n respond_to do |format|\n format.html { redirect_to sub_gtps_url, notice: 'Sub gtp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @athlete.destroy\n respond_to do |format|\n format.html { redirect_to athletes_url, notice: 'Athlete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @trip = Trip.find(params[:id])\n\n stat(@trip, \"del\")\n\n ing = @trip.ing\n if ing\n trip_user_delete(@trip.driver)\n @trip.car.update_attribute(:current_trip, 0)\n @trip.workers.each do |worker|\n trip_user_delete(worker)\n end\n end\n\n @trip.workers.clear\n\n @trip.destroy\n\n respond_to do |format|\n format.html do\n flash[:success] = \"该出车记录已删除!\"\n sign_in(current_user)\n if ing\n redirect_to '/drivers/start'\n else\n redirect_to '/drivers/trips'\n end\n end\n format.json\n end\n end",
"def destroy\n @tank.destroy\n respond_to do |format|\n\n destroy_entry(tanks_url, format)\n end\n end",
"def destroy\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n @vehicle_passcard.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_passcard_personal_detail_path(@vehicle_passcard.personal_detail_id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end",
"def destroy\n\t\t\t\trespond_with Driver.destroy(params[:id])\n end",
"def destroy\n @car = Car.find(params[:id])\n if @car.is_used\n redirect_to trips_path, notice: 'Das Auto wird fuer eine Fahrt genutzt und kann deshalb nicht entfernt werden.'\n else\n @car.destroy\n redirect_to cars_url\n end\n end",
"def destroy\n destroy_resource @ride, rides_url\n end",
"def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @departure_type.destroy\n respond_to do |format|\n format.html { redirect_to departure_types_url, notice: 'Departure type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n head :no_content\n end",
"def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trailer.destroy\n respond_to do |format|\n format.html { redirect_to trailers_url, notice: 'Trailer was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @airport = Airport.find(params[:id])\n @airport.destroy\n\n respond_to do |format|\n format.html { redirect_to airports_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tier = Tier.find(params[:id])\n @tier.destroy\n\n respond_to do |format|\n format.html { redirect_to tiers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n end",
"def destroy\n \n end"
] |
[
"0.699584",
"0.66342956",
"0.6464306",
"0.64514256",
"0.6419904",
"0.6408456",
"0.6393509",
"0.6356012",
"0.63434166",
"0.6201278",
"0.61230373",
"0.6118356",
"0.6091912",
"0.60825187",
"0.607373",
"0.60035104",
"0.5969916",
"0.59588116",
"0.5907166",
"0.5881415",
"0.58696675",
"0.58534557",
"0.58316165",
"0.5825509",
"0.5801182",
"0.5777233",
"0.5769817",
"0.5768561",
"0.5765565",
"0.57629436",
"0.575095",
"0.5722471",
"0.57190377",
"0.57117474",
"0.5705472",
"0.57004786",
"0.56972885",
"0.56970865",
"0.5695932",
"0.5692208",
"0.56631345",
"0.5650865",
"0.5637468",
"0.5623944",
"0.5620157",
"0.5619113",
"0.5618496",
"0.5614015",
"0.5613779",
"0.56086195",
"0.5607494",
"0.56073844",
"0.56073225",
"0.56023526",
"0.5600764",
"0.55991524",
"0.55977625",
"0.55939895",
"0.55920833",
"0.5589035",
"0.55870694",
"0.5580753",
"0.55784225",
"0.55710655",
"0.5569742",
"0.5565592",
"0.5565207",
"0.5563708",
"0.556256",
"0.5561432",
"0.5551143",
"0.55441135",
"0.55441135",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5542097",
"0.5538685",
"0.55384964",
"0.55384964",
"0.5531624",
"0.5530648",
"0.5527385",
"0.5526455",
"0.5525772",
"0.55224323",
"0.55216974",
"0.5520324",
"0.55195177",
"0.5516605",
"0.55148685",
"0.5507782",
"0.5502757",
"0.5496829",
"0.54965174",
"0.54965174"
] |
0.5938809
|
18
|
Lists tape drives devices. API Key Scope: tape_drives / devices
|
def index_tape_drive_devices(tape_library_id, job_id, opts = {})
data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def device_list(opts = {})\n data, _status_code, _headers = device_list_with_http_info(opts)\n data\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"def devices\n response = get('/listDevices')\n devices = []\n response.body['devices'].each do |d|\n devices << Device.from_json(d, @token, @logger)\n end\n devices\n end",
"def device_list\n @devices = Device.all\n end",
"def list\n Airplay.devices.each do |device|\n puts <<-EOS.gsub(/^\\s{12}/,'')\n * #{device.name} (#{device.info.model} running #{device.info.os_version})\n ip: #{device.ip}\n mac: #{device.id}\n password?: #{device.password? ? \"yes\" : \"no\"}\n type: #{device.type}\n resolution: #{device.info.resolution}\n\n EOS\n end\n end",
"def list\n all.each { |device| puts(device.pretty_name) }\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # verify the required parameter 'job_id' is set\n if @api_client.config.client_side_validation && job_id.nil?\n fail ArgumentError, \"Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'job_id'] = job_id\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveDeviceCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drive_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list_devices request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_devices_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Iot::V1::ListDevicesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def all_devices search = nil\n partitions = []\n devices = []\n device = nil\n has_extended = false\n if DEBUG_MODE or Platform.ubuntu? or Platform.fedora?\n command = \"lsblk\"\n params = \" #{search} -b -P -o VENDOR,MODEL,TYPE,SIZE,KNAME,UUID,LABEL,MOUNTPOINT,FSTYPE,RM\"\n end\n lsblk = CommandsExecutor.new command, params\n lsblk.execute\n raise \"Command execution error: #{lsblk.stderr.read}\" if not lsblk.success?\n\n lsblk.result.each_line do |line|\n data_hash = {}\n line.squish!\n line_data = line.gsub!(/\"(.*?)\"/, '\\1#').split \"#\"\n line_data.each do |data|\n data.strip!\n key, value = data.split \"=\"\n data_hash[key.downcase] = value\n end\n data_hash['rm'] = data_hash['rm'].to_i # rm = 1 if device is a removable/flash device, otherwise 0\n if data_hash['type'] == 'mpath'\n data_hash.except!('uuid', 'label', 'mountpoint', 'fstype')\n if device\n multipath_info = {'mkname' => data_hash['kname'], 'multipath' => true, 'size' => data_hash['size']}\n device.merge! multipath_info\n else\n data_hash['multipath'] = true\n device = data_hash\n devices.push device\n end\n next\n end\n if data_hash['type'] == 'disk'\n data_hash.except!('uuid', 'label', 'mountpoint', 'fstype')\n unless device.nil?\n device['partitions'] = partitions\n partitions = []\n devices.push device\n device = nil # cleanup the variable\n end\n device = data_hash\n next\n end\n if data_hash['type'] == 'part'\n data_hash.except!('model', 'vendor')\n data_hash.merge! self.usage data_hash['kname']\n\n partition_number = get_partition_number \"/dev/#{data_hash['kname']}\" # For reference: data_hash['kname'].match(/[0-9]*$/)[0].to_i\n extended_partition_types = ['0x05'.hex, '0x0F'.hex]\n if partition_type_hex(data_hash['kname']).in? extended_partition_types\n has_extended = true\n next\n end\n if has_extended and partition_number > 4\n data_hash['logical'] = true\n end\n # device['partitions'].nil? ? device['partitions'] = [data_hash] : device['partitions'].push(data_hash)\n partitions.push(data_hash)\n end\n end\n device['partitions'] = partitions if device\n devices.push device\n if search\n return devices.first || partitions.first\n else\n return devices\n end\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def devices\n url = \"me/player/devices\"\n response = RSpotify.resolve_auth_request(@id, url)\n\n return response if RSpotify.raw_response\n response['devices'].map { |i| Device.new i }\n end",
"def get_devices\n get_device_paths.collect do |device_path|\n NetworkManager::Device.new(device_path)\n end\n end",
"def get_synthetics_devices\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/synthetics/browser/devices\", nil, nil, false)\n end",
"def device_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevicesApi.device_list ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 300\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling DevicesApi.device_list, must be smaller than or equal to 300.'\n end\n\n # resource path\n local_var_path = '/h323/devices'\n\n # query parameters\n query_params = {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'H323SIPDeviceList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesApi#device_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def device_privates(id)\n get(\"/devices/#{id}/privates\")\n end",
"def devices(override_opts={})\n response = send_http_request(:get, \"/v1/me/player/devices\", override_opts)\n response[:devices].map do |device|\n Spotify::SDK::Connect::Device.new(device, self)\n end\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def devices\n devices = []\n present_runtime_name = nil\n\n SimCtl.cmd('list devices').lines.each do |l|\n case l[0]\n when'='\n # skip\n when '-'\n present_runtime_name = /^-- (.*) --$/.match(l)[1]\n when ' '\n arr = parse_std_line(l)\n # pp arr\n # exit 0\n d = SimDevice.new\n d.name = arr[0]\n d.id = arr[1]\n d.booted = (arr[2] == \"Booted\")\n d.runtime_name = present_runtime_name\n devices << d\n else\n #error \n end\n end\n\n devices.freeze\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def adb_scan(verbose = false)\n adb_devices = []\n\n $adb_ports.each { |port|\n cmd = [ 'adb', '-P', port.to_s, 'devices' ]\n Open3.popen3(*cmd) { |sin, sout, serr, thr|\n pid = thr[:pid]\n outlines = sout.readlines\n errlines = serr.readlines\n\n if errlines.length > 0\n $stderr.puts \"ERROR:\"\n\n errlines.each { |ln|\n $stderr.puts ln\n }\n end\n\n outlines.each { |ln|\n ln.chomp!\n ln.strip!\n next if ln.length < 1\n next if ln == \"List of devices attached\"\n next if ln[0,1] == \"*\"\n\n parts = ln.split(\"\\t\")\n serial = parts.first\n adb_devices << [ port, serial ]\n }\n }\n }\n\n if verbose\n adl = adb_devices.length\n apl = $adb_ports.length\n $stderr.puts \"[*] Found #{adl} device#{plural(adl)} on #{apl} server#{plural(apl)} via 'adb devices'\"\n end\n\n return adb_devices\nend",
"def devices()\n return MicrosoftGraph::Devices::DevicesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_device_list_for_group(device_group_id)\n path = \"device-groups/#{device_group_id}/devices\"\n query_api(path)\n end",
"def command_get_device_list(command)\n\t\tdir = File.join(@module_dir, \"device\", \"*.rb\")\n\t\tDir.glob(dir) {|file| message(\" #{File.basename(file, \".rb\")}\") }\n\tend",
"def devices\n\texecute(\"devices\").split(\"\\n\")[1..-1]\nend",
"def index\n @q = apply_scopes(Device).all.search(params[:q])\n @devices = @q.result(distinct: true).page(params[:page])\n\n respond_with(@devices)\n end",
"def index\n @catalog_devices = Catalog::Device.all\n end",
"def index_tape_drives_by_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_devices\n devices = []\n run_adb(\"devices\") do |pout|\n pout.each do |line|\n line = line.strip\n if (!line.empty? && line !~ /^List of devices/)\n parts = line.split\n device = AndroidAdb::Device.new(parts[0], parts[1])\n devices << device\n end\n end\n end\n return devices\n end",
"def devices\n @devices\n end",
"def devices; end",
"def server_devices_list\n if !ccl_active? or (session[:usertype] != \"admin\" and ccl_active?)\n dont_be_so_smart\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n end\n @page_title = _('Server_devices')\n @page_icon = 'server.png'\n @help_link = \"http://wiki.kolmisoft.com/index.php/Multi_Server_support\"\n # ip_auth + server_devices.server_id is null + server_devices.server_id is not that server + not server device(which were created with server creation)\n @devices = Device.select(\"devices.*,server_devices.server_id AS serv_id\").joins(\"LEFT JOIN server_devices ON (server_devices.device_id = devices.id AND server_devices.server_id = #{params[:id].to_i}) LEFT JOIN users ON (users.id = devices.user_id)\").where(\"(host != 'dynamic' OR device_type != 'SIP') AND users.owner_id = #{current_user.id} AND server_devices.server_id is null AND user_id != -1 AND name not like 'mor_server_%'\").order(\"extension ASC\").all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def devices\r\n DevicesController.instance\r\n end",
"def index\n @devices = @user.devices\n end",
"def devices=(value)\n @devices = value\n end",
"def get_device_list( options )\n devices = options[:device_list]\n devices = [devices].flatten if devices\n devices_p = nil\n num_devices = 0\n if devices and devices.size > 0 then\n num_devices = devices.size\n devices_p = MemoryPointer::new( Device, num_devices)\n devices_p.write_array_of_pointer(devices)\n end\n return [num_devices, devices_p]\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def mounts\r\n @mounts.list\r\n end",
"def index\n @devices = current_user.devices\n end",
"def list_account_devices(account_id, opts = {})\n data, _status_code, _headers = list_account_devices_with_http_info(account_id, opts)\n data\n end",
"def index\n @devices = current_user.devices.order(:alias_name)\n end",
"def drive()\n @adapter.drive\n end",
"def disks\n self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)\n end",
"def list_terminals\n Terminal.list_terminals(@user_token, @access_token)\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def get_disks(token, disks_url)\n disk_ids = Array.new \n endpoint = disks_url.scan(/\\/organizations.*disks/)\n resp_hash = get_url(token, endpoint[0], {})\n resp_hash[:embedded][:disks].each do |disk|\n disk_ids.push extract_id(disk[:_links][:self][:href], 'disks')\n end\n return [disk_ids, resp_hash]\nend",
"def physical_disk_views\n client.enumerate(\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_PhysicalDiskView\")\n end",
"def keys\n ::M2X::Client::Key.list(@client, params.merge(device: self[\"id\"]))\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def devices\n return @devices\n end",
"def index\n @admin_devices = AdminDevice.all\n end",
"def list_virtual_m_f_a_devices(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListVirtualMFADevices'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tself.run(args)\n\tend",
"def index\n# @devices = Device.all\n end",
"def select_storage_devices(component)\n pci_devices = component.try(:pciDevices).try(:select) { |device| storage_device?(device) }\n addin_cards = component.try(:addinCards).try(:select) { |device| storage_device?(device) }\n\n devices = []\n devices.concat(pci_devices) if pci_devices.present?\n devices.concat(addin_cards) if addin_cards.present?\n devices\n end",
"def search(client, params={})\n res = client.get(\"#{PATH}/search\", params)\n\n res.json[\"devices\"].map{ |atts| new(client, atts) } if res.success?\n end",
"def device\n @client.get('VBD', :device, @uuid)\n end",
"def catalog(client, params={})\n res = client.get(\"#{PATH}/catalog\", params)\n\n res.json[\"devices\"].map{ |atts| new(client, atts) } if res.success?\n end",
"def list request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/disks\"\n\n query_string_params = {}\n query_string_params[\"filter\"] = request_pb.filter.to_s if request_pb.filter && request_pb.filter != \"\"\n query_string_params[\"maxResults\"] = request_pb.max_results.to_s if request_pb.max_results && request_pb.max_results != 0\n query_string_params[\"orderBy\"] = request_pb.order_by.to_s if request_pb.order_by && request_pb.order_by != \"\"\n query_string_params[\"pageToken\"] = request_pb.page_token.to_s if request_pb.page_token && request_pb.page_token != \"\"\n query_string_params[\"returnPartialSuccess\"] = request_pb.return_partial_success.to_s if request_pb.return_partial_success && request_pb.return_partial_success != false\n\n response = @client_stub.make_get_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::DiskList.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"def list_account_devices_with_http_info(account_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevicesApi.list_account_devices ...'\n end\n # verify the required parameter 'account_id' is set\n if @api_client.config.client_side_validation && account_id.nil?\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling DevicesApi.list_account_devices\"\n end\n if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/)\n fail ArgumentError, \"invalid value for 'opts[:\\\"sort_id\\\"]' when calling DevicesApi.list_account_devices, must conform to the pattern /asc|desc/.\"\n end\n\n if @api_client.config.client_side_validation && !opts[:'sort_name'].nil? && opts[:'sort_name'] !~ Regexp.new(/asc|desc/)\n fail ArgumentError, \"invalid value for 'opts[:\\\"sort_name\\\"]' when calling DevicesApi.list_account_devices, must conform to the pattern /asc|desc/.\"\n end\n\n # resource path\n local_var_path = '/accounts/{account_id}/devices'.sub('{' + 'account_id' + '}', account_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil?\n query_params[:'filters[name]'] = @api_client.build_collection_param(opts[:'filters_name'], :multi) if !opts[:'filters_name'].nil?\n query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil?\n query_params[:'sort[name]'] = opts[:'sort_name'] if !opts[:'sort_name'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['apiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ListDevices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesApi#list_account_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def setup_device_for_mount\n # use ramdisk for creating a test device for mount.\n # This can cleaner if we have chef resource/provider for ramdisk.\n case ohai[:platform_family]\n when \"aix\"\n # On AIX, we can't create a ramdisk inside a WPAR, so we use\n # a \"namefs\" mount against / to test\n # https://www-304.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.performance/namefs_file_sys.htm\n device = \"/\"\n fstype = \"namefs\"\n when \"debian\", \"rhel\", \"amazon\"\n device = \"/dev/ram1\"\n unless File.exist?(device)\n shell_out(\"mknod -m 660 #{device} b 1 0\")\n shell_out(\"chown root:disk #{device}\")\n end\n shell_out(\"ls -1 /dev/ram*\").stdout.each_line do |d|\n if shell_out(\"mount | grep #{d}\").exitstatus == \"1\"\n # this device is not mounted, so use it.\n device = d\n break\n end\n end\n fstype = \"tmpfs\"\n shell_out!(\"mkfs -q #{device} 512\")\n when \"solaris2\"\n device = \"swap\"\n fstype = \"tmpfs\"\n else\n end\n [device, fstype]\n end",
"def devices\n puts `instruments -s devices | grep -v '(Simulator)'`\n end",
"def mount_usb_drive\n execute_system_cmd('mount /home/pi/compartida/musica/discousb')\n end",
"def find_matching_udev_devices(&block)\n\n #Create a udev enumerator devices.\n context = RubDev::Context.new\n enumerator = RubDev::Enumerate.new(context)\n\n #Yield the given enumerator to the provided block,\n #allowing it to narrow our search.\n block[enumerator]\n\n #... scan for the relevant devices...\n enumerator.scan_devices\n paths = enumerator.to_list\n\n devices = []\n\n #... and build an array of relevant syspaths.\n until paths.name.nil?\n devices << RubDev::Device.from_syspath(context, paths.name)\n paths.next\n end\n \n devices\n\n end",
"def one_disks_list\n one_item.info if one_item.instance_of?(OpenNebula::VirtualMachine)\n one_item.retrieve_xmlelements('TEMPLATE/DISK')\n end",
"def index\n @devicetypes = Devicetype.all\n end",
"def index\n if current_user\n if current_user.is_admin?\n @devices = Device.all\n else\n @devices = Device.where(:user_id => current_user.id)\n end\n else\n redirect_to login_url, :notice => \"Please login to manage your devices\"\n end\n end",
"def disks\n \tbs = {}\n\tnoko_details.xpath('/domain/devices/disk').map do |ddsk|\n\t next if ddsk.xpath('@device').text != \"disk\"\n\t next if ddsk.xpath('@snapshot').text == \"external\"\n\t sf = ddsk.xpath('source/@dev','source/@file').text\n\t td = ddsk.xpath('target/@dev').text\n\t bs[td] = sf\n\tend\n\tbs\n end",
"def GetPartitionLst(tg, device)\n tg = deep_copy(tg)\n ret = []\n tmp = GetDiskPartitionTg(device, tg)\n Builtins.y2milestone(\"GetPartitionLst tmp:%1\", tmp)\n Builtins.foreach(tmp) do |m|\n disk = Ops.get_string(m, \"disk\", \"\")\n if Builtins.search(device, \"/dev/evms\") == 0 &&\n !Builtins.haskey(tg, disk)\n disk = \"/dev/evms\"\n end\n Builtins.y2debug(\"GetPartitionLst device=%1 disk=%2\", device, disk)\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_string(p, \"device\", \"\") == device\n end\n part = Builtins.filter(part) { |p| !Ops.get_boolean(p, \"delete\", false) }\n if Builtins.size(part) == 0 && Ops.is_integer?(Ops.get(m, \"nr\", 0))\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_integer(p, \"nr\", -1) == Ops.get_integer(m, \"nr\", 0)\n end\n part = Builtins.filter(part) do |p|\n !Ops.get_boolean(p, \"delete\", false)\n end\n end\n if Builtins.size(part) == 0\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_string(p, \"name\", \"\") == Ops.get_string(m, \"nr\", \"\")\n end\n part = Builtins.filter(part) do |p|\n !Ops.get_boolean(p, \"delete\", false)\n end\n end\n pa = Ops.get(part, 0, {})\n if Builtins.size(pa) == 0 &&\n Builtins.search(device, \"/dev/mapper/\") == 0\n part = Builtins.filter(\n Ops.get_list(tg, [\"/dev/mapper\", \"partitions\"], [])\n ) { |p| Ops.get_string(p, \"device\", \"\") == device }\n pa = Ops.get(part, 0, {})\n end\n if Builtins.size(pa) == 0 &&\n Builtins.search(device, \"/dev/mapper/\") == 0\n part = Builtins.filter(\n Ops.get_list(tg, [\"/dev/loop\", \"partitions\"], [])\n ) { |p| Ops.get_string(p, \"device\", \"\") == device }\n pa = Ops.get(part, 0, {})\n end\n ret = Builtins.add(ret, pa) if Ops.greater_than(Builtins.size(pa), 0)\n end\n Builtins.y2debug(\"GetPartitionLst ret=%1\", ret)\n deep_copy(ret)\n end",
"def set_devices(storage_config)\n storage_config = deep_copy(storage_config)\n Builtins.y2milestone(\"entering set_devices with %1\", storage_config)\n first_set = false\n failed = false\n auto_targetmap = Builtins.listmap(storage_config) do |drive|\n device = \"\"\n Builtins.y2milestone(\"Working on drive: %1\", drive)\n # FIXME: Check if physical drives > 1\n if Ops.get_string(drive, \"device\", \"\") == \"ask\"\n dev = DiskSelectionDialog()\n if dev != nil\n first_set = true\n device = dev\n end\n\n next { device => drive }\n end\n if !first_set &&\n (Ops.get_string(drive, \"device\", \"\") == \"\" ||\n Ops.get_string(drive, \"device\", \"\") == \"ask\")\n device = Storage.GetPartDisk\n Builtins.y2milestone(\"device: %1\", device)\n first_set = true\n next { device => drive }\n elsif Ops.get_string(drive, \"device\", \"\") != \"\"\n dev = Ops.get_string(drive, \"device\", \"\")\n if dev == \"\"\n dev = \"error\"\n Builtins.y2error(\"Missing device name in partitioning plan\")\n failed = true\n end\n\n next { dev => drive }\n end\n end\n\n return nil if failed\n\n auto_targetmap = Builtins.mapmap(auto_targetmap) do |device, d|\n # Convert from Old Style\n if Builtins.haskey(d, \"use\")\n Builtins.y2milestone(\n \"converting from \\\"use\\\" to new style: %1\",\n device\n )\n if Ops.get_string(d, \"use\", \"\") == \"free\"\n Ops.set(d, \"prefer_remove\", false)\n elsif Ops.get_string(d, \"use\", \"\") == \"all\"\n Ops.set(d, \"prefer_remove\", true)\n elsif Ops.get_string(d, \"use\", \"\") == \"linux\"\n Ops.set(d, \"keep_partition_num\", GetNoneLinuxPartitions(device))\n Ops.set(d, \"prefer_remove\", true)\n else\n uselist = Builtins.filter(\n Builtins.splitstring(Ops.get_string(d, \"use\", \"\"), \",\")\n ) { |s| s != \"\" }\n Builtins.y2milestone(\"uselist: %1\", uselist)\n keeplist = []\n all = GetAllPartitions(device)\n Builtins.y2milestone(\"all list: %1\", all)\n Builtins.foreach(all) do |i|\n if !Builtins.contains(uselist, Builtins.sformat(\"%1\", i))\n keeplist = Builtins.add(keeplist, i)\n end\n end\n Builtins.y2milestone(\"keeplist: %1\", keeplist)\n Ops.set(d, \"keep_partition_num\", keeplist)\n\n if Ops.greater_than(Builtins.size(keeplist), 0)\n Ops.set(d, \"prefer_remove\", true)\n end\n end\n else\n Ops.set(d, \"use\", \"all\")\n end\n # see if <usepart> is used and add the partitions to <keep_partition_num>\n Builtins.foreach(Ops.get_list(d, \"partitions\", [])) do |p|\n if Ops.get_integer(p, \"usepart\", -1) != -1\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.add(\n Ops.get_list(d, \"keep_partition_num\", []),\n Ops.get_integer(p, \"usepart\", -1)\n )\n )\n end\n end\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.toset(Ops.get_list(d, \"keep_partition_num\", []))\n )\n { device => d }\n end\n\n Builtins.y2milestone(\n \"processed autoyast partition plan: %1\",\n auto_targetmap\n )\n deep_copy(auto_targetmap)\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end",
"def index\n @devices = current_user.devices\n end",
"def index\n @controls = @device.controls\n end",
"def getDeviceKeysByBacking(backingFile, hardware = nil)\n dev = getDeviceByBacking(backingFile, hardware)\n return [nil, nil] if dev.nil?\n [dev[\"controllerKey\"], dev[\"key\"]]\n end",
"def get_current_devices(output)\n lines = output.split(\"\\n\")\n partitions = lines.drop(2).map do |line|\n line.chomp.split.last\n end\n partitions.reject! do |partition|\n partition =~ /^dm-\\d/\n end\n devices = partitions.select do |partition|\n partition =~ /[a-z]$/\n end\n devices.sort!.map! {|device| \"/dev/#{device}\"}\n if devices.empty?\n devices = partitions.select do |partition|\n partition =~ /[0-9]$/\n end.sort.map {|device| \"/dev/#{device}\"}\n end\n devices\n end",
"def get_disks(vm_id)\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def get_device_group_list\n query_api('device-groups')\n end",
"def get_network_sm_devices(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/sm/devices'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'fields' => options['fields'],\r\n 'wifiMacs' => options['wifi_macs'],\r\n 'serials' => options['serials'],\r\n 'ids' => options['ids'],\r\n 'scope' => options['scope'],\r\n 'batchSize' => options['batch_size'],\r\n 'batchToken' => options['batch_token']\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"def index\n @device_models = DeviceModel.all\n end",
"def index\n @special_device_lists = SpecialDeviceList.all\n end",
"def info_disks\n @disks = {}\n\n keys = disk_keys\n vc_disks = vcenter_disks_get\n one_disks = one_disks_list\n\n one_disks.each do |one_disk|\n index = one_disk['DISK_ID']\n\n disk = query_disk(one_disk, keys, vc_disks)\n\n vc_dev = vc_disks.delete(disk) if disk\n\n if vc_dev\n @disks[index] = Disk.new(index.to_i, one_disk, vc_dev)\n else\n @disks[index] = Disk.one_disk(index.to_i, one_disk)\n end\n end\n\n vc_disks.each {|d| @disks[d[:path_wo_ds]] = Disk.vc_disk(d) }\n\n @disks\n end",
"def list_ios_devices\n STDOUT.sync = true\n devices = \"\"\n while devices == \"\" do\n devices = `mobiledevice list_devices`\n end\n devices.split(/\\n/)\nend",
"def get_connectable_volume_templates(attributes = {})\n OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates')\n end",
"def get_firmware_drive_descriptor_list(opts = {})\n data, _status_code, _headers = get_firmware_drive_descriptor_list_with_http_info(opts)\n data\n end",
"def get_firmware_storage_controller_descriptor_list(opts = {})\n data, _status_code, _headers = get_firmware_storage_controller_descriptor_list_with_http_info(opts)\n data\n end",
"def list_partitions #by nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{print $1}'`.chomp.split\nend",
"def get_connectable_volume_templates(attributes = {})\n OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates')\n end",
"def virtual_disk_views\n client.enumerate(\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_VirtualDiskView\")\n end"
] |
[
"0.66426855",
"0.6381636",
"0.6372281",
"0.6343396",
"0.61689425",
"0.6058253",
"0.6053151",
"0.6026427",
"0.579051",
"0.5780769",
"0.57332724",
"0.5640688",
"0.5635617",
"0.5633703",
"0.5575401",
"0.5562256",
"0.55352396",
"0.5473493",
"0.5448977",
"0.544049",
"0.5440128",
"0.54357415",
"0.54283464",
"0.54214334",
"0.5401753",
"0.5398431",
"0.53984183",
"0.53887343",
"0.5374881",
"0.5360522",
"0.5337991",
"0.53104955",
"0.5290635",
"0.5276626",
"0.5238427",
"0.5227621",
"0.5226879",
"0.52266574",
"0.52235",
"0.5223189",
"0.5219002",
"0.5203804",
"0.5203804",
"0.5203804",
"0.5203804",
"0.5203804",
"0.5191013",
"0.51692325",
"0.5164574",
"0.5153501",
"0.5151709",
"0.511761",
"0.51030874",
"0.50932986",
"0.5088032",
"0.5080019",
"0.50761634",
"0.5068458",
"0.5066665",
"0.50477594",
"0.5037144",
"0.5022377",
"0.49983674",
"0.49730307",
"0.49699414",
"0.4961699",
"0.49549007",
"0.49441102",
"0.4943038",
"0.49415454",
"0.49294618",
"0.49280855",
"0.49243212",
"0.49212304",
"0.49170282",
"0.4911443",
"0.49105564",
"0.49056983",
"0.48951146",
"0.48939508",
"0.4882965",
"0.4881078",
"0.48746502",
"0.486571",
"0.48609257",
"0.48440737",
"0.48326525",
"0.48290902",
"0.48279628",
"0.48275626",
"0.48162228",
"0.48158354",
"0.47953632",
"0.47934052",
"0.47921753",
"0.47919258",
"0.47825643",
"0.4761253",
"0.4759036",
"0.47571495"
] |
0.6375872
|
2
|
Lists tape drives devices. API Key Scope: tape_drives / devices
|
def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices"
end
# verify the required parameter 'job_id' is set
if @api_client.config.client_side_validation && job_id.nil?
fail ArgumentError, "Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'job_id'] = job_id
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'TapeDriveDeviceCollection'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#index_tape_drive_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def device_list(opts = {})\n data, _status_code, _headers = device_list_with_http_info(opts)\n data\n end",
"def index_tape_drive_devices(tape_library_id, job_id, opts = {})\n data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)\n data\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"def devices\n response = get('/listDevices')\n devices = []\n response.body['devices'].each do |d|\n devices << Device.from_json(d, @token, @logger)\n end\n devices\n end",
"def device_list\n @devices = Device.all\n end",
"def list\n Airplay.devices.each do |device|\n puts <<-EOS.gsub(/^\\s{12}/,'')\n * #{device.name} (#{device.info.model} running #{device.info.os_version})\n ip: #{device.ip}\n mac: #{device.id}\n password?: #{device.password? ? \"yes\" : \"no\"}\n type: #{device.type}\n resolution: #{device.info.resolution}\n\n EOS\n end\n end",
"def list\n all.each { |device| puts(device.pretty_name) }\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def list_devices request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_devices_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Iot::V1::ListDevicesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def all_devices search = nil\n partitions = []\n devices = []\n device = nil\n has_extended = false\n if DEBUG_MODE or Platform.ubuntu? or Platform.fedora?\n command = \"lsblk\"\n params = \" #{search} -b -P -o VENDOR,MODEL,TYPE,SIZE,KNAME,UUID,LABEL,MOUNTPOINT,FSTYPE,RM\"\n end\n lsblk = CommandsExecutor.new command, params\n lsblk.execute\n raise \"Command execution error: #{lsblk.stderr.read}\" if not lsblk.success?\n\n lsblk.result.each_line do |line|\n data_hash = {}\n line.squish!\n line_data = line.gsub!(/\"(.*?)\"/, '\\1#').split \"#\"\n line_data.each do |data|\n data.strip!\n key, value = data.split \"=\"\n data_hash[key.downcase] = value\n end\n data_hash['rm'] = data_hash['rm'].to_i # rm = 1 if device is a removable/flash device, otherwise 0\n if data_hash['type'] == 'mpath'\n data_hash.except!('uuid', 'label', 'mountpoint', 'fstype')\n if device\n multipath_info = {'mkname' => data_hash['kname'], 'multipath' => true, 'size' => data_hash['size']}\n device.merge! multipath_info\n else\n data_hash['multipath'] = true\n device = data_hash\n devices.push device\n end\n next\n end\n if data_hash['type'] == 'disk'\n data_hash.except!('uuid', 'label', 'mountpoint', 'fstype')\n unless device.nil?\n device['partitions'] = partitions\n partitions = []\n devices.push device\n device = nil # cleanup the variable\n end\n device = data_hash\n next\n end\n if data_hash['type'] == 'part'\n data_hash.except!('model', 'vendor')\n data_hash.merge! self.usage data_hash['kname']\n\n partition_number = get_partition_number \"/dev/#{data_hash['kname']}\" # For reference: data_hash['kname'].match(/[0-9]*$/)[0].to_i\n extended_partition_types = ['0x05'.hex, '0x0F'.hex]\n if partition_type_hex(data_hash['kname']).in? extended_partition_types\n has_extended = true\n next\n end\n if has_extended and partition_number > 4\n data_hash['logical'] = true\n end\n # device['partitions'].nil? ? device['partitions'] = [data_hash] : device['partitions'].push(data_hash)\n partitions.push(data_hash)\n end\n end\n device['partitions'] = partitions if device\n devices.push device\n if search\n return devices.first || partitions.first\n else\n return devices\n end\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def devices\n url = \"me/player/devices\"\n response = RSpotify.resolve_auth_request(@id, url)\n\n return response if RSpotify.raw_response\n response['devices'].map { |i| Device.new i }\n end",
"def get_devices\n get_device_paths.collect do |device_path|\n NetworkManager::Device.new(device_path)\n end\n end",
"def get_synthetics_devices\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/synthetics/browser/devices\", nil, nil, false)\n end",
"def device_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevicesApi.device_list ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 300\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling DevicesApi.device_list, must be smaller than or equal to 300.'\n end\n\n # resource path\n local_var_path = '/h323/devices'\n\n # query parameters\n query_params = {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'H323SIPDeviceList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesApi#device_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def device_privates(id)\n get(\"/devices/#{id}/privates\")\n end",
"def devices(override_opts={})\n response = send_http_request(:get, \"/v1/me/player/devices\", override_opts)\n response[:devices].map do |device|\n Spotify::SDK::Connect::Device.new(device, self)\n end\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def devices\n devices = []\n present_runtime_name = nil\n\n SimCtl.cmd('list devices').lines.each do |l|\n case l[0]\n when'='\n # skip\n when '-'\n present_runtime_name = /^-- (.*) --$/.match(l)[1]\n when ' '\n arr = parse_std_line(l)\n # pp arr\n # exit 0\n d = SimDevice.new\n d.name = arr[0]\n d.id = arr[1]\n d.booted = (arr[2] == \"Booted\")\n d.runtime_name = present_runtime_name\n devices << d\n else\n #error \n end\n end\n\n devices.freeze\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def adb_scan(verbose = false)\n adb_devices = []\n\n $adb_ports.each { |port|\n cmd = [ 'adb', '-P', port.to_s, 'devices' ]\n Open3.popen3(*cmd) { |sin, sout, serr, thr|\n pid = thr[:pid]\n outlines = sout.readlines\n errlines = serr.readlines\n\n if errlines.length > 0\n $stderr.puts \"ERROR:\"\n\n errlines.each { |ln|\n $stderr.puts ln\n }\n end\n\n outlines.each { |ln|\n ln.chomp!\n ln.strip!\n next if ln.length < 1\n next if ln == \"List of devices attached\"\n next if ln[0,1] == \"*\"\n\n parts = ln.split(\"\\t\")\n serial = parts.first\n adb_devices << [ port, serial ]\n }\n }\n }\n\n if verbose\n adl = adb_devices.length\n apl = $adb_ports.length\n $stderr.puts \"[*] Found #{adl} device#{plural(adl)} on #{apl} server#{plural(apl)} via 'adb devices'\"\n end\n\n return adb_devices\nend",
"def devices()\n return MicrosoftGraph::Devices::DevicesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_device_list_for_group(device_group_id)\n path = \"device-groups/#{device_group_id}/devices\"\n query_api(path)\n end",
"def command_get_device_list(command)\n\t\tdir = File.join(@module_dir, \"device\", \"*.rb\")\n\t\tDir.glob(dir) {|file| message(\" #{File.basename(file, \".rb\")}\") }\n\tend",
"def devices\n\texecute(\"devices\").split(\"\\n\")[1..-1]\nend",
"def index\n @q = apply_scopes(Device).all.search(params[:q])\n @devices = @q.result(distinct: true).page(params[:page])\n\n respond_with(@devices)\n end",
"def index\n @catalog_devices = Catalog::Device.all\n end",
"def index_tape_drives_by_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_devices\n devices = []\n run_adb(\"devices\") do |pout|\n pout.each do |line|\n line = line.strip\n if (!line.empty? && line !~ /^List of devices/)\n parts = line.split\n device = AndroidAdb::Device.new(parts[0], parts[1])\n devices << device\n end\n end\n end\n return devices\n end",
"def devices\n @devices\n end",
"def devices; end",
"def server_devices_list\n if !ccl_active? or (session[:usertype] != \"admin\" and ccl_active?)\n dont_be_so_smart\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n end\n @page_title = _('Server_devices')\n @page_icon = 'server.png'\n @help_link = \"http://wiki.kolmisoft.com/index.php/Multi_Server_support\"\n # ip_auth + server_devices.server_id is null + server_devices.server_id is not that server + not server device(which were created with server creation)\n @devices = Device.select(\"devices.*,server_devices.server_id AS serv_id\").joins(\"LEFT JOIN server_devices ON (server_devices.device_id = devices.id AND server_devices.server_id = #{params[:id].to_i}) LEFT JOIN users ON (users.id = devices.user_id)\").where(\"(host != 'dynamic' OR device_type != 'SIP') AND users.owner_id = #{current_user.id} AND server_devices.server_id is null AND user_id != -1 AND name not like 'mor_server_%'\").order(\"extension ASC\").all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @devices = @user.devices\n end",
"def devices\r\n DevicesController.instance\r\n end",
"def get_device_list( options )\n devices = options[:device_list]\n devices = [devices].flatten if devices\n devices_p = nil\n num_devices = 0\n if devices and devices.size > 0 then\n num_devices = devices.size\n devices_p = MemoryPointer::new( Device, num_devices)\n devices_p.write_array_of_pointer(devices)\n end\n return [num_devices, devices_p]\n end",
"def devices=(value)\n @devices = value\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def mounts\r\n @mounts.list\r\n end",
"def index\n @devices = current_user.devices\n end",
"def list_account_devices(account_id, opts = {})\n data, _status_code, _headers = list_account_devices_with_http_info(account_id, opts)\n data\n end",
"def index\n @devices = current_user.devices.order(:alias_name)\n end",
"def drive()\n @adapter.drive\n end",
"def disks\n self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)\n end",
"def list_terminals\n Terminal.list_terminals(@user_token, @access_token)\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def get_disks(token, disks_url)\n disk_ids = Array.new \n endpoint = disks_url.scan(/\\/organizations.*disks/)\n resp_hash = get_url(token, endpoint[0], {})\n resp_hash[:embedded][:disks].each do |disk|\n disk_ids.push extract_id(disk[:_links][:self][:href], 'disks')\n end\n return [disk_ids, resp_hash]\nend",
"def physical_disk_views\n client.enumerate(\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_PhysicalDiskView\")\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def keys\n ::M2X::Client::Key.list(@client, params.merge(device: self[\"id\"]))\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def devices\n return @devices\n end",
"def index\n @admin_devices = AdminDevice.all\n end",
"def list_virtual_m_f_a_devices(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListVirtualMFADevices'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tself.run(args)\n\tend",
"def index\n# @devices = Device.all\n end",
"def select_storage_devices(component)\n pci_devices = component.try(:pciDevices).try(:select) { |device| storage_device?(device) }\n addin_cards = component.try(:addinCards).try(:select) { |device| storage_device?(device) }\n\n devices = []\n devices.concat(pci_devices) if pci_devices.present?\n devices.concat(addin_cards) if addin_cards.present?\n devices\n end",
"def search(client, params={})\n res = client.get(\"#{PATH}/search\", params)\n\n res.json[\"devices\"].map{ |atts| new(client, atts) } if res.success?\n end",
"def device\n @client.get('VBD', :device, @uuid)\n end",
"def catalog(client, params={})\n res = client.get(\"#{PATH}/catalog\", params)\n\n res.json[\"devices\"].map{ |atts| new(client, atts) } if res.success?\n end",
"def list request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/disks\"\n\n query_string_params = {}\n query_string_params[\"filter\"] = request_pb.filter.to_s if request_pb.filter && request_pb.filter != \"\"\n query_string_params[\"maxResults\"] = request_pb.max_results.to_s if request_pb.max_results && request_pb.max_results != 0\n query_string_params[\"orderBy\"] = request_pb.order_by.to_s if request_pb.order_by && request_pb.order_by != \"\"\n query_string_params[\"pageToken\"] = request_pb.page_token.to_s if request_pb.page_token && request_pb.page_token != \"\"\n query_string_params[\"returnPartialSuccess\"] = request_pb.return_partial_success.to_s if request_pb.return_partial_success && request_pb.return_partial_success != false\n\n response = @client_stub.make_get_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::DiskList.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"def list_account_devices_with_http_info(account_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevicesApi.list_account_devices ...'\n end\n # verify the required parameter 'account_id' is set\n if @api_client.config.client_side_validation && account_id.nil?\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling DevicesApi.list_account_devices\"\n end\n if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/)\n fail ArgumentError, \"invalid value for 'opts[:\\\"sort_id\\\"]' when calling DevicesApi.list_account_devices, must conform to the pattern /asc|desc/.\"\n end\n\n if @api_client.config.client_side_validation && !opts[:'sort_name'].nil? && opts[:'sort_name'] !~ Regexp.new(/asc|desc/)\n fail ArgumentError, \"invalid value for 'opts[:\\\"sort_name\\\"]' when calling DevicesApi.list_account_devices, must conform to the pattern /asc|desc/.\"\n end\n\n # resource path\n local_var_path = '/accounts/{account_id}/devices'.sub('{' + 'account_id' + '}', account_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil?\n query_params[:'filters[name]'] = @api_client.build_collection_param(opts[:'filters_name'], :multi) if !opts[:'filters_name'].nil?\n query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil?\n query_params[:'sort[name]'] = opts[:'sort_name'] if !opts[:'sort_name'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['apiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ListDevices')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesApi#list_account_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def setup_device_for_mount\n # use ramdisk for creating a test device for mount.\n # This can cleaner if we have chef resource/provider for ramdisk.\n case ohai[:platform_family]\n when \"aix\"\n # On AIX, we can't create a ramdisk inside a WPAR, so we use\n # a \"namefs\" mount against / to test\n # https://www-304.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.performance/namefs_file_sys.htm\n device = \"/\"\n fstype = \"namefs\"\n when \"debian\", \"rhel\", \"amazon\"\n device = \"/dev/ram1\"\n unless File.exist?(device)\n shell_out(\"mknod -m 660 #{device} b 1 0\")\n shell_out(\"chown root:disk #{device}\")\n end\n shell_out(\"ls -1 /dev/ram*\").stdout.each_line do |d|\n if shell_out(\"mount | grep #{d}\").exitstatus == \"1\"\n # this device is not mounted, so use it.\n device = d\n break\n end\n end\n fstype = \"tmpfs\"\n shell_out!(\"mkfs -q #{device} 512\")\n when \"solaris2\"\n device = \"swap\"\n fstype = \"tmpfs\"\n else\n end\n [device, fstype]\n end",
"def devices\n puts `instruments -s devices | grep -v '(Simulator)'`\n end",
"def mount_usb_drive\n execute_system_cmd('mount /home/pi/compartida/musica/discousb')\n end",
"def find_matching_udev_devices(&block)\n\n #Create a udev enumerator devices.\n context = RubDev::Context.new\n enumerator = RubDev::Enumerate.new(context)\n\n #Yield the given enumerator to the provided block,\n #allowing it to narrow our search.\n block[enumerator]\n\n #... scan for the relevant devices...\n enumerator.scan_devices\n paths = enumerator.to_list\n\n devices = []\n\n #... and build an array of relevant syspaths.\n until paths.name.nil?\n devices << RubDev::Device.from_syspath(context, paths.name)\n paths.next\n end\n \n devices\n\n end",
"def one_disks_list\n one_item.info if one_item.instance_of?(OpenNebula::VirtualMachine)\n one_item.retrieve_xmlelements('TEMPLATE/DISK')\n end",
"def index\n @devicetypes = Devicetype.all\n end",
"def index\n if current_user\n if current_user.is_admin?\n @devices = Device.all\n else\n @devices = Device.where(:user_id => current_user.id)\n end\n else\n redirect_to login_url, :notice => \"Please login to manage your devices\"\n end\n end",
"def disks\n \tbs = {}\n\tnoko_details.xpath('/domain/devices/disk').map do |ddsk|\n\t next if ddsk.xpath('@device').text != \"disk\"\n\t next if ddsk.xpath('@snapshot').text == \"external\"\n\t sf = ddsk.xpath('source/@dev','source/@file').text\n\t td = ddsk.xpath('target/@dev').text\n\t bs[td] = sf\n\tend\n\tbs\n end",
"def GetPartitionLst(tg, device)\n tg = deep_copy(tg)\n ret = []\n tmp = GetDiskPartitionTg(device, tg)\n Builtins.y2milestone(\"GetPartitionLst tmp:%1\", tmp)\n Builtins.foreach(tmp) do |m|\n disk = Ops.get_string(m, \"disk\", \"\")\n if Builtins.search(device, \"/dev/evms\") == 0 &&\n !Builtins.haskey(tg, disk)\n disk = \"/dev/evms\"\n end\n Builtins.y2debug(\"GetPartitionLst device=%1 disk=%2\", device, disk)\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_string(p, \"device\", \"\") == device\n end\n part = Builtins.filter(part) { |p| !Ops.get_boolean(p, \"delete\", false) }\n if Builtins.size(part) == 0 && Ops.is_integer?(Ops.get(m, \"nr\", 0))\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_integer(p, \"nr\", -1) == Ops.get_integer(m, \"nr\", 0)\n end\n part = Builtins.filter(part) do |p|\n !Ops.get_boolean(p, \"delete\", false)\n end\n end\n if Builtins.size(part) == 0\n part = Builtins.filter(Ops.get_list(tg, [disk, \"partitions\"], [])) do |p|\n Ops.get_string(p, \"name\", \"\") == Ops.get_string(m, \"nr\", \"\")\n end\n part = Builtins.filter(part) do |p|\n !Ops.get_boolean(p, \"delete\", false)\n end\n end\n pa = Ops.get(part, 0, {})\n if Builtins.size(pa) == 0 &&\n Builtins.search(device, \"/dev/mapper/\") == 0\n part = Builtins.filter(\n Ops.get_list(tg, [\"/dev/mapper\", \"partitions\"], [])\n ) { |p| Ops.get_string(p, \"device\", \"\") == device }\n pa = Ops.get(part, 0, {})\n end\n if Builtins.size(pa) == 0 &&\n Builtins.search(device, \"/dev/mapper/\") == 0\n part = Builtins.filter(\n Ops.get_list(tg, [\"/dev/loop\", \"partitions\"], [])\n ) { |p| Ops.get_string(p, \"device\", \"\") == device }\n pa = Ops.get(part, 0, {})\n end\n ret = Builtins.add(ret, pa) if Ops.greater_than(Builtins.size(pa), 0)\n end\n Builtins.y2debug(\"GetPartitionLst ret=%1\", ret)\n deep_copy(ret)\n end",
"def set_devices(storage_config)\n storage_config = deep_copy(storage_config)\n Builtins.y2milestone(\"entering set_devices with %1\", storage_config)\n first_set = false\n failed = false\n auto_targetmap = Builtins.listmap(storage_config) do |drive|\n device = \"\"\n Builtins.y2milestone(\"Working on drive: %1\", drive)\n # FIXME: Check if physical drives > 1\n if Ops.get_string(drive, \"device\", \"\") == \"ask\"\n dev = DiskSelectionDialog()\n if dev != nil\n first_set = true\n device = dev\n end\n\n next { device => drive }\n end\n if !first_set &&\n (Ops.get_string(drive, \"device\", \"\") == \"\" ||\n Ops.get_string(drive, \"device\", \"\") == \"ask\")\n device = Storage.GetPartDisk\n Builtins.y2milestone(\"device: %1\", device)\n first_set = true\n next { device => drive }\n elsif Ops.get_string(drive, \"device\", \"\") != \"\"\n dev = Ops.get_string(drive, \"device\", \"\")\n if dev == \"\"\n dev = \"error\"\n Builtins.y2error(\"Missing device name in partitioning plan\")\n failed = true\n end\n\n next { dev => drive }\n end\n end\n\n return nil if failed\n\n auto_targetmap = Builtins.mapmap(auto_targetmap) do |device, d|\n # Convert from Old Style\n if Builtins.haskey(d, \"use\")\n Builtins.y2milestone(\n \"converting from \\\"use\\\" to new style: %1\",\n device\n )\n if Ops.get_string(d, \"use\", \"\") == \"free\"\n Ops.set(d, \"prefer_remove\", false)\n elsif Ops.get_string(d, \"use\", \"\") == \"all\"\n Ops.set(d, \"prefer_remove\", true)\n elsif Ops.get_string(d, \"use\", \"\") == \"linux\"\n Ops.set(d, \"keep_partition_num\", GetNoneLinuxPartitions(device))\n Ops.set(d, \"prefer_remove\", true)\n else\n uselist = Builtins.filter(\n Builtins.splitstring(Ops.get_string(d, \"use\", \"\"), \",\")\n ) { |s| s != \"\" }\n Builtins.y2milestone(\"uselist: %1\", uselist)\n keeplist = []\n all = GetAllPartitions(device)\n Builtins.y2milestone(\"all list: %1\", all)\n Builtins.foreach(all) do |i|\n if !Builtins.contains(uselist, Builtins.sformat(\"%1\", i))\n keeplist = Builtins.add(keeplist, i)\n end\n end\n Builtins.y2milestone(\"keeplist: %1\", keeplist)\n Ops.set(d, \"keep_partition_num\", keeplist)\n\n if Ops.greater_than(Builtins.size(keeplist), 0)\n Ops.set(d, \"prefer_remove\", true)\n end\n end\n else\n Ops.set(d, \"use\", \"all\")\n end\n # see if <usepart> is used and add the partitions to <keep_partition_num>\n Builtins.foreach(Ops.get_list(d, \"partitions\", [])) do |p|\n if Ops.get_integer(p, \"usepart\", -1) != -1\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.add(\n Ops.get_list(d, \"keep_partition_num\", []),\n Ops.get_integer(p, \"usepart\", -1)\n )\n )\n end\n end\n Ops.set(\n d,\n \"keep_partition_num\",\n Builtins.toset(Ops.get_list(d, \"keep_partition_num\", []))\n )\n { device => d }\n end\n\n Builtins.y2milestone(\n \"processed autoyast partition plan: %1\",\n auto_targetmap\n )\n deep_copy(auto_targetmap)\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def device_ports(device_id)\n return get_request(address(\"ports?device_id=#{device_id}\"), @token)\n end",
"def index\n @devices = current_user.devices\n end",
"def index\n @controls = @device.controls\n end",
"def getDeviceKeysByBacking(backingFile, hardware = nil)\n dev = getDeviceByBacking(backingFile, hardware)\n return [nil, nil] if dev.nil?\n [dev[\"controllerKey\"], dev[\"key\"]]\n end",
"def get_current_devices(output)\n lines = output.split(\"\\n\")\n partitions = lines.drop(2).map do |line|\n line.chomp.split.last\n end\n partitions.reject! do |partition|\n partition =~ /^dm-\\d/\n end\n devices = partitions.select do |partition|\n partition =~ /[a-z]$/\n end\n devices.sort!.map! {|device| \"/dev/#{device}\"}\n if devices.empty?\n devices = partitions.select do |partition|\n partition =~ /[0-9]$/\n end.sort.map {|device| \"/dev/#{device}\"}\n end\n devices\n end",
"def get_disks(vm_id)\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def get_network_sm_devices(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/sm/devices'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'fields' => options['fields'],\r\n 'wifiMacs' => options['wifi_macs'],\r\n 'serials' => options['serials'],\r\n 'ids' => options['ids'],\r\n 'scope' => options['scope'],\r\n 'batchSize' => options['batch_size'],\r\n 'batchToken' => options['batch_token']\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"def get_device_group_list\n query_api('device-groups')\n end",
"def index\n @special_device_lists = SpecialDeviceList.all\n end",
"def index\n @device_models = DeviceModel.all\n end",
"def info_disks\n @disks = {}\n\n keys = disk_keys\n vc_disks = vcenter_disks_get\n one_disks = one_disks_list\n\n one_disks.each do |one_disk|\n index = one_disk['DISK_ID']\n\n disk = query_disk(one_disk, keys, vc_disks)\n\n vc_dev = vc_disks.delete(disk) if disk\n\n if vc_dev\n @disks[index] = Disk.new(index.to_i, one_disk, vc_dev)\n else\n @disks[index] = Disk.one_disk(index.to_i, one_disk)\n end\n end\n\n vc_disks.each {|d| @disks[d[:path_wo_ds]] = Disk.vc_disk(d) }\n\n @disks\n end",
"def get_firmware_drive_descriptor_list(opts = {})\n data, _status_code, _headers = get_firmware_drive_descriptor_list_with_http_info(opts)\n data\n end",
"def list_ios_devices\n STDOUT.sync = true\n devices = \"\"\n while devices == \"\" do\n devices = `mobiledevice list_devices`\n end\n devices.split(/\\n/)\nend",
"def get_connectable_volume_templates(attributes = {})\n OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates')\n end",
"def get_firmware_storage_controller_descriptor_list(opts = {})\n data, _status_code, _headers = get_firmware_storage_controller_descriptor_list_with_http_info(opts)\n data\n end",
"def list_partitions #by nelsongs\n\treturn `fdisk -l | grep /dev | grep -v Disk | awk '{print $1}'`.chomp.split\nend",
"def get_connectable_volume_templates(attributes = {})\n OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates')\n end",
"def virtual_disk_views\n client.enumerate(\"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_VirtualDiskView\")\n end"
] |
[
"0.6643975",
"0.63805056",
"0.6376053",
"0.6374093",
"0.6342172",
"0.6166568",
"0.6055836",
"0.60518295",
"0.6024554",
"0.5789815",
"0.57329607",
"0.5638132",
"0.5637666",
"0.56312025",
"0.5572875",
"0.55600095",
"0.55346704",
"0.54727256",
"0.54472363",
"0.5441468",
"0.5437403",
"0.54369193",
"0.5428107",
"0.541929",
"0.5400107",
"0.539618",
"0.53961414",
"0.5387285",
"0.5372577",
"0.53610235",
"0.5336757",
"0.530857",
"0.5287714",
"0.52738976",
"0.5236628",
"0.5229938",
"0.52256995",
"0.52247405",
"0.52212894",
"0.5220629",
"0.52178407",
"0.52026063",
"0.52026063",
"0.52026063",
"0.52026063",
"0.52026063",
"0.5188996",
"0.51678896",
"0.5164659",
"0.515232",
"0.5150998",
"0.5114527",
"0.5103097",
"0.50930333",
"0.50882804",
"0.5078966",
"0.5073995",
"0.5067429",
"0.50659704",
"0.50465286",
"0.5034116",
"0.502127",
"0.4998224",
"0.4972074",
"0.49671796",
"0.49611345",
"0.49537915",
"0.49426165",
"0.49426123",
"0.4941755",
"0.4927332",
"0.49248993",
"0.49238306",
"0.49189848",
"0.49158502",
"0.49103552",
"0.49092877",
"0.490372",
"0.4894049",
"0.48915157",
"0.4883273",
"0.4880511",
"0.48734626",
"0.48644114",
"0.48584193",
"0.48422647",
"0.48315832",
"0.48293018",
"0.4826337",
"0.48253503",
"0.48148364",
"0.48146436",
"0.47926435",
"0.47912487",
"0.47911265",
"0.47909552",
"0.47806573",
"0.47596735",
"0.47577676",
"0.47556818"
] |
0.5781591
|
10
|
Lists all tape drives. API Key Scope: tape_drives / index
|
def index_tape_drives(opts = {})
data, _status_code, _headers = index_tape_drives_with_http_info(opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @edrives = Edrive.all\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drive_devices(tape_library_id, job_id, opts = {})\n data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)\n data\n end",
"def index\n @tunings = Tuning.all\n end",
"def index\n @tapes = Tape.all\n end",
"def index\n @brake_types = BrakeType.all\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @tarots = Tarot.all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def index\n @tunes = Tune.all\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def index\n @ride_drivers = RideDriver.all\n end",
"def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end",
"def index\n @taps = Tap.all\n end",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def index\n @tcards = Tcard.all\n end",
"def all\n api_get(path)\n end",
"def index\n @direccionts = Direcciont.all\n end",
"def index\n\t\t\t\trespond_with Driver.all\n\t\t\tend",
"def index\n @trivia = Trivia.all\n end",
"def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # verify the required parameter 'job_id' is set\n if @api_client.config.client_side_validation && job_id.nil?\n fail ArgumentError, \"Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'job_id'] = job_id\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveDeviceCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drive_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @trivia = Trivium.all\n end",
"def index\n @recordingstations = Recordingstation.all\n end",
"def index_tapes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes ...'\n end\n # resource path\n local_var_path = '/tapes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil?\n query_params[:'scratch'] = opts[:'scratch'] if !opts[:'scratch'].nil?\n query_params[:'cleaning'] = opts[:'cleaning'] if !opts[:'cleaning'].nil?\n query_params[:'write_protect'] = opts[:'write_protect'] if !opts[:'write_protect'].nil?\n query_params[:'mounted'] = opts[:'mounted'] if !opts[:'mounted'].nil?\n query_params[:'ejected'] = opts[:'ejected'] if !opts[:'ejected'].nil?\n query_params[:'known'] = opts[:'known'] if !opts[:'known'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'date_in'] = opts[:'date_in'] if !opts[:'date_in'].nil?\n query_params[:'date_move'] = opts[:'date_move'] if !opts[:'date_move'].nil?\n query_params[:'free'] = opts[:'free'] if !opts[:'free'].nil?\n query_params[:'max'] = opts[:'max'] if !opts[:'max'].nil?\n query_params[:'last_size_update'] = opts[:'last_size_update'] if !opts[:'last_size_update'].nil?\n query_params[:'last_maintenance'] = opts[:'last_maintenance'] if !opts[:'last_maintenance'].nil?\n query_params[:'last_repack'] = opts[:'last_repack'] if !opts[:'last_repack'].nil?\n query_params[:'repack_status'] = opts[:'repack_status'] if !opts[:'repack_status'].nil?\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'force_import_type'] = opts[:'force_import_type'] if !opts[:'force_import_type'].nil?\n query_params[:'need_to_check'] = opts[:'need_to_check'] if !opts[:'need_to_check'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#index_tapes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @tccapis = Tccapi.all\n end",
"def index\n terminals = scope.page(page).per(per)\n json_response(PageDecorator.decorate(terminals), :ok)\n end",
"def index\n @deckfiles = Deckfile.all\n end",
"def index\n @trip_types = TripType.all\n end",
"def index_tape_stats(opts = {})\n data, _status_code, _headers = index_tape_stats_with_http_info(opts)\n data\n end",
"def list\n call(:get, path)\n end",
"def index\n respond_with ApidDriver.all\n end",
"def index\n @ducks = Duck.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tvs = Tv.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @padraos = Padrao.all\n add_breadcrumb \"index\", padraos_path, :title => \"Volta para o index\"\n end",
"def list(table)\n self.get(\"/#{table}\")\n end",
"def index\n @dte_directions = DteDirection.all\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index\n @typings = Typing.all\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end",
"def index\n @trucks = Truck.all\n end",
"def get_all_stations\n url = 'radio/station'\n options = {query: {'alt': 'json', 'tier': 'aa', 'hl': 'en_US'}}\n\n make_post_request(url, options)\n end",
"def index\n @storage_units = StorageUnit.all\n end",
"def index\n @tottles = Tottle.all\n end",
"def index\n @ftpfiles = Ftpfile.all\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end",
"def index\n @athletes = Athlete.paginate(page: params[:page], :per_page => 15)\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @ride_types = RideType.all\n end",
"def index\n @turkeys = Turkey.all\n end",
"def index\n @petrol_stations = PetrolStation.all\n end",
"def index\n @dropzones = Dropzone.all\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def index\n @controltltkts = Controltltkt.all\n end",
"def get_sas_logical_jbod_drives(client, name)\n item = get_sas_logical_jbod(client, name)\n response = client.rest_get(item['uri'] + '/drives')\n client.response_handler(response)\n end",
"def index\n @tariffs = Tariff.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @winddirs = Winddir.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @ways = Way.all\n end",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def index\n @storages = Mercadolibre::Storage.all.paginate(page: params[:page], per_page: 7)\n end",
"def index\n @ftp_servers = FtpServer.all\n end",
"def index\n @tollstations = Tollstation.all\n end",
"def index\n @antrag_typs = AntragTyp.all\n end",
"def index\n @vaults = Vault.all\n end",
"def index\n @tracs = Trac.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @trip_routes = TripRoute.all\n end",
"def index\n @storage_types = StorageType.all\n end",
"def index\n @directions = Direction.all\n end",
"def index\n @gadget_files = GadgetFile.all\n end",
"def index\n @trips = Trip.all\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def index\n @directories = Directory.all\n end",
"def index\n @pkhds = Pkhd.all\n end",
"def stops\n get '/gtfs/stops'\n end",
"def index\n @cartridge_transfers = CartridgeTransfer.all\n end",
"def tbu_list\n @client.make_request :get, templates_path('tbu')\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end"
] |
[
"0.7145547",
"0.60515314",
"0.5932642",
"0.5885706",
"0.5850183",
"0.5777759",
"0.5706362",
"0.55698645",
"0.55423415",
"0.5527133",
"0.5499193",
"0.549044",
"0.54562354",
"0.54384524",
"0.54235816",
"0.53935623",
"0.53863704",
"0.5376855",
"0.53569293",
"0.5346293",
"0.53373003",
"0.53342366",
"0.5330522",
"0.53282213",
"0.53279597",
"0.53053826",
"0.53017974",
"0.52882767",
"0.5284765",
"0.5276945",
"0.52751964",
"0.52742314",
"0.524094",
"0.5240742",
"0.5232578",
"0.52121645",
"0.5207107",
"0.5197358",
"0.5196443",
"0.5180758",
"0.516437",
"0.516437",
"0.516437",
"0.5157338",
"0.51362276",
"0.51362276",
"0.51338446",
"0.5131511",
"0.5126237",
"0.5111974",
"0.51068246",
"0.5095247",
"0.5092496",
"0.5083439",
"0.5082197",
"0.50811887",
"0.50791276",
"0.50684667",
"0.5059807",
"0.5057856",
"0.5052665",
"0.5048652",
"0.5048652",
"0.5044139",
"0.5041341",
"0.5036942",
"0.50365704",
"0.5036539",
"0.50350505",
"0.5031963",
"0.5028908",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5020764",
"0.50191",
"0.50191",
"0.5012762",
"0.5009255",
"0.5006498",
"0.50014573",
"0.50005704",
"0.49990526",
"0.49959606",
"0.49924594",
"0.49917048",
"0.49917048",
"0.49907494",
"0.49852175",
"0.498473",
"0.49843362",
"0.49754864",
"0.4972058",
"0.49717945",
"0.49686524",
"0.49569914",
"0.49507076",
"0.49497014",
"0.4948975"
] |
0.7762862
|
0
|
Lists all tape drives. API Key Scope: tape_drives / index
|
def index_tape_drives_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'
end
# resource path
local_var_path = '/tape_drives'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?
query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?
query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?
query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?
query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?
query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?
query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?
query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?
query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?
query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?
query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?
query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?
query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?
query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?
query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?
query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?
query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?
query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?
query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?
query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?
query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?
query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'TapeDriveCollection'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#index_tape_drives\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def index\n @edrives = Edrive.all\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drive_devices(tape_library_id, job_id, opts = {})\n data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)\n data\n end",
"def index\n @tunings = Tuning.all\n end",
"def index\n @tapes = Tape.all\n end",
"def index\n @brake_types = BrakeType.all\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @tarots = Tarot.all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def index\n @tunes = Tune.all\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def index\n @ride_drivers = RideDriver.all\n end",
"def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end",
"def index\n @taps = Tap.all\n end",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def index\n @tcards = Tcard.all\n end",
"def all\n api_get(path)\n end",
"def index\n @direccionts = Direcciont.all\n end",
"def index\n\t\t\t\trespond_with Driver.all\n\t\t\tend",
"def index\n @trivia = Trivia.all\n end",
"def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # verify the required parameter 'job_id' is set\n if @api_client.config.client_side_validation && job_id.nil?\n fail ArgumentError, \"Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'job_id'] = job_id\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveDeviceCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drive_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @trivia = Trivium.all\n end",
"def index\n @recordingstations = Recordingstation.all\n end",
"def index_tapes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes ...'\n end\n # resource path\n local_var_path = '/tapes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil?\n query_params[:'scratch'] = opts[:'scratch'] if !opts[:'scratch'].nil?\n query_params[:'cleaning'] = opts[:'cleaning'] if !opts[:'cleaning'].nil?\n query_params[:'write_protect'] = opts[:'write_protect'] if !opts[:'write_protect'].nil?\n query_params[:'mounted'] = opts[:'mounted'] if !opts[:'mounted'].nil?\n query_params[:'ejected'] = opts[:'ejected'] if !opts[:'ejected'].nil?\n query_params[:'known'] = opts[:'known'] if !opts[:'known'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'date_in'] = opts[:'date_in'] if !opts[:'date_in'].nil?\n query_params[:'date_move'] = opts[:'date_move'] if !opts[:'date_move'].nil?\n query_params[:'free'] = opts[:'free'] if !opts[:'free'].nil?\n query_params[:'max'] = opts[:'max'] if !opts[:'max'].nil?\n query_params[:'last_size_update'] = opts[:'last_size_update'] if !opts[:'last_size_update'].nil?\n query_params[:'last_maintenance'] = opts[:'last_maintenance'] if !opts[:'last_maintenance'].nil?\n query_params[:'last_repack'] = opts[:'last_repack'] if !opts[:'last_repack'].nil?\n query_params[:'repack_status'] = opts[:'repack_status'] if !opts[:'repack_status'].nil?\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'force_import_type'] = opts[:'force_import_type'] if !opts[:'force_import_type'].nil?\n query_params[:'need_to_check'] = opts[:'need_to_check'] if !opts[:'need_to_check'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#index_tapes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @tccapis = Tccapi.all\n end",
"def index\n terminals = scope.page(page).per(per)\n json_response(PageDecorator.decorate(terminals), :ok)\n end",
"def index\n @deckfiles = Deckfile.all\n end",
"def index\n @trip_types = TripType.all\n end",
"def index_tape_stats(opts = {})\n data, _status_code, _headers = index_tape_stats_with_http_info(opts)\n data\n end",
"def list\n call(:get, path)\n end",
"def index\n respond_with ApidDriver.all\n end",
"def index\n @ducks = Duck.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tvs = Tv.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @padraos = Padrao.all\n add_breadcrumb \"index\", padraos_path, :title => \"Volta para o index\"\n end",
"def list(table)\n self.get(\"/#{table}\")\n end",
"def index\n @dte_directions = DteDirection.all\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index\n @typings = Typing.all\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end",
"def index\n @trucks = Truck.all\n end",
"def get_all_stations\n url = 'radio/station'\n options = {query: {'alt': 'json', 'tier': 'aa', 'hl': 'en_US'}}\n\n make_post_request(url, options)\n end",
"def index\n @storage_units = StorageUnit.all\n end",
"def index\n @tottles = Tottle.all\n end",
"def index\n @ftpfiles = Ftpfile.all\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end",
"def index\n @athletes = Athlete.paginate(page: params[:page], :per_page => 15)\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @ride_types = RideType.all\n end",
"def index\n @turkeys = Turkey.all\n end",
"def index\n @petrol_stations = PetrolStation.all\n end",
"def index\n @dropzones = Dropzone.all\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def index\n @controltltkts = Controltltkt.all\n end",
"def get_sas_logical_jbod_drives(client, name)\n item = get_sas_logical_jbod(client, name)\n response = client.rest_get(item['uri'] + '/drives')\n client.response_handler(response)\n end",
"def index\n @tariffs = Tariff.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @winddirs = Winddir.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @ways = Way.all\n end",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def index\n @storages = Mercadolibre::Storage.all.paginate(page: params[:page], per_page: 7)\n end",
"def index\n @ftp_servers = FtpServer.all\n end",
"def index\n @tollstations = Tollstation.all\n end",
"def index\n @antrag_typs = AntragTyp.all\n end",
"def index\n @vaults = Vault.all\n end",
"def index\n @tracs = Trac.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @trip_routes = TripRoute.all\n end",
"def index\n @storage_types = StorageType.all\n end",
"def index\n @directions = Direction.all\n end",
"def index\n @gadget_files = GadgetFile.all\n end",
"def index\n @trips = Trip.all\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def index\n @directories = Directory.all\n end",
"def index\n @pkhds = Pkhd.all\n end",
"def stops\n get '/gtfs/stops'\n end",
"def index\n @cartridge_transfers = CartridgeTransfer.all\n end",
"def tbu_list\n @client.make_request :get, templates_path('tbu')\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end"
] |
[
"0.7762862",
"0.60515314",
"0.5932642",
"0.5885706",
"0.5850183",
"0.5777759",
"0.5706362",
"0.55698645",
"0.55423415",
"0.5527133",
"0.5499193",
"0.549044",
"0.54562354",
"0.54384524",
"0.54235816",
"0.53935623",
"0.53863704",
"0.5376855",
"0.53569293",
"0.5346293",
"0.53373003",
"0.53342366",
"0.5330522",
"0.53282213",
"0.53279597",
"0.53053826",
"0.53017974",
"0.52882767",
"0.5284765",
"0.5276945",
"0.52751964",
"0.52742314",
"0.524094",
"0.5240742",
"0.5232578",
"0.52121645",
"0.5207107",
"0.5197358",
"0.5196443",
"0.5180758",
"0.516437",
"0.516437",
"0.516437",
"0.5157338",
"0.51362276",
"0.51362276",
"0.51338446",
"0.5131511",
"0.5126237",
"0.5111974",
"0.51068246",
"0.5095247",
"0.5092496",
"0.5083439",
"0.5082197",
"0.50811887",
"0.50791276",
"0.50684667",
"0.5059807",
"0.5057856",
"0.5052665",
"0.5048652",
"0.5048652",
"0.5044139",
"0.5041341",
"0.5036942",
"0.50365704",
"0.5036539",
"0.50350505",
"0.5031963",
"0.5028908",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5020764",
"0.50191",
"0.50191",
"0.5012762",
"0.5009255",
"0.5006498",
"0.50014573",
"0.50005704",
"0.49990526",
"0.49959606",
"0.49924594",
"0.49917048",
"0.49917048",
"0.49907494",
"0.49852175",
"0.498473",
"0.49843362",
"0.49754864",
"0.4972058",
"0.49717945",
"0.49686524",
"0.49569914",
"0.49507076",
"0.49497014",
"0.4948975"
] |
0.7145547
|
1
|
Lists all tape drives. API Key Scope: tape_drives / index
|
def index_tape_drives_by_tape_library(tape_library_id, opts = {})
data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @edrives = Edrive.all\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drive_devices(tape_library_id, job_id, opts = {})\n data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)\n data\n end",
"def index\n @tunings = Tuning.all\n end",
"def index\n @tapes = Tape.all\n end",
"def index\n @brake_types = BrakeType.all\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @tarots = Tarot.all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def index\n @tunes = Tune.all\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def index\n @ride_drivers = RideDriver.all\n end",
"def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end",
"def index\n @taps = Tap.all\n end",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def index\n @tcards = Tcard.all\n end",
"def all\n api_get(path)\n end",
"def index\n @direccionts = Direcciont.all\n end",
"def index\n\t\t\t\trespond_with Driver.all\n\t\t\tend",
"def index\n @trivia = Trivia.all\n end",
"def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # verify the required parameter 'job_id' is set\n if @api_client.config.client_side_validation && job_id.nil?\n fail ArgumentError, \"Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'job_id'] = job_id\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveDeviceCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drive_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @trivia = Trivium.all\n end",
"def index\n @recordingstations = Recordingstation.all\n end",
"def index_tapes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes ...'\n end\n # resource path\n local_var_path = '/tapes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil?\n query_params[:'scratch'] = opts[:'scratch'] if !opts[:'scratch'].nil?\n query_params[:'cleaning'] = opts[:'cleaning'] if !opts[:'cleaning'].nil?\n query_params[:'write_protect'] = opts[:'write_protect'] if !opts[:'write_protect'].nil?\n query_params[:'mounted'] = opts[:'mounted'] if !opts[:'mounted'].nil?\n query_params[:'ejected'] = opts[:'ejected'] if !opts[:'ejected'].nil?\n query_params[:'known'] = opts[:'known'] if !opts[:'known'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'date_in'] = opts[:'date_in'] if !opts[:'date_in'].nil?\n query_params[:'date_move'] = opts[:'date_move'] if !opts[:'date_move'].nil?\n query_params[:'free'] = opts[:'free'] if !opts[:'free'].nil?\n query_params[:'max'] = opts[:'max'] if !opts[:'max'].nil?\n query_params[:'last_size_update'] = opts[:'last_size_update'] if !opts[:'last_size_update'].nil?\n query_params[:'last_maintenance'] = opts[:'last_maintenance'] if !opts[:'last_maintenance'].nil?\n query_params[:'last_repack'] = opts[:'last_repack'] if !opts[:'last_repack'].nil?\n query_params[:'repack_status'] = opts[:'repack_status'] if !opts[:'repack_status'].nil?\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'force_import_type'] = opts[:'force_import_type'] if !opts[:'force_import_type'].nil?\n query_params[:'need_to_check'] = opts[:'need_to_check'] if !opts[:'need_to_check'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#index_tapes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @tccapis = Tccapi.all\n end",
"def index\n terminals = scope.page(page).per(per)\n json_response(PageDecorator.decorate(terminals), :ok)\n end",
"def index\n @deckfiles = Deckfile.all\n end",
"def index\n @trip_types = TripType.all\n end",
"def index_tape_stats(opts = {})\n data, _status_code, _headers = index_tape_stats_with_http_info(opts)\n data\n end",
"def list\n call(:get, path)\n end",
"def index\n respond_with ApidDriver.all\n end",
"def index\n @ducks = Duck.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tvs = Tv.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @padraos = Padrao.all\n add_breadcrumb \"index\", padraos_path, :title => \"Volta para o index\"\n end",
"def list(table)\n self.get(\"/#{table}\")\n end",
"def index\n @dte_directions = DteDirection.all\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index\n @typings = Typing.all\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end",
"def index\n @trucks = Truck.all\n end",
"def get_all_stations\n url = 'radio/station'\n options = {query: {'alt': 'json', 'tier': 'aa', 'hl': 'en_US'}}\n\n make_post_request(url, options)\n end",
"def index\n @storage_units = StorageUnit.all\n end",
"def index\n @tottles = Tottle.all\n end",
"def index\n @ftpfiles = Ftpfile.all\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end",
"def index\n @athletes = Athlete.paginate(page: params[:page], :per_page => 15)\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @ride_types = RideType.all\n end",
"def index\n @turkeys = Turkey.all\n end",
"def index\n @petrol_stations = PetrolStation.all\n end",
"def index\n @dropzones = Dropzone.all\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def index\n @controltltkts = Controltltkt.all\n end",
"def get_sas_logical_jbod_drives(client, name)\n item = get_sas_logical_jbod(client, name)\n response = client.rest_get(item['uri'] + '/drives')\n client.response_handler(response)\n end",
"def index\n @tariffs = Tariff.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @winddirs = Winddir.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @ways = Way.all\n end",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def index\n @storages = Mercadolibre::Storage.all.paginate(page: params[:page], per_page: 7)\n end",
"def index\n @ftp_servers = FtpServer.all\n end",
"def index\n @tollstations = Tollstation.all\n end",
"def index\n @antrag_typs = AntragTyp.all\n end",
"def index\n @vaults = Vault.all\n end",
"def index\n @tracs = Trac.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @trip_routes = TripRoute.all\n end",
"def index\n @storage_types = StorageType.all\n end",
"def index\n @directions = Direction.all\n end",
"def index\n @gadget_files = GadgetFile.all\n end",
"def index\n @trips = Trip.all\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def index\n @directories = Directory.all\n end",
"def index\n @pkhds = Pkhd.all\n end",
"def stops\n get '/gtfs/stops'\n end",
"def index\n @cartridge_transfers = CartridgeTransfer.all\n end",
"def tbu_list\n @client.make_request :get, templates_path('tbu')\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end"
] |
[
"0.7762862",
"0.7145547",
"0.60515314",
"0.5932642",
"0.5850183",
"0.5777759",
"0.5706362",
"0.55698645",
"0.55423415",
"0.5527133",
"0.5499193",
"0.549044",
"0.54562354",
"0.54384524",
"0.54235816",
"0.53935623",
"0.53863704",
"0.5376855",
"0.53569293",
"0.5346293",
"0.53373003",
"0.53342366",
"0.5330522",
"0.53282213",
"0.53279597",
"0.53053826",
"0.53017974",
"0.52882767",
"0.5284765",
"0.5276945",
"0.52751964",
"0.52742314",
"0.524094",
"0.5240742",
"0.5232578",
"0.52121645",
"0.5207107",
"0.5197358",
"0.5196443",
"0.5180758",
"0.516437",
"0.516437",
"0.516437",
"0.5157338",
"0.51362276",
"0.51362276",
"0.51338446",
"0.5131511",
"0.5126237",
"0.5111974",
"0.51068246",
"0.5095247",
"0.5092496",
"0.5083439",
"0.5082197",
"0.50811887",
"0.50791276",
"0.50684667",
"0.5059807",
"0.5057856",
"0.5052665",
"0.5048652",
"0.5048652",
"0.5044139",
"0.5041341",
"0.5036942",
"0.50365704",
"0.5036539",
"0.50350505",
"0.5031963",
"0.5028908",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5021726",
"0.5020764",
"0.50191",
"0.50191",
"0.5012762",
"0.5009255",
"0.5006498",
"0.50014573",
"0.50005704",
"0.49990526",
"0.49959606",
"0.49924594",
"0.49917048",
"0.49917048",
"0.49907494",
"0.49852175",
"0.498473",
"0.49843362",
"0.49754864",
"0.4972058",
"0.49717945",
"0.49686524",
"0.49569914",
"0.49507076",
"0.49497014",
"0.4948975"
] |
0.5885706
|
4
|
Lists all tape drives. API Key Scope: tape_drives / index
|
def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?
query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?
query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?
query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?
query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?
query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?
query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?
query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?
query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?
query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?
query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?
query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?
query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?
query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?
query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?
query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?
query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?
query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?
query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?
query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?
query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?
query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'TapeDriveCollection'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#index_tape_drives_by_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @edrives = Edrive.all\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def index_tape_drives_by_tape_library(tape_library_id, opts = {})\n data, _status_code, _headers = index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts)\n data\n end",
"def index_tape_drive_devices(tape_library_id, job_id, opts = {})\n data, _status_code, _headers = index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts)\n data\n end",
"def index\n @tunings = Tuning.all\n end",
"def index\n @tapes = Tape.all\n end",
"def index\n @brake_types = BrakeType.all\n end",
"def drives()\n return MicrosoftGraph::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @tarots = Tarot.all\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def list\n response = self.class.get('/droplets', headers: @header)\n tratar_response(response)\n end",
"def index\n @tunes = Tune.all\n end",
"def list\n client = get_dropbox_client\n unless client\n redirect_to(:action => 'auth_start') and return\n end\n @dropbox_docs = []\n path = \"/\"\n\n metadata = client.metadata(path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false)\n for dfile in metadata['contents']\n \tname = dfile['path']\n \t@dropbox_docs << name[1..-1]\n \tend\n \tgoogle_session = GoogleDrive.login_with_oauth(session[:google_token])\n \t@google_docs = []\n \tfor file in google_session.files\n \t\t@google_docs << file.title \n \tend\n #drivelist = get_dr.slice!(-)\n #render :inline => \"#{metadata['contents']} \\n\\n\\n\"\n #render json: metadata\n\n end",
"def index\n @terminal_devices = TerminalDevice.all\n end",
"def index\n @ride_drivers = RideDriver.all\n end",
"def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end",
"def index\n @taps = Tap.all\n end",
"def listar()\n @client.get(Route.new([ROTA_DID]))\n end",
"def index\n @tcards = Tcard.all\n end",
"def all\n api_get(path)\n end",
"def index\n @direccionts = Direcciont.all\n end",
"def index\n\t\t\t\trespond_with Driver.all\n\t\t\tend",
"def index\n @trivia = Trivia.all\n end",
"def index_tape_drive_devices_with_http_info(tape_library_id, job_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drive_devices ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # verify the required parameter 'job_id' is set\n if @api_client.config.client_side_validation && job_id.nil?\n fail ArgumentError, \"Missing the required parameter 'job_id' when calling TapeDrivesApi.index_tape_drive_devices\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/-/devices'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'job_id'] = job_id\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveDeviceCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drive_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @trivia = Trivium.all\n end",
"def index_tapes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes ...'\n end\n # resource path\n local_var_path = '/tapes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil?\n query_params[:'scratch'] = opts[:'scratch'] if !opts[:'scratch'].nil?\n query_params[:'cleaning'] = opts[:'cleaning'] if !opts[:'cleaning'].nil?\n query_params[:'write_protect'] = opts[:'write_protect'] if !opts[:'write_protect'].nil?\n query_params[:'mounted'] = opts[:'mounted'] if !opts[:'mounted'].nil?\n query_params[:'ejected'] = opts[:'ejected'] if !opts[:'ejected'].nil?\n query_params[:'known'] = opts[:'known'] if !opts[:'known'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'date_in'] = opts[:'date_in'] if !opts[:'date_in'].nil?\n query_params[:'date_move'] = opts[:'date_move'] if !opts[:'date_move'].nil?\n query_params[:'free'] = opts[:'free'] if !opts[:'free'].nil?\n query_params[:'max'] = opts[:'max'] if !opts[:'max'].nil?\n query_params[:'last_size_update'] = opts[:'last_size_update'] if !opts[:'last_size_update'].nil?\n query_params[:'last_maintenance'] = opts[:'last_maintenance'] if !opts[:'last_maintenance'].nil?\n query_params[:'last_repack'] = opts[:'last_repack'] if !opts[:'last_repack'].nil?\n query_params[:'repack_status'] = opts[:'repack_status'] if !opts[:'repack_status'].nil?\n query_params[:'hash'] = opts[:'hash'] if !opts[:'hash'].nil?\n query_params[:'force_import_type'] = opts[:'force_import_type'] if !opts[:'force_import_type'].nil?\n query_params[:'need_to_check'] = opts[:'need_to_check'] if !opts[:'need_to_check'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#index_tapes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @recordingstations = Recordingstation.all\n end",
"def index\n @tccapis = Tccapi.all\n end",
"def index\n terminals = scope.page(page).per(per)\n json_response(PageDecorator.decorate(terminals), :ok)\n end",
"def index\n @deckfiles = Deckfile.all\n end",
"def index\n @trip_types = TripType.all\n end",
"def index_tape_stats(opts = {})\n data, _status_code, _headers = index_tape_stats_with_http_info(opts)\n data\n end",
"def index\n respond_with ApidDriver.all\n end",
"def list\n call(:get, path)\n end",
"def index\n @ducks = Duck.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tyres = Tyre.all\n end",
"def index\n @tvs = Tv.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @volumes = Volume.all\n end",
"def index\n @padraos = Padrao.all\n add_breadcrumb \"index\", padraos_path, :title => \"Volta para o index\"\n end",
"def list(table)\n self.get(\"/#{table}\")\n end",
"def index\n @dte_directions = DteDirection.all\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index\n @typings = Typing.all\n end",
"def index\n @tacos = Taco.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render @tacos }\n end\n end",
"def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end",
"def index\n @trucks = Truck.all\n end",
"def get_all_stations\n url = 'radio/station'\n options = {query: {'alt': 'json', 'tier': 'aa', 'hl': 'en_US'}}\n\n make_post_request(url, options)\n end",
"def index\n @storage_units = StorageUnit.all\n end",
"def index\n @tottles = Tottle.all\n end",
"def index\n @ftpfiles = Ftpfile.all\n end",
"def index\n @tangazos = Tangazo.all\n end",
"def index\n @ducks = Duck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ducks }\n end\n end",
"def index\n @athletes = Athlete.paginate(page: params[:page], :per_page => 15)\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @terminals = Terminal.all\n end",
"def index\n @ride_types = RideType.all\n end",
"def index\n @turkeys = Turkey.all\n end",
"def index\n @petrol_stations = PetrolStation.all\n end",
"def index\n @dropzones = Dropzone.all\n end",
"def index\n @av_devices = AvDevice.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n end",
"def index\n @controltltkts = Controltltkt.all\n end",
"def get_sas_logical_jbod_drives(client, name)\n item = get_sas_logical_jbod(client, name)\n response = client.rest_get(item['uri'] + '/drives')\n client.response_handler(response)\n end",
"def index\n @tariffs = Tariff.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @transfers = Transfer.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @storages = Storage.all\n end",
"def index\n @winddirs = Winddir.all\n end",
"def index\n @ways = Way.all\n end",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def index\n @storages = Mercadolibre::Storage.all.paginate(page: params[:page], per_page: 7)\n end",
"def index\n @ftp_servers = FtpServer.all\n end",
"def index\n @tollstations = Tollstation.all\n end",
"def index\n @antrag_typs = AntragTyp.all\n end",
"def index\n @vaults = Vault.all\n end",
"def index\n @tracs = Trac.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @athletes = Athlete.all\n end",
"def index\n @trip_routes = TripRoute.all\n end",
"def index\n @storage_types = StorageType.all\n end",
"def index\n @directions = Direction.all\n end",
"def index\n @gadget_files = GadgetFile.all\n end",
"def index\n @trips = Trip.all\n end",
"def index\n @accediandevices = Accediandevice.all\n end",
"def index\n @directories = Directory.all\n end",
"def index\n @pkhds = Pkhd.all\n end",
"def stops\n get '/gtfs/stops'\n end",
"def index\n @cartridge_transfers = CartridgeTransfer.all\n end",
"def tbu_list\n @client.make_request :get, templates_path('tbu')\n end",
"def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end"
] |
[
"0.7762476",
"0.71456945",
"0.60501474",
"0.59340334",
"0.5885985",
"0.5777887",
"0.5707008",
"0.5572484",
"0.55423725",
"0.5525727",
"0.5499756",
"0.5492148",
"0.54561985",
"0.5439156",
"0.5421079",
"0.5392743",
"0.53853035",
"0.5376744",
"0.53562915",
"0.5347487",
"0.5336016",
"0.53355134",
"0.5329745",
"0.53280574",
"0.5326711",
"0.5303397",
"0.5299615",
"0.52887666",
"0.52857596",
"0.5277146",
"0.5275861",
"0.5275399",
"0.52402097",
"0.5239454",
"0.523138",
"0.5212584",
"0.5208047",
"0.5195279",
"0.5194182",
"0.51808643",
"0.51638174",
"0.51638174",
"0.51638174",
"0.5155955",
"0.51345634",
"0.51345634",
"0.51339376",
"0.51303554",
"0.51248175",
"0.51110286",
"0.5105791",
"0.50949144",
"0.50928617",
"0.50839305",
"0.5082741",
"0.5079708",
"0.50794977",
"0.5067312",
"0.50600094",
"0.50573033",
"0.50529075",
"0.5047943",
"0.5047943",
"0.5042926",
"0.50410956",
"0.50370085",
"0.503688",
"0.5034924",
"0.5034232",
"0.50309664",
"0.502919",
"0.50203145",
"0.50203145",
"0.50203145",
"0.50203145",
"0.5018178",
"0.5018178",
"0.5017843",
"0.50117457",
"0.5006973",
"0.5005734",
"0.50009614",
"0.50000864",
"0.4998722",
"0.499466",
"0.49923962",
"0.49921277",
"0.49921277",
"0.49914515",
"0.49839014",
"0.4983258",
"0.49832395",
"0.49769405",
"0.4971279",
"0.4969872",
"0.49678087",
"0.4956037",
"0.49500895",
"0.49490666",
"0.49478778"
] |
0.5851046
|
5
|
Displays a specific tape drive. API Key Scope: tape_drives / show
|
def show_tape_drive(tape_drive_id, opts = {})
data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def show\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_type }\n end\n end",
"def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end",
"def show\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drives }\n end\n end",
"def show\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vdisk }\n end\n end",
"def show\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @machine_drive_type }\n end\n end",
"def show\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @moto_drive_type }\n end\n end",
"def show\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lun_disk }\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\n end",
"def show\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beattape }\n end\n end",
"def show\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physical_disk }\n end\n end",
"def show\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @saved_tape }\n end\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def show\n @drive_fixed = DriveFixed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_fixed }\n end\n end",
"def show_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.show_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Tape' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#show_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end",
"def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mag_tape }\n end\n end",
"def show\n @breadcrumb = 'read'\n @tariff_type = TariffType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tariff_type }\n end\n end",
"def show\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @magnetic_finger_print }\n end\n end",
"def show\n @mounted_inventory = MountedInventory.find(params[:id])\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n course = Course.find(params[:course_id].to_s)\n authorize! :read, course\n\n dropbox = course.lead_teacher.dropbox\n\n meta = dropbox.shares(\"/#{ course.slug }/#{ params[:id] }\", false)\n url = meta[\"url\"].split('?').first\n url += '?dl=1'\n\n redirect_to url\n end",
"def show\n @drive = Drive.find(params[:id])\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show_disk(p,w,d)\r\n set_cursor p\r\n print \" \"*(@disks-w)\r\n print back_color(1+(w % 6)) # map disk widths to colors\r\n print \" \"*(w*2+1)\r\n print Normal\r\n update\r\n sleep d\r\n end",
"def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tbdotreport }\n end\n end",
"def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end",
"def show_tape_by_tape_library(tape_library_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts)\n data\n end",
"def show\n\t\t\t\trespond_with Driver.find(params[:id])\n\t\t\tend",
"def show\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_passcard }\n end\n end",
"def show\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scan_path }\n end\n end",
"def show\n @scanner = Scanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scanner }\n end\n end",
"def new\n @drive_system = DriveSystem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def drive_type; end",
"def show\n # Show one record\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trips.find_trip(params[ :id ] )\n end",
"def show\n @reef_tank = ReefTank.find(params[:id])\n @watchers = Watcher.all\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trip.find(params[:trip_id])\n end",
"def show\n @bluetooth = Bluetooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bluetooth }\n end\n end",
"def index\n @edrives = Edrive.all\n end",
"def show\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tv }\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def show\n @fundamental_treasure = Fundamental::Treasure.find(params[:id])\n raise NotFoundError.new('Treasure Not Found') if !@fundamental_treasure.is_poacher_treasure_of?(current_character) && api_request?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_treasure }\n end\n end",
"def show\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def show\n @treasure_treasure = Treasure::Treasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treasure_treasure }\n end\n end",
"def drive_type\n fetch('vehicle.drive_types')\n end",
"def show(path)\n output { get(path) }\n end",
"def show_tape_by_pool(pool_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_pool_with_http_info(pool_id, tape_id, opts)\n data\n end",
"def show(table, id)\n self.get(\"/#{table}/show/#{id}\")\n end",
"def show\n @device = Device.find(params[:id])\n end",
"def show\n @treq = Treq.find(params[:id])\n @treq_files = @treq.treq_files.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treq }\n end\n end",
"def show\n @tower = Tower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tower }\n end\n end",
"def set_tape\n @tape = Tape.find(params[:id])\n end",
"def show\n @control = @device.controls.find(params[:id])\n end",
"def show\n @self_drive_price = SelfDrivePrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @self_drive_price }\n end\n end",
"def show\n @volume_type = VolumeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type }\n end\n end",
"def show\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end",
"def show\n @runway_ap = RunwayAp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_ap }\n end\n end",
"def show\n @t = T.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n end",
"def show\n @admin_hotspot = Admin::Hotspot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_hotspot }\n end\n end",
"def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end",
"def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end",
"def show_parts(device)\n action_parts(device, '-s -av')\n end",
"def show\n @mountain = Mountain.find params[:id]\n end",
"def show\n #debugger\n @finger_print = FingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finger_print }\n end\n end",
"def show\n id = params.keys[1] # Query variable is the ID of the TV show that the user clicks on.\n\n #template = Addressable::Template.new('https://api.themoviedb.org/3/tv/{?query*}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US')\n #url = template.expand({\"query\" => id})\n #response = HTTParty.get(url)\n\n url = Addressable::URI.parse(\"https://api.themoviedb.org/3/tv/#{id}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US\")\n response = HTTParty.get(url)\n\n @show = JSON.parse(response.body, symbolize_names: true) \n end",
"def show\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taf }\n end\n end",
"def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end",
"def show\n @trek = Trek.find(params[:id])\n @title = \"#{@trek.title} route\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trek }\n end\n end",
"def show\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdoc }\n end\n end",
"def show\n @driver_record = DriverRecord.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end",
"def show_tsd_super_table\n @data_list = DataList.find(params[:id])\n @all_tsd_files = JSON.parse(open(\"http://readtsd.herokuapp.com/listnames/json\").read)[\"file_list\"]\n @tsd_file = params[:tsd_file].nil? ? @all_tsd_files[0] : params[:tsd_file]\n render \"tsd_super_tableview\"\n end",
"def show\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gtfs_trip }\n end\n end",
"def show\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tetramod }\n end\n end",
"def show\n @timecard = Timecard.find(params[:id])\n end",
"def drive_type\n return @drive_type\n end",
"def drive_type\n return @drive_type\n end",
"def show\n @trivia = Trivia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @trivia }\n end\n end",
"def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"def show\n @track = @disc.tracks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @track }\n end\n end",
"def show\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tablet }\n end\n end",
"def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end",
"def show\n @breadcrumb = [{\n name: @erd.nm,\n active: true\n }]\n @temps = Temp.find_for_output(@project.id, KbnConstants::TEMP_KBN_TABLE)\n end",
"def show\n @showdown = Showdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @showdown }\n end\n end",
"def show\n\t\tsend_file(params[:path])\n end"
] |
[
"0.70864695",
"0.6920458",
"0.6709053",
"0.66499174",
"0.6584074",
"0.6512679",
"0.65099937",
"0.64887613",
"0.6330771",
"0.6254817",
"0.6240488",
"0.6100785",
"0.6093227",
"0.6079777",
"0.6067794",
"0.60480344",
"0.6000982",
"0.59681743",
"0.5950255",
"0.59392977",
"0.5853559",
"0.5847474",
"0.57950974",
"0.56943834",
"0.5693207",
"0.5648151",
"0.564016",
"0.5622062",
"0.561396",
"0.5596861",
"0.5591874",
"0.5584224",
"0.5579539",
"0.5557669",
"0.5540941",
"0.5520947",
"0.5519808",
"0.5486089",
"0.5461562",
"0.5458028",
"0.5449367",
"0.5431408",
"0.54125416",
"0.5396835",
"0.5381217",
"0.53755",
"0.5371698",
"0.536506",
"0.53631926",
"0.53631926",
"0.53630996",
"0.5357674",
"0.53517264",
"0.53458804",
"0.534222",
"0.5338965",
"0.5336756",
"0.53354734",
"0.5323446",
"0.5313321",
"0.5312909",
"0.5302933",
"0.5298151",
"0.5290971",
"0.52900165",
"0.5284338",
"0.52796906",
"0.52641875",
"0.5258196",
"0.5256689",
"0.5254787",
"0.5249009",
"0.5231989",
"0.52297425",
"0.52231294",
"0.5221946",
"0.5216929",
"0.5204363",
"0.52031285",
"0.52031124",
"0.51985544",
"0.5196288",
"0.5194592",
"0.51916915",
"0.5191668",
"0.5189607",
"0.518915",
"0.5183025",
"0.5181952",
"0.51817614",
"0.51800144",
"0.51800144",
"0.5177429",
"0.5175023",
"0.5171764",
"0.51700383",
"0.5168589",
"0.5165331",
"0.5165047",
"0.5157953"
] |
0.7678166
|
0
|
Displays a specific tape drive. API Key Scope: tape_drives / show
|
def show_tape_drive_with_http_info(tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive"
end
# resource path
local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'TapeDrive'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#show_tape_drive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def show\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def show\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_type }\n end\n end",
"def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end",
"def show\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drives }\n end\n end",
"def show\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vdisk }\n end\n end",
"def show\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @machine_drive_type }\n end\n end",
"def show\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @moto_drive_type }\n end\n end",
"def show\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lun_disk }\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\n end",
"def show\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beattape }\n end\n end",
"def show\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physical_disk }\n end\n end",
"def show\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @saved_tape }\n end\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def show\n @drive_fixed = DriveFixed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_fixed }\n end\n end",
"def show_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.show_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Tape' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#show_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end",
"def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mag_tape }\n end\n end",
"def show\n @breadcrumb = 'read'\n @tariff_type = TariffType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tariff_type }\n end\n end",
"def show\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @magnetic_finger_print }\n end\n end",
"def show\n @mounted_inventory = MountedInventory.find(params[:id])\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n course = Course.find(params[:course_id].to_s)\n authorize! :read, course\n\n dropbox = course.lead_teacher.dropbox\n\n meta = dropbox.shares(\"/#{ course.slug }/#{ params[:id] }\", false)\n url = meta[\"url\"].split('?').first\n url += '?dl=1'\n\n redirect_to url\n end",
"def show\n @drive = Drive.find(params[:id])\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show_disk(p,w,d)\r\n set_cursor p\r\n print \" \"*(@disks-w)\r\n print back_color(1+(w % 6)) # map disk widths to colors\r\n print \" \"*(w*2+1)\r\n print Normal\r\n update\r\n sleep d\r\n end",
"def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tbdotreport }\n end\n end",
"def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end",
"def show_tape_by_tape_library(tape_library_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts)\n data\n end",
"def show\n\t\t\t\trespond_with Driver.find(params[:id])\n\t\t\tend",
"def show\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_passcard }\n end\n end",
"def show\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scan_path }\n end\n end",
"def show\n @scanner = Scanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scanner }\n end\n end",
"def new\n @drive_system = DriveSystem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def drive_type; end",
"def show\n # Show one record\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trips.find_trip(params[ :id ] )\n end",
"def show\n @reef_tank = ReefTank.find(params[:id])\n @watchers = Watcher.all\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trip.find(params[:trip_id])\n end",
"def show\n @bluetooth = Bluetooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bluetooth }\n end\n end",
"def index\n @edrives = Edrive.all\n end",
"def show\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tv }\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def show\n @fundamental_treasure = Fundamental::Treasure.find(params[:id])\n raise NotFoundError.new('Treasure Not Found') if !@fundamental_treasure.is_poacher_treasure_of?(current_character) && api_request?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_treasure }\n end\n end",
"def show\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def show\n @treasure_treasure = Treasure::Treasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treasure_treasure }\n end\n end",
"def drive_type\n fetch('vehicle.drive_types')\n end",
"def show(path)\n output { get(path) }\n end",
"def show_tape_by_pool(pool_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_pool_with_http_info(pool_id, tape_id, opts)\n data\n end",
"def show(table, id)\n self.get(\"/#{table}/show/#{id}\")\n end",
"def show\n @device = Device.find(params[:id])\n end",
"def show\n @treq = Treq.find(params[:id])\n @treq_files = @treq.treq_files.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treq }\n end\n end",
"def show\n @tower = Tower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tower }\n end\n end",
"def set_tape\n @tape = Tape.find(params[:id])\n end",
"def show\n @control = @device.controls.find(params[:id])\n end",
"def show\n @self_drive_price = SelfDrivePrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @self_drive_price }\n end\n end",
"def show\n @volume_type = VolumeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type }\n end\n end",
"def show\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end",
"def show\n @runway_ap = RunwayAp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_ap }\n end\n end",
"def show\n @t = T.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n end",
"def show\n @admin_hotspot = Admin::Hotspot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_hotspot }\n end\n end",
"def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end",
"def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end",
"def show_parts(device)\n action_parts(device, '-s -av')\n end",
"def show\n @mountain = Mountain.find params[:id]\n end",
"def show\n #debugger\n @finger_print = FingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finger_print }\n end\n end",
"def show\n id = params.keys[1] # Query variable is the ID of the TV show that the user clicks on.\n\n #template = Addressable::Template.new('https://api.themoviedb.org/3/tv/{?query*}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US')\n #url = template.expand({\"query\" => id})\n #response = HTTParty.get(url)\n\n url = Addressable::URI.parse(\"https://api.themoviedb.org/3/tv/#{id}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US\")\n response = HTTParty.get(url)\n\n @show = JSON.parse(response.body, symbolize_names: true) \n end",
"def show\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taf }\n end\n end",
"def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end",
"def show\n @trek = Trek.find(params[:id])\n @title = \"#{@trek.title} route\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trek }\n end\n end",
"def show\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdoc }\n end\n end",
"def show\n @driver_record = DriverRecord.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end",
"def show_tsd_super_table\n @data_list = DataList.find(params[:id])\n @all_tsd_files = JSON.parse(open(\"http://readtsd.herokuapp.com/listnames/json\").read)[\"file_list\"]\n @tsd_file = params[:tsd_file].nil? ? @all_tsd_files[0] : params[:tsd_file]\n render \"tsd_super_tableview\"\n end",
"def show\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gtfs_trip }\n end\n end",
"def show\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tetramod }\n end\n end",
"def show\n @timecard = Timecard.find(params[:id])\n end",
"def drive_type\n return @drive_type\n end",
"def drive_type\n return @drive_type\n end",
"def show\n @trivia = Trivia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @trivia }\n end\n end",
"def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"def show\n @track = @disc.tracks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @track }\n end\n end",
"def show\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tablet }\n end\n end",
"def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end",
"def show\n @breadcrumb = [{\n name: @erd.nm,\n active: true\n }]\n @temps = Temp.find_for_output(@project.id, KbnConstants::TEMP_KBN_TABLE)\n end",
"def show\n @showdown = Showdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @showdown }\n end\n end",
"def show\n\t\tsend_file(params[:path])\n end"
] |
[
"0.7678166",
"0.6920458",
"0.6709053",
"0.66499174",
"0.6584074",
"0.6512679",
"0.65099937",
"0.64887613",
"0.6330771",
"0.6254817",
"0.6240488",
"0.6100785",
"0.6093227",
"0.6079777",
"0.6067794",
"0.60480344",
"0.6000982",
"0.59681743",
"0.5950255",
"0.59392977",
"0.5853559",
"0.5847474",
"0.57950974",
"0.56943834",
"0.5693207",
"0.5648151",
"0.564016",
"0.5622062",
"0.561396",
"0.5596861",
"0.5591874",
"0.5584224",
"0.5579539",
"0.5557669",
"0.5540941",
"0.5520947",
"0.5519808",
"0.5486089",
"0.5461562",
"0.5458028",
"0.5449367",
"0.5431408",
"0.54125416",
"0.5396835",
"0.5381217",
"0.53755",
"0.5371698",
"0.536506",
"0.53631926",
"0.53631926",
"0.53630996",
"0.5357674",
"0.53517264",
"0.53458804",
"0.534222",
"0.5338965",
"0.5336756",
"0.53354734",
"0.5323446",
"0.5313321",
"0.5312909",
"0.5302933",
"0.5298151",
"0.5290971",
"0.52900165",
"0.5284338",
"0.52796906",
"0.52641875",
"0.5258196",
"0.5256689",
"0.5254787",
"0.5249009",
"0.5231989",
"0.52297425",
"0.52231294",
"0.5221946",
"0.5216929",
"0.5204363",
"0.52031285",
"0.52031124",
"0.51985544",
"0.5196288",
"0.5194592",
"0.51916915",
"0.5191668",
"0.5189607",
"0.518915",
"0.5183025",
"0.5181952",
"0.51817614",
"0.51800144",
"0.51800144",
"0.5177429",
"0.5175023",
"0.5171764",
"0.51700383",
"0.5168589",
"0.5165331",
"0.5165047",
"0.5157953"
] |
0.70864695
|
1
|
Displays a specific tape drive. API Key Scope: tape_drives / show
|
def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})
data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_type }\n end\n end",
"def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end",
"def show\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drives }\n end\n end",
"def show\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vdisk }\n end\n end",
"def show\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @machine_drive_type }\n end\n end",
"def show\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @moto_drive_type }\n end\n end",
"def show\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lun_disk }\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\n end",
"def show\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beattape }\n end\n end",
"def show\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physical_disk }\n end\n end",
"def show\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @saved_tape }\n end\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def show\n @drive_fixed = DriveFixed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_fixed }\n end\n end",
"def show_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.show_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Tape' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#show_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end",
"def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mag_tape }\n end\n end",
"def show\n @breadcrumb = 'read'\n @tariff_type = TariffType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tariff_type }\n end\n end",
"def show\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @magnetic_finger_print }\n end\n end",
"def show\n @mounted_inventory = MountedInventory.find(params[:id])\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n course = Course.find(params[:course_id].to_s)\n authorize! :read, course\n\n dropbox = course.lead_teacher.dropbox\n\n meta = dropbox.shares(\"/#{ course.slug }/#{ params[:id] }\", false)\n url = meta[\"url\"].split('?').first\n url += '?dl=1'\n\n redirect_to url\n end",
"def show\n @drive = Drive.find(params[:id])\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show_disk(p,w,d)\r\n set_cursor p\r\n print \" \"*(@disks-w)\r\n print back_color(1+(w % 6)) # map disk widths to colors\r\n print \" \"*(w*2+1)\r\n print Normal\r\n update\r\n sleep d\r\n end",
"def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tbdotreport }\n end\n end",
"def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end",
"def show_tape_by_tape_library(tape_library_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts)\n data\n end",
"def show\n\t\t\t\trespond_with Driver.find(params[:id])\n\t\t\tend",
"def show\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_passcard }\n end\n end",
"def show\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scan_path }\n end\n end",
"def show\n @scanner = Scanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scanner }\n end\n end",
"def new\n @drive_system = DriveSystem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def drive_type; end",
"def show\n # Show one record\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trips.find_trip(params[ :id ] )\n end",
"def show\n @reef_tank = ReefTank.find(params[:id])\n @watchers = Watcher.all\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trip.find(params[:trip_id])\n end",
"def show\n @bluetooth = Bluetooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bluetooth }\n end\n end",
"def index\n @edrives = Edrive.all\n end",
"def show\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tv }\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def show\n @fundamental_treasure = Fundamental::Treasure.find(params[:id])\n raise NotFoundError.new('Treasure Not Found') if !@fundamental_treasure.is_poacher_treasure_of?(current_character) && api_request?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_treasure }\n end\n end",
"def show\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def show\n @treasure_treasure = Treasure::Treasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treasure_treasure }\n end\n end",
"def drive_type\n fetch('vehicle.drive_types')\n end",
"def show(path)\n output { get(path) }\n end",
"def show_tape_by_pool(pool_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_pool_with_http_info(pool_id, tape_id, opts)\n data\n end",
"def show(table, id)\n self.get(\"/#{table}/show/#{id}\")\n end",
"def show\n @device = Device.find(params[:id])\n end",
"def show\n @treq = Treq.find(params[:id])\n @treq_files = @treq.treq_files.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treq }\n end\n end",
"def show\n @tower = Tower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tower }\n end\n end",
"def set_tape\n @tape = Tape.find(params[:id])\n end",
"def show\n @control = @device.controls.find(params[:id])\n end",
"def show\n @self_drive_price = SelfDrivePrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @self_drive_price }\n end\n end",
"def show\n @volume_type = VolumeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type }\n end\n end",
"def show\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end",
"def show\n @runway_ap = RunwayAp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_ap }\n end\n end",
"def show\n @t = T.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n end",
"def show\n @admin_hotspot = Admin::Hotspot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_hotspot }\n end\n end",
"def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end",
"def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end",
"def show_parts(device)\n action_parts(device, '-s -av')\n end",
"def show\n @mountain = Mountain.find params[:id]\n end",
"def show\n #debugger\n @finger_print = FingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finger_print }\n end\n end",
"def show\n id = params.keys[1] # Query variable is the ID of the TV show that the user clicks on.\n\n #template = Addressable::Template.new('https://api.themoviedb.org/3/tv/{?query*}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US')\n #url = template.expand({\"query\" => id})\n #response = HTTParty.get(url)\n\n url = Addressable::URI.parse(\"https://api.themoviedb.org/3/tv/#{id}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US\")\n response = HTTParty.get(url)\n\n @show = JSON.parse(response.body, symbolize_names: true) \n end",
"def show\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taf }\n end\n end",
"def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end",
"def show\n @trek = Trek.find(params[:id])\n @title = \"#{@trek.title} route\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trek }\n end\n end",
"def show\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdoc }\n end\n end",
"def show\n @driver_record = DriverRecord.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end",
"def show_tsd_super_table\n @data_list = DataList.find(params[:id])\n @all_tsd_files = JSON.parse(open(\"http://readtsd.herokuapp.com/listnames/json\").read)[\"file_list\"]\n @tsd_file = params[:tsd_file].nil? ? @all_tsd_files[0] : params[:tsd_file]\n render \"tsd_super_tableview\"\n end",
"def show\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gtfs_trip }\n end\n end",
"def show\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tetramod }\n end\n end",
"def show\n @timecard = Timecard.find(params[:id])\n end",
"def drive_type\n return @drive_type\n end",
"def drive_type\n return @drive_type\n end",
"def show\n @trivia = Trivia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @trivia }\n end\n end",
"def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"def show\n @track = @disc.tracks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @track }\n end\n end",
"def show\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tablet }\n end\n end",
"def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end",
"def show\n @breadcrumb = [{\n name: @erd.nm,\n active: true\n }]\n @temps = Temp.find_for_output(@project.id, KbnConstants::TEMP_KBN_TABLE)\n end",
"def show\n @showdown = Showdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @showdown }\n end\n end",
"def show\n\t\tsend_file(params[:path])\n end"
] |
[
"0.7678166",
"0.70864695",
"0.6920458",
"0.6709053",
"0.6584074",
"0.6512679",
"0.65099937",
"0.64887613",
"0.6330771",
"0.6254817",
"0.6240488",
"0.6100785",
"0.6093227",
"0.6079777",
"0.6067794",
"0.60480344",
"0.6000982",
"0.59681743",
"0.5950255",
"0.59392977",
"0.5853559",
"0.5847474",
"0.57950974",
"0.56943834",
"0.5693207",
"0.5648151",
"0.564016",
"0.5622062",
"0.561396",
"0.5596861",
"0.5591874",
"0.5584224",
"0.5579539",
"0.5557669",
"0.5540941",
"0.5520947",
"0.5519808",
"0.5486089",
"0.5461562",
"0.5458028",
"0.5449367",
"0.5431408",
"0.54125416",
"0.5396835",
"0.5381217",
"0.53755",
"0.5371698",
"0.536506",
"0.53631926",
"0.53631926",
"0.53630996",
"0.5357674",
"0.53517264",
"0.53458804",
"0.534222",
"0.5338965",
"0.5336756",
"0.53354734",
"0.5323446",
"0.5313321",
"0.5312909",
"0.5302933",
"0.5298151",
"0.5290971",
"0.52900165",
"0.5284338",
"0.52796906",
"0.52641875",
"0.5258196",
"0.5256689",
"0.5254787",
"0.5249009",
"0.5231989",
"0.52297425",
"0.52231294",
"0.5221946",
"0.5216929",
"0.5204363",
"0.52031285",
"0.52031124",
"0.51985544",
"0.5196288",
"0.5194592",
"0.51916915",
"0.5191668",
"0.5189607",
"0.518915",
"0.5183025",
"0.5181952",
"0.51817614",
"0.51800144",
"0.51800144",
"0.5177429",
"0.5175023",
"0.5171764",
"0.51700383",
"0.5168589",
"0.5165331",
"0.5165047",
"0.5157953"
] |
0.66499174
|
4
|
Displays a specific tape drive. API Key Scope: tape_drives / show
|
def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library"
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'TapeDrive'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#show_tape_drive_by_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show_tape_drive_by_tape_library(tape_library_id, tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts)\n data\n end",
"def show\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_type }\n end\n end",
"def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end",
"def show\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drives }\n end\n end",
"def show\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vdisk }\n end\n end",
"def show\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @machine_drive_type }\n end\n end",
"def show\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @moto_drive_type }\n end\n end",
"def show\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lun_disk }\n end\n end",
"def index_tape_drives(opts = {})\n data, _status_code, _headers = index_tape_drives_with_http_info(opts)\n data\n end",
"def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\n end",
"def show\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beattape }\n end\n end",
"def show\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physical_disk }\n end\n end",
"def show\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @saved_tape }\n end\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def show\n @drive_fixed = DriveFixed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @drive_fixed }\n end\n end",
"def show_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_id' when calling TapesApi.show_tape\"\n end\n # resource path\n local_var_path = '/tapes/{tape_id}'.sub('{' + 'tape_id' + '}', CGI.escape(tape_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Tape' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#show_tape\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def drive(opts = { })\n\t\t\t@conn.send(\"DRIVE #{opts.to_usar}\")\n\t\tend",
"def index_tape_drives_by_tape_library_with_http_info(tape_library_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.index_tape_drives_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end",
"def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mag_tape }\n end\n end",
"def show\n @breadcrumb = 'read'\n @tariff_type = TariffType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tariff_type }\n end\n end",
"def show\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @magnetic_finger_print }\n end\n end",
"def show\n @mounted_inventory = MountedInventory.find(params[:id])\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n course = Course.find(params[:course_id].to_s)\n authorize! :read, course\n\n dropbox = course.lead_teacher.dropbox\n\n meta = dropbox.shares(\"/#{ course.slug }/#{ params[:id] }\", false)\n url = meta[\"url\"].split('?').first\n url += '?dl=1'\n\n redirect_to url\n end",
"def show\n @drive = Drive.find(params[:id])\n @drivesuppliers = Supplier.joins(:suppliertypes).includes(:suppliertypes).where(:suppliertypes => {:name => 'FU'})\n end",
"def show\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dvd }\n end\n end",
"def show_disk(p,w,d)\r\n set_cursor p\r\n print \" \"*(@disks-w)\r\n print back_color(1+(w % 6)) # map disk widths to colors\r\n print \" \"*(w*2+1)\r\n print Normal\r\n update\r\n sleep d\r\n end",
"def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end",
"def drive()\n @adapter.drive\n end",
"def show\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tbdotreport }\n end\n end",
"def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end",
"def show_tape_by_tape_library(tape_library_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts)\n data\n end",
"def show\n\t\t\t\trespond_with Driver.find(params[:id])\n\t\t\tend",
"def show\n @vehicle_passcard = VehiclePasscard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_passcard }\n end\n end",
"def show\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scan_path }\n end\n end",
"def show\n @scanner = Scanner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scanner }\n end\n end",
"def new\n @drive_system = DriveSystem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drive_system }\n end\n end",
"def drive_type; end",
"def show\n # Show one record\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @trip = Trips.find_trip(params[ :id ] )\n end",
"def show\n @reef_tank = ReefTank.find(params[:id])\n @watchers = Watcher.all\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reef_tank }\n end\n end",
"def show\n @trip = Trip.find(params[:trip_id])\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @bluetooth = Bluetooth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bluetooth }\n end\n end",
"def index\n @edrives = Edrive.all\n end",
"def show\n @tv = Tv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tv }\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def show\n @fundamental_treasure = Fundamental::Treasure.find(params[:id])\n raise NotFoundError.new('Treasure Not Found') if !@fundamental_treasure.is_poacher_treasure_of?(current_character) && api_request?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_treasure }\n end\n end",
"def show\n @admissive_volume = AdmissiveVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admissive_volume }\n end\n end",
"def show\n @treasure_treasure = Treasure::Treasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treasure_treasure }\n end\n end",
"def drive_type\n fetch('vehicle.drive_types')\n end",
"def show_tape_by_pool(pool_id, tape_id, opts = {})\n data, _status_code, _headers = show_tape_by_pool_with_http_info(pool_id, tape_id, opts)\n data\n end",
"def show(path)\n output { get(path) }\n end",
"def show(table, id)\n self.get(\"/#{table}/show/#{id}\")\n end",
"def show\n @device = Device.find(params[:id])\n end",
"def show\n @treq = Treq.find(params[:id])\n @treq_files = @treq.treq_files.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @treq }\n end\n end",
"def show\n @tower = Tower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tower }\n end\n end",
"def set_tape\n @tape = Tape.find(params[:id])\n end",
"def show\n @control = @device.controls.find(params[:id])\n end",
"def show\n @self_drive_price = SelfDrivePrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @self_drive_price }\n end\n end",
"def show\n @volume_type = VolumeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type }\n end\n end",
"def show\n @fleet = Fleet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end",
"def show\n @runway_ap = RunwayAp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runway_ap }\n end\n end",
"def show\n @t = T.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @t }\n end\n end",
"def show\n @vehicle = Vehicle.find(params[:id])\n\n end",
"def show\n @admin_hotspot = Admin::Hotspot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_hotspot }\n end\n end",
"def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end",
"def show\n @tier = Tier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tier }\n end\n end",
"def show_parts(device)\n action_parts(device, '-s -av')\n end",
"def show\n @mountain = Mountain.find params[:id]\n end",
"def show\n #debugger\n @finger_print = FingerPrint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finger_print }\n end\n end",
"def show\n id = params.keys[1] # Query variable is the ID of the TV show that the user clicks on.\n\n #template = Addressable::Template.new('https://api.themoviedb.org/3/tv/{?query*}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US')\n #url = template.expand({\"query\" => id})\n #response = HTTParty.get(url)\n\n url = Addressable::URI.parse(\"https://api.themoviedb.org/3/tv/#{id}?api_key=fb6a1d3f38c3d97f67df6d141f936f29&language=en-US\")\n response = HTTParty.get(url)\n\n @show = JSON.parse(response.body, symbolize_names: true) \n end",
"def show\n @taf = Taf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taf }\n end\n end",
"def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end",
"def show\n @trek = Trek.find(params[:id])\n @title = \"#{@trek.title} route\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trek }\n end\n end",
"def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end",
"def show\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdoc }\n end\n end",
"def show\n @driver_record = DriverRecord.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def show_tsd_super_table\n @data_list = DataList.find(params[:id])\n @all_tsd_files = JSON.parse(open(\"http://readtsd.herokuapp.com/listnames/json\").read)[\"file_list\"]\n @tsd_file = params[:tsd_file].nil? ? @all_tsd_files[0] : params[:tsd_file]\n render \"tsd_super_tableview\"\n end",
"def show\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gtfs_trip }\n end\n end",
"def show\n @tetramod = Tetramod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tetramod }\n end\n end",
"def show\n @timecard = Timecard.find(params[:id])\n end",
"def drive_type\n return @drive_type\n end",
"def drive_type\n return @drive_type\n end",
"def show\n @trivia = Trivia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @trivia }\n end\n end",
"def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"def show\n @track = @disc.tracks.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @track }\n end\n end",
"def show\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tablet }\n end\n end",
"def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end",
"def show\n @showdown = Showdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @showdown }\n end\n end",
"def show\n @breadcrumb = [{\n name: @erd.nm,\n active: true\n }]\n @temps = Temp.find_for_output(@project.id, KbnConstants::TEMP_KBN_TABLE)\n end",
"def show\n\t\tsend_file(params[:path])\n end"
] |
[
"0.76793593",
"0.7086589",
"0.69190085",
"0.6709828",
"0.665119",
"0.65825516",
"0.65147865",
"0.6508479",
"0.64867175",
"0.632948",
"0.62534374",
"0.6239177",
"0.60953325",
"0.6079717",
"0.6068268",
"0.60479236",
"0.59989864",
"0.59687644",
"0.5948683",
"0.5937316",
"0.5854194",
"0.5847017",
"0.5795495",
"0.5694725",
"0.569358",
"0.56476355",
"0.5639267",
"0.56213915",
"0.56122136",
"0.55968314",
"0.55906326",
"0.55828196",
"0.55778384",
"0.5555991",
"0.55397767",
"0.55217403",
"0.5519532",
"0.5485037",
"0.5463384",
"0.54570764",
"0.544798",
"0.543088",
"0.5411723",
"0.5395458",
"0.53809917",
"0.53740364",
"0.5372002",
"0.53650653",
"0.53636223",
"0.53617007",
"0.53617007",
"0.53565705",
"0.5350874",
"0.5345564",
"0.53407097",
"0.5337425",
"0.53350675",
"0.53344816",
"0.5323423",
"0.53147036",
"0.53129",
"0.5301806",
"0.5296663",
"0.5290681",
"0.52898395",
"0.5286113",
"0.5277845",
"0.5262227",
"0.525696",
"0.52563065",
"0.5254342",
"0.524973",
"0.52308476",
"0.52286506",
"0.5222878",
"0.52214336",
"0.521726",
"0.52025336",
"0.5202491",
"0.5202179",
"0.5198409",
"0.51951915",
"0.51942223",
"0.5191907",
"0.51909995",
"0.5190041",
"0.5187923",
"0.5183289",
"0.51819575",
"0.51811564",
"0.5180161",
"0.5180161",
"0.5176885",
"0.51745725",
"0.5170421",
"0.517032",
"0.51681507",
"0.516354",
"0.5163459",
"0.5157473"
] |
0.6100737
|
12
|
Updates a specific tape drive. API Key Scope: tape_drives / update
|
def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})
data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @drive = @object\n\n respond_to do |format|\n if @drive.update_attributes(params[:drive])\n flash[:notice] = 'Drive was successfully updated.'\n format.html { redirect_to drive_url(@drive) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tape_drive_by_tape_library(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n if @drive_type.update_attributes(params[:drive_type])\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @drive = Drive.find(params[:id])\n if @drive.update(drive_params)\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich aktualisiert.'\n else\n render 'edit'\n end\n end",
"def update\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n if @drive_system.update_attributes(params[:drive_system])\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n if @drives.update_attributes(params[:drives])\n flash[:notice] = 'Drives was successfully updated.'\n format.html { redirect_to(@drives) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_id = args[:drive_id] if args.key?(:drive_id)\n end",
"def update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_with ApidDrive.update(params[:id], params[:apid_driver])\n rescue ActiveRecord::RecordNotFound\n respond_with ApidDrive::StateChangeError\n end",
"def update\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n if @trip_driver.update_attributes(trip_driver_params)\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n if @tape_type.update_attributes(params[:tape_type])\n flash[:notice] = 'TapeType was successfully updated.'\n format.html { redirect_to tape_types_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @file_comment = args[:file_comment] if args.key?(:file_comment)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n if @moto_drive_type.update_attributes(params[:moto_drive_type])\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n if @beattape.update_attributes(params[:beattape])\n format.html { redirect_to @beattape, notice: 'Beattape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n if @machine_drive_type.update_attributes(params[:machine_drive_type])\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tape = Tape.find(params[:id])\n\n respond_to do |format|\n if @tape.update_attributes(params[:tape])\n flash[:notice] = 'Tape was successfully updated.'\n format.html { redirect_to(@tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def update\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n if @saved_tape.update_attributes(params[:saved_tape])\n flash[:notice] = 'SavedTape was successfully updated.'\n format.html { redirect_to(@saved_tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saved_tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tape.update(tape_params)\n format.html { redirect_to @tape, notice: 'Tape was successfully updated.' }\n format.json { render :show, status: :ok, location: @tape }\n else\n format.html { render :edit }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def update\n save_file\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n if @vdisk.update_attributes(params[:vdisk])\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n trip = Trip.find(params[:id])\n if trip.update(trip_params)\n redirect_to trip_path\n else\n render :edit, status: :bad_request\n end\n end",
"def update\n respond_to do |format|\n if @driver_trip_seat.update(driver_trip_seat_params)\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver_trip_seat }\n else\n format.html { render :edit }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tune = Tune.find(params[:id])\n\n respond_to do |format|\n if @tune.update_attributes(params[:tune])\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ride_driver.update(ride_driver_params)\n format.html { redirect_to @ride_driver, notice: 'Ride driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ride_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n if @templete.update_attributes(params[:templete])\n format.html { redirect_to @templete, :notice => 'Templete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def update\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n if @mag_tape.update_attributes(params[:mag_tape])\n format.html { redirect_to @mag_tape, notice: 'Mag tape was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find_by(id: params[:id])\n if @trip.nil?\n head :not_found\n return\n elsif @trip.update(trip_params)\n redirect_to trip_path\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @share_mode = args[:share_mode] if args.key?(:share_mode)\n end",
"def update\n respond_to do |format|\n if @tune.update(tune_params)\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content } \n else\n format.html { render action: 'edit' }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource @ride, ride_params\n end",
"def update\n respond_to do |format|\n if @tuning.update(tuning_params)\n format.html { redirect_to @tuning, notice: 'Tuning was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuning }\n else\n format.html { render :edit }\n format.json { render json: @tuning.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n if @lun_disk.update_attributes(params[:lun_disk])\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n if @etape.update_attributes(params[:etape])\n format.html { redirect_to @etape, notice: 'Etape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n if @tbdotreport.update_attributes(params[:tbdotreport])\n format.html { redirect_to @tbdotreport, notice: 'Tbdotreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tbdotreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_admin_user\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n if @scan_path.update_attributes(params[:scan_path])\n format.html { redirect_to @scan_path, notice: 'Scan path was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scan_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n if @gtfs_trip.update_attributes(params[:gtfs_trip])\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarot.update(tarot_params)\n format.html { redirect_to @tarot, notice: 'Tarot was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarot }\n else\n format.html { render :edit }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guest_update\n @trip = session[:trip]\n if @trip != nil\n @trip.update(trip_params)\n redirect_to trip_plans_guest_edit_path\n else\n redirect_to trip_plans_choose_path\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to oj_path, notice: 'Trip was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n if @physical_disk.update_attributes(params[:physical_disk])\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def update\n @profile = Profile.find_by_user_id(current_user.id)\n @trip = Trip.find(params[:id])\n if @trip.update_attributes(params.require(:trip).permit(:date, :time, :pickup_location, :destination, :price, :seats_available, :driver_id, :profile_id))\n redirect_to profile_trip_url(@profile, @trip)\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @tablet.update(tablet_params)\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tablet }\n else\n format.html { render :edit }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @youtube_video = args[:youtube_video] if args.key?(:youtube_video)\n end",
"def update\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n if @magnetic_finger_print.update_attributes(params[:magnetic_finger_print])\n format.html { redirect_to @magnetic_finger_print, notice: 'Magnetic finger print was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magnetic_finger_print.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @drive_folder = args[:drive_folder] if args.key?(:drive_folder)\n @file = args[:file] if args.key?(:file)\n @folder = args[:folder] if args.key?(:folder)\n @name = args[:name] if args.key?(:name)\n @title = args[:title] if args.key?(:title)\n end",
"def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip_type.update(trip_type_params)\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_type }\n else\n format.html { render :edit }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { render :show, status: :ok, location: @duck }\n else\n format.html { render :edit }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @gce_pd = args[:gce_pd] if args.key?(:gce_pd)\n @mount_path = args[:mount_path] if args.key?(:mount_path)\n end",
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ty.update(ty_params)\n format.html { redirect_to @ty, notice: 'Tie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tcard.update(tcard_params)\n format.html { redirect_to @tcard, notice: 'Tcard was successfully updated.' }\n format.json { render :show, status: :ok, location: @tcard }\n else\n format.html { render :edit }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to trips_path, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n respond_to do |format|\n if @ride_type.update(ride_type_params)\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully updated.' }\n format.json { render :show, status: :ok, location: @ride_type }\n else\n format.html { render :edit }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device.update(device_params)\n head :no_content\n end",
"def update\n # Logic to edit a driver and submit to DB\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n if @driver.update_attributes(params[:driver])\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @terminal_device.update(terminal_device_params)\n format.html { redirect_to @terminal_device, notice: 'Terminal device was successfully updated.' }\n format.json { render :show, status: :ok, location: @terminal_device }\n else\n format.html { render :edit }\n format.json { render json: @terminal_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_gtp.update(sub_gtp_params)\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_gtp }\n else\n format.html { render :edit }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n if @dtpic.update_attributes(params[:dtpic])\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n if @trip.update(trip_params)\r\n redirect_to trips_path, notice: 'Trip was successfully updated.'\r\n else\r\n redirect_to edit_trip_path, notice: 'Cannot leave information blank.'\r\n end\r\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @athlete = Athlete.find(params[:id])\n if @athlete.update_attributes(athlete_params)\n flash[:notice] = \"Athlete successfully updated\"\n redirect_to athletes_url\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @protocol_drug.update(protocol_drug_params)\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully updated.' }\n format.json { render :show, status: :ok, location: @protocol_drug }\n else\n format.html { render :edit }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.712367",
"0.6616173",
"0.66121894",
"0.64104354",
"0.63644916",
"0.6331657",
"0.6293863",
"0.6287805",
"0.6283083",
"0.61423874",
"0.6139561",
"0.609961",
"0.6066486",
"0.6029588",
"0.6025633",
"0.6020363",
"0.5999334",
"0.59709835",
"0.5869823",
"0.5869823",
"0.5855726",
"0.58441216",
"0.583753",
"0.57757527",
"0.57529444",
"0.5736705",
"0.5669162",
"0.5628609",
"0.5586227",
"0.5583285",
"0.5576463",
"0.55737066",
"0.55301654",
"0.5500968",
"0.5497607",
"0.549599",
"0.5429547",
"0.54192585",
"0.5411933",
"0.538425",
"0.5378097",
"0.5364408",
"0.53480935",
"0.5338173",
"0.53348917",
"0.5334488",
"0.533228",
"0.53099716",
"0.5297227",
"0.529075",
"0.52907044",
"0.52854264",
"0.52854264",
"0.5281991",
"0.528175",
"0.5281259",
"0.5273304",
"0.52600706",
"0.52447283",
"0.52324975",
"0.5227524",
"0.52268606",
"0.52187324",
"0.52141917",
"0.5208489",
"0.52052623",
"0.5201202",
"0.51923",
"0.51896876",
"0.51875",
"0.51780057",
"0.5177699",
"0.51775587",
"0.5176438",
"0.5172637",
"0.5171599",
"0.5169686",
"0.51661587",
"0.51651335",
"0.51651335",
"0.5160268",
"0.51576954",
"0.51576954",
"0.51487726",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.5141363",
"0.51404864",
"0.51341146",
"0.5123332",
"0.5122547",
"0.5121866",
"0.5121866",
"0.51196754",
"0.51192904",
"0.5118737"
] |
0.68816584
|
1
|
Updates a specific tape drive. API Key Scope: tape_drives / update
|
def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive"
end
# verify the required parameter 'tape_drive_body' is set
if @api_client.config.client_side_validation && tape_drive_body.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive"
end
# resource path
local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body)
# return_type
return_type = opts[:return_type] || 'TapeDrive'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#update_tape_drive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive = @object\n\n respond_to do |format|\n if @drive.update_attributes(params[:drive])\n flash[:notice] = 'Drive was successfully updated.'\n format.html { redirect_to drive_url(@drive) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tape_drive_by_tape_library(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n if @drive_type.update_attributes(params[:drive_type])\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @drive = Drive.find(params[:id])\n if @drive.update(drive_params)\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich aktualisiert.'\n else\n render 'edit'\n end\n end",
"def update\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n if @drive_system.update_attributes(params[:drive_system])\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n if @drives.update_attributes(params[:drives])\n flash[:notice] = 'Drives was successfully updated.'\n format.html { redirect_to(@drives) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_id = args[:drive_id] if args.key?(:drive_id)\n end",
"def update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_with ApidDrive.update(params[:id], params[:apid_driver])\n rescue ActiveRecord::RecordNotFound\n respond_with ApidDrive::StateChangeError\n end",
"def update\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n if @trip_driver.update_attributes(trip_driver_params)\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n if @tape_type.update_attributes(params[:tape_type])\n flash[:notice] = 'TapeType was successfully updated.'\n format.html { redirect_to tape_types_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @file_comment = args[:file_comment] if args.key?(:file_comment)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n if @moto_drive_type.update_attributes(params[:moto_drive_type])\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n if @beattape.update_attributes(params[:beattape])\n format.html { redirect_to @beattape, notice: 'Beattape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n if @machine_drive_type.update_attributes(params[:machine_drive_type])\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tape = Tape.find(params[:id])\n\n respond_to do |format|\n if @tape.update_attributes(params[:tape])\n flash[:notice] = 'Tape was successfully updated.'\n format.html { redirect_to(@tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def update\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n if @saved_tape.update_attributes(params[:saved_tape])\n flash[:notice] = 'SavedTape was successfully updated.'\n format.html { redirect_to(@saved_tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saved_tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tape.update(tape_params)\n format.html { redirect_to @tape, notice: 'Tape was successfully updated.' }\n format.json { render :show, status: :ok, location: @tape }\n else\n format.html { render :edit }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def update\n save_file\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n if @vdisk.update_attributes(params[:vdisk])\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n trip = Trip.find(params[:id])\n if trip.update(trip_params)\n redirect_to trip_path\n else\n render :edit, status: :bad_request\n end\n end",
"def update\n respond_to do |format|\n if @driver_trip_seat.update(driver_trip_seat_params)\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver_trip_seat }\n else\n format.html { render :edit }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tune = Tune.find(params[:id])\n\n respond_to do |format|\n if @tune.update_attributes(params[:tune])\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ride_driver.update(ride_driver_params)\n format.html { redirect_to @ride_driver, notice: 'Ride driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ride_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n if @templete.update_attributes(params[:templete])\n format.html { redirect_to @templete, :notice => 'Templete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def update\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n if @mag_tape.update_attributes(params[:mag_tape])\n format.html { redirect_to @mag_tape, notice: 'Mag tape was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find_by(id: params[:id])\n if @trip.nil?\n head :not_found\n return\n elsif @trip.update(trip_params)\n redirect_to trip_path\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @share_mode = args[:share_mode] if args.key?(:share_mode)\n end",
"def update\n respond_to do |format|\n if @tune.update(tune_params)\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content } \n else\n format.html { render action: 'edit' }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource @ride, ride_params\n end",
"def update\n respond_to do |format|\n if @tuning.update(tuning_params)\n format.html { redirect_to @tuning, notice: 'Tuning was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuning }\n else\n format.html { render :edit }\n format.json { render json: @tuning.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n if @lun_disk.update_attributes(params[:lun_disk])\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n if @etape.update_attributes(params[:etape])\n format.html { redirect_to @etape, notice: 'Etape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n if @tbdotreport.update_attributes(params[:tbdotreport])\n format.html { redirect_to @tbdotreport, notice: 'Tbdotreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tbdotreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_admin_user\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n if @scan_path.update_attributes(params[:scan_path])\n format.html { redirect_to @scan_path, notice: 'Scan path was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scan_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n if @gtfs_trip.update_attributes(params[:gtfs_trip])\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarot.update(tarot_params)\n format.html { redirect_to @tarot, notice: 'Tarot was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarot }\n else\n format.html { render :edit }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guest_update\n @trip = session[:trip]\n if @trip != nil\n @trip.update(trip_params)\n redirect_to trip_plans_guest_edit_path\n else\n redirect_to trip_plans_choose_path\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to oj_path, notice: 'Trip was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n if @physical_disk.update_attributes(params[:physical_disk])\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def update\n @profile = Profile.find_by_user_id(current_user.id)\n @trip = Trip.find(params[:id])\n if @trip.update_attributes(params.require(:trip).permit(:date, :time, :pickup_location, :destination, :price, :seats_available, :driver_id, :profile_id))\n redirect_to profile_trip_url(@profile, @trip)\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @tablet.update(tablet_params)\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tablet }\n else\n format.html { render :edit }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @youtube_video = args[:youtube_video] if args.key?(:youtube_video)\n end",
"def update\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n if @magnetic_finger_print.update_attributes(params[:magnetic_finger_print])\n format.html { redirect_to @magnetic_finger_print, notice: 'Magnetic finger print was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magnetic_finger_print.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @drive_folder = args[:drive_folder] if args.key?(:drive_folder)\n @file = args[:file] if args.key?(:file)\n @folder = args[:folder] if args.key?(:folder)\n @name = args[:name] if args.key?(:name)\n @title = args[:title] if args.key?(:title)\n end",
"def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip_type.update(trip_type_params)\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_type }\n else\n format.html { render :edit }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { render :show, status: :ok, location: @duck }\n else\n format.html { render :edit }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @gce_pd = args[:gce_pd] if args.key?(:gce_pd)\n @mount_path = args[:mount_path] if args.key?(:mount_path)\n end",
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ty.update(ty_params)\n format.html { redirect_to @ty, notice: 'Tie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tcard.update(tcard_params)\n format.html { redirect_to @tcard, notice: 'Tcard was successfully updated.' }\n format.json { render :show, status: :ok, location: @tcard }\n else\n format.html { render :edit }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to trips_path, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n respond_to do |format|\n if @ride_type.update(ride_type_params)\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully updated.' }\n format.json { render :show, status: :ok, location: @ride_type }\n else\n format.html { render :edit }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device.update(device_params)\n head :no_content\n end",
"def update\n # Logic to edit a driver and submit to DB\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n if @driver.update_attributes(params[:driver])\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @terminal_device.update(terminal_device_params)\n format.html { redirect_to @terminal_device, notice: 'Terminal device was successfully updated.' }\n format.json { render :show, status: :ok, location: @terminal_device }\n else\n format.html { render :edit }\n format.json { render json: @terminal_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_gtp.update(sub_gtp_params)\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_gtp }\n else\n format.html { render :edit }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n if @dtpic.update_attributes(params[:dtpic])\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n if @trip.update(trip_params)\r\n redirect_to trips_path, notice: 'Trip was successfully updated.'\r\n else\r\n redirect_to edit_trip_path, notice: 'Cannot leave information blank.'\r\n end\r\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @athlete = Athlete.find(params[:id])\n if @athlete.update_attributes(athlete_params)\n flash[:notice] = \"Athlete successfully updated\"\n redirect_to athletes_url\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @protocol_drug.update(protocol_drug_params)\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully updated.' }\n format.json { render :show, status: :ok, location: @protocol_drug }\n else\n format.html { render :edit }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.68816584",
"0.6616173",
"0.66121894",
"0.64104354",
"0.63644916",
"0.6331657",
"0.6293863",
"0.6287805",
"0.6283083",
"0.61423874",
"0.6139561",
"0.609961",
"0.6066486",
"0.6029588",
"0.6025633",
"0.6020363",
"0.5999334",
"0.59709835",
"0.5869823",
"0.5869823",
"0.5855726",
"0.58441216",
"0.583753",
"0.57757527",
"0.57529444",
"0.5736705",
"0.5669162",
"0.5628609",
"0.5586227",
"0.5583285",
"0.5576463",
"0.55737066",
"0.55301654",
"0.5500968",
"0.5497607",
"0.549599",
"0.5429547",
"0.54192585",
"0.5411933",
"0.538425",
"0.5378097",
"0.5364408",
"0.53480935",
"0.5338173",
"0.53348917",
"0.5334488",
"0.533228",
"0.53099716",
"0.5297227",
"0.529075",
"0.52907044",
"0.52854264",
"0.52854264",
"0.5281991",
"0.528175",
"0.5281259",
"0.5273304",
"0.52600706",
"0.52447283",
"0.52324975",
"0.5227524",
"0.52268606",
"0.52187324",
"0.52141917",
"0.5208489",
"0.52052623",
"0.5201202",
"0.51923",
"0.51896876",
"0.51875",
"0.51780057",
"0.5177699",
"0.51775587",
"0.5176438",
"0.5172637",
"0.5171599",
"0.5169686",
"0.51661587",
"0.51651335",
"0.51651335",
"0.5160268",
"0.51576954",
"0.51576954",
"0.51487726",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.5141363",
"0.51404864",
"0.51341146",
"0.5123332",
"0.5122547",
"0.5121866",
"0.5121866",
"0.51196754",
"0.51192904",
"0.5118737"
] |
0.712367
|
0
|
Updates a specific tape drive. API Key Scope: tape_drives / update
|
def update_tape_drive_by_tape_library(tape_library_id, tape_drive_id, tape_drive_body, opts = {})
data, _status_code, _headers = update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts)
data
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive = @object\n\n respond_to do |format|\n if @drive.update_attributes(params[:drive])\n flash[:notice] = 'Drive was successfully updated.'\n format.html { redirect_to drive_url(@drive) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n if @drive_type.update_attributes(params[:drive_type])\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @drive = Drive.find(params[:id])\n if @drive.update(drive_params)\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich aktualisiert.'\n else\n render 'edit'\n end\n end",
"def update\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n if @drive_system.update_attributes(params[:drive_system])\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n if @drives.update_attributes(params[:drives])\n flash[:notice] = 'Drives was successfully updated.'\n format.html { redirect_to(@drives) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_id = args[:drive_id] if args.key?(:drive_id)\n end",
"def update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_with ApidDrive.update(params[:id], params[:apid_driver])\n rescue ActiveRecord::RecordNotFound\n respond_with ApidDrive::StateChangeError\n end",
"def update\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n if @trip_driver.update_attributes(trip_driver_params)\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n if @tape_type.update_attributes(params[:tape_type])\n flash[:notice] = 'TapeType was successfully updated.'\n format.html { redirect_to tape_types_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @file_comment = args[:file_comment] if args.key?(:file_comment)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n if @moto_drive_type.update_attributes(params[:moto_drive_type])\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n if @beattape.update_attributes(params[:beattape])\n format.html { redirect_to @beattape, notice: 'Beattape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n if @machine_drive_type.update_attributes(params[:machine_drive_type])\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tape = Tape.find(params[:id])\n\n respond_to do |format|\n if @tape.update_attributes(params[:tape])\n flash[:notice] = 'Tape was successfully updated.'\n format.html { redirect_to(@tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def update\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n if @saved_tape.update_attributes(params[:saved_tape])\n flash[:notice] = 'SavedTape was successfully updated.'\n format.html { redirect_to(@saved_tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saved_tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tape.update(tape_params)\n format.html { redirect_to @tape, notice: 'Tape was successfully updated.' }\n format.json { render :show, status: :ok, location: @tape }\n else\n format.html { render :edit }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def update\n save_file\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n if @vdisk.update_attributes(params[:vdisk])\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n trip = Trip.find(params[:id])\n if trip.update(trip_params)\n redirect_to trip_path\n else\n render :edit, status: :bad_request\n end\n end",
"def update\n respond_to do |format|\n if @driver_trip_seat.update(driver_trip_seat_params)\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver_trip_seat }\n else\n format.html { render :edit }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tune = Tune.find(params[:id])\n\n respond_to do |format|\n if @tune.update_attributes(params[:tune])\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ride_driver.update(ride_driver_params)\n format.html { redirect_to @ride_driver, notice: 'Ride driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ride_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n if @templete.update_attributes(params[:templete])\n format.html { redirect_to @templete, :notice => 'Templete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def update\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n if @mag_tape.update_attributes(params[:mag_tape])\n format.html { redirect_to @mag_tape, notice: 'Mag tape was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find_by(id: params[:id])\n if @trip.nil?\n head :not_found\n return\n elsif @trip.update(trip_params)\n redirect_to trip_path\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @share_mode = args[:share_mode] if args.key?(:share_mode)\n end",
"def update\n respond_to do |format|\n if @tune.update(tune_params)\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content } \n else\n format.html { render action: 'edit' }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource @ride, ride_params\n end",
"def update\n respond_to do |format|\n if @tuning.update(tuning_params)\n format.html { redirect_to @tuning, notice: 'Tuning was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuning }\n else\n format.html { render :edit }\n format.json { render json: @tuning.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n if @lun_disk.update_attributes(params[:lun_disk])\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n if @etape.update_attributes(params[:etape])\n format.html { redirect_to @etape, notice: 'Etape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n if @tbdotreport.update_attributes(params[:tbdotreport])\n format.html { redirect_to @tbdotreport, notice: 'Tbdotreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tbdotreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_admin_user\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n if @scan_path.update_attributes(params[:scan_path])\n format.html { redirect_to @scan_path, notice: 'Scan path was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scan_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n if @gtfs_trip.update_attributes(params[:gtfs_trip])\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarot.update(tarot_params)\n format.html { redirect_to @tarot, notice: 'Tarot was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarot }\n else\n format.html { render :edit }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guest_update\n @trip = session[:trip]\n if @trip != nil\n @trip.update(trip_params)\n redirect_to trip_plans_guest_edit_path\n else\n redirect_to trip_plans_choose_path\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to oj_path, notice: 'Trip was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n if @physical_disk.update_attributes(params[:physical_disk])\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def update\n @profile = Profile.find_by_user_id(current_user.id)\n @trip = Trip.find(params[:id])\n if @trip.update_attributes(params.require(:trip).permit(:date, :time, :pickup_location, :destination, :price, :seats_available, :driver_id, :profile_id))\n redirect_to profile_trip_url(@profile, @trip)\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @tablet.update(tablet_params)\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tablet }\n else\n format.html { render :edit }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @youtube_video = args[:youtube_video] if args.key?(:youtube_video)\n end",
"def update\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n if @magnetic_finger_print.update_attributes(params[:magnetic_finger_print])\n format.html { redirect_to @magnetic_finger_print, notice: 'Magnetic finger print was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magnetic_finger_print.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @drive_folder = args[:drive_folder] if args.key?(:drive_folder)\n @file = args[:file] if args.key?(:file)\n @folder = args[:folder] if args.key?(:folder)\n @name = args[:name] if args.key?(:name)\n @title = args[:title] if args.key?(:title)\n end",
"def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip_type.update(trip_type_params)\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_type }\n else\n format.html { render :edit }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { render :show, status: :ok, location: @duck }\n else\n format.html { render :edit }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @gce_pd = args[:gce_pd] if args.key?(:gce_pd)\n @mount_path = args[:mount_path] if args.key?(:mount_path)\n end",
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ty.update(ty_params)\n format.html { redirect_to @ty, notice: 'Tie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tcard.update(tcard_params)\n format.html { redirect_to @tcard, notice: 'Tcard was successfully updated.' }\n format.json { render :show, status: :ok, location: @tcard }\n else\n format.html { render :edit }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to trips_path, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n respond_to do |format|\n if @ride_type.update(ride_type_params)\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully updated.' }\n format.json { render :show, status: :ok, location: @ride_type }\n else\n format.html { render :edit }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device.update(device_params)\n head :no_content\n end",
"def update\n # Logic to edit a driver and submit to DB\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n if @driver.update_attributes(params[:driver])\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @terminal_device.update(terminal_device_params)\n format.html { redirect_to @terminal_device, notice: 'Terminal device was successfully updated.' }\n format.json { render :show, status: :ok, location: @terminal_device }\n else\n format.html { render :edit }\n format.json { render json: @terminal_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_gtp.update(sub_gtp_params)\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_gtp }\n else\n format.html { render :edit }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n if @dtpic.update_attributes(params[:dtpic])\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n if @trip.update(trip_params)\r\n redirect_to trips_path, notice: 'Trip was successfully updated.'\r\n else\r\n redirect_to edit_trip_path, notice: 'Cannot leave information blank.'\r\n end\r\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @athlete = Athlete.find(params[:id])\n if @athlete.update_attributes(athlete_params)\n flash[:notice] = \"Athlete successfully updated\"\n redirect_to athletes_url\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @protocol_drug.update(protocol_drug_params)\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully updated.' }\n format.json { render :show, status: :ok, location: @protocol_drug }\n else\n format.html { render :edit }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.712367",
"0.68816584",
"0.6616173",
"0.64104354",
"0.63644916",
"0.6331657",
"0.6293863",
"0.6287805",
"0.6283083",
"0.61423874",
"0.6139561",
"0.609961",
"0.6066486",
"0.6029588",
"0.6025633",
"0.6020363",
"0.5999334",
"0.59709835",
"0.5869823",
"0.5869823",
"0.5855726",
"0.58441216",
"0.583753",
"0.57757527",
"0.57529444",
"0.5736705",
"0.5669162",
"0.5628609",
"0.5586227",
"0.5583285",
"0.5576463",
"0.55737066",
"0.55301654",
"0.5500968",
"0.5497607",
"0.549599",
"0.5429547",
"0.54192585",
"0.5411933",
"0.538425",
"0.5378097",
"0.5364408",
"0.53480935",
"0.5338173",
"0.53348917",
"0.5334488",
"0.533228",
"0.53099716",
"0.5297227",
"0.529075",
"0.52907044",
"0.52854264",
"0.52854264",
"0.5281991",
"0.528175",
"0.5281259",
"0.5273304",
"0.52600706",
"0.52447283",
"0.52324975",
"0.5227524",
"0.52268606",
"0.52187324",
"0.52141917",
"0.5208489",
"0.52052623",
"0.5201202",
"0.51923",
"0.51896876",
"0.51875",
"0.51780057",
"0.5177699",
"0.51775587",
"0.5176438",
"0.5172637",
"0.5171599",
"0.5169686",
"0.51661587",
"0.51651335",
"0.51651335",
"0.5160268",
"0.51576954",
"0.51576954",
"0.51487726",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.51466537",
"0.5141363",
"0.51404864",
"0.51341146",
"0.5123332",
"0.5122547",
"0.5121866",
"0.5121866",
"0.51196754",
"0.51192904",
"0.5118737"
] |
0.66121894
|
3
|
Updates a specific tape drive. API Key Scope: tape_drives / update
|
def update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive_by_tape_library ...'
end
# verify the required parameter 'tape_library_id' is set
if @api_client.config.client_side_validation && tape_library_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library"
end
# verify the required parameter 'tape_drive_id' is set
if @api_client.config.client_side_validation && tape_drive_id.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive_by_tape_library"
end
# verify the required parameter 'tape_drive_body' is set
if @api_client.config.client_side_validation && tape_drive_body.nil?
fail ArgumentError, "Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive_by_tape_library"
end
# resource path
local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body)
# return_type
return_type = opts[:return_type] || 'TapeDrive'
# auth_names
auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']
new_options = opts.merge(
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: TapeDrivesApi#update_tape_drive_by_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.update_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.update_tape_drive\"\n end\n # verify the required parameter 'tape_drive_body' is set\n if @api_client.config.client_side_validation && tape_drive_body.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_body' when calling TapeDrivesApi.update_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(tape_drive_body) \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#update_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update_tape_drive(tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_with_http_info(tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive = @object\n\n respond_to do |format|\n if @drive.update_attributes(params[:drive])\n flash[:notice] = 'Drive was successfully updated.'\n format.html { redirect_to drive_url(@drive) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tape_drive_by_tape_library(tape_library_id, tape_drive_id, tape_drive_body, opts = {})\n data, _status_code, _headers = update_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, tape_drive_body, opts)\n data\n end",
"def update\n @drive_type = DriveType.find(params[:id])\n\n respond_to do |format|\n if @drive_type.update_attributes(params[:drive_type])\n format.html { redirect_to(@drive_type, :notice => 'Drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @drive = Drive.find(params[:id])\n if @drive.update(drive_params)\n redirect_to drives_path, :notice => 'Frequenzumrichter erfolgreich aktualisiert.'\n else\n render 'edit'\n end\n end",
"def update\n @drive_system = DriveSystem.find(params[:id])\n\n respond_to do |format|\n if @drive_system.update_attributes(params[:drive_system])\n format.html { redirect_to @drive_system, notice: 'Drive system was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drive_system.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @drives = Drives.find(params[:id])\n\n respond_to do |format|\n if @drives.update_attributes(params[:drives])\n flash[:notice] = 'Drives was successfully updated.'\n format.html { redirect_to(@drives) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drives.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_id = args[:drive_id] if args.key?(:drive_id)\n end",
"def update\n respond_with ApidDrive.update(params[:id], params[:apid_driver])\n rescue ActiveRecord::RecordNotFound\n respond_with ApidDrive::StateChangeError\n end",
"def update\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n if @trip_driver.update_attributes(trip_driver_params)\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n if @tape_type.update_attributes(params[:tape_type])\n flash[:notice] = 'TapeType was successfully updated.'\n format.html { redirect_to tape_types_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive = args[:drive] if args.key?(:drive)\n @drive_item = args[:drive_item] if args.key?(:drive_item)\n @file_comment = args[:file_comment] if args.key?(:file_comment)\n @team_drive = args[:team_drive] if args.key?(:team_drive)\n end",
"def update\n @moto_drive_type = MotoDriveType.find(params[:id])\n\n respond_to do |format|\n if @moto_drive_type.update_attributes(params[:moto_drive_type])\n format.html { redirect_to(@moto_drive_type, :notice => 'Moto drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @moto_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n if @beattape.update_attributes(params[:beattape])\n format.html { redirect_to @beattape, notice: 'Beattape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @machine_drive_type = MachineDriveType.find(params[:id])\n\n respond_to do |format|\n if @machine_drive_type.update_attributes(params[:machine_drive_type])\n format.html { redirect_to(@machine_drive_type, :notice => 'Machine drive type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_drive_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tape = Tape.find(params[:id])\n\n respond_to do |format|\n if @tape.update_attributes(params[:tape])\n flash[:notice] = 'Tape was successfully updated.'\n format.html { redirect_to(@tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def update!(**args)\n @drive_file_id = args[:drive_file_id] if args.key?(:drive_file_id)\n end",
"def edit\n @drive = Drive.find(params[:id])\n end",
"def update\n @saved_tape = SavedTape.find(params[:id])\n\n respond_to do |format|\n if @saved_tape.update_attributes(params[:saved_tape])\n flash[:notice] = 'SavedTape was successfully updated.'\n format.html { redirect_to(@saved_tape) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saved_tape.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tape.update(tape_params)\n format.html { redirect_to @tape, notice: 'Tape was successfully updated.' }\n format.json { render :show, status: :ok, location: @tape }\n else\n format.html { render :edit }\n format.json { render json: @tape.errors, status: :unprocessable_entity }\n end #if\n end #do\n end",
"def update\n save_file\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @vdisk = Vdisk.find(params[:id])\n\n respond_to do |format|\n if @vdisk.update_attributes(params[:vdisk])\n format.html { redirect_to @vdisk, notice: 'Vdisk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vdisk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n trip = Trip.find(params[:id])\n if trip.update(trip_params)\n redirect_to trip_path\n else\n render :edit, status: :bad_request\n end\n end",
"def update\n respond_to do |format|\n if @driver_trip_seat.update(driver_trip_seat_params)\n format.html { redirect_to @driver_trip_seat, notice: 'Driver trip seat was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver_trip_seat }\n else\n format.html { render :edit }\n format.json { render json: @driver_trip_seat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tune = Tune.find(params[:id])\n\n respond_to do |format|\n if @tune.update_attributes(params[:tune])\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ride_driver.update(ride_driver_params)\n format.html { redirect_to @ride_driver, notice: 'Ride driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ride_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_with_http_info(tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive ...'\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive\"\n end\n # resource path\n local_var_path = '/tape_drives/{tape_drive_id}'.sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_tape_drives_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.index_tape_drives ...'\n end\n # resource path\n local_var_path = '/tape_drives'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?\n query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?\n query_params[:'tape_library_id'] = opts[:'tape_library_id'] if !opts[:'tape_library_id'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?\n query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?\n query_params[:'scsi_address'] = opts[:'scsi_address'] if !opts[:'scsi_address'].nil?\n query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?\n query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?\n query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?\n query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?\n query_params[:'sgdevice'] = opts[:'sgdevice'] if !opts[:'sgdevice'].nil?\n query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?\n query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?\n query_params[:'lsm'] = opts[:'lsm'] if !opts[:'lsm'].nil?\n query_params[:'panel'] = opts[:'panel'] if !opts[:'panel'].nil?\n query_params[:'transport'] = opts[:'transport'] if !opts[:'transport'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'full'] = opts[:'full'] if !opts[:'full'].nil?\n query_params[:'mount_count'] = opts[:'mount_count'] if !opts[:'mount_count'].nil?\n query_params[:'use_to'] = opts[:'use_to'] if !opts[:'use_to'].nil?\n query_params[:'use_by'] = opts[:'use_by'] if !opts[:'use_by'].nil?\n query_params[:'barcode'] = opts[:'barcode'] if !opts[:'barcode'].nil?\n query_params[:'task_id'] = opts[:'task_id'] if !opts[:'task_id'].nil?\n query_params[:'use_file_processed_size'] = opts[:'use_file_processed_size'] if !opts[:'use_file_processed_size'].nil?\n query_params[:'use_file_size_to_process'] = opts[:'use_file_size_to_process'] if !opts[:'use_file_size_to_process'].nil?\n query_params[:'use_file_name_processed'] = opts[:'use_file_name_processed'] if !opts[:'use_file_name_processed'].nil?\n query_params[:'bandwidth'] = opts[:'bandwidth'] if !opts[:'bandwidth'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDriveCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#index_tape_drives\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n if @templete.update_attributes(params[:templete])\n format.html { redirect_to @templete, :notice => 'Templete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @templete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_drive\n @drive = Drive.find(params[:id])\n end",
"def update\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n if @mag_tape.update_attributes(params[:mag_tape])\n format.html { redirect_to @mag_tape, notice: 'Mag tape was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mag_tape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find_by(id: params[:id])\n if @trip.nil?\n head :not_found\n return\n elsif @trip.update(trip_params)\n redirect_to trip_path\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @share_mode = args[:share_mode] if args.key?(:share_mode)\n end",
"def update\n respond_to do |format|\n if @tune.update(tune_params)\n format.html { redirect_to @tune, notice: 'Tune was successfully updated.' }\n format.json { head :no_content } \n else\n format.html { render action: 'edit' }\n format.json { render json: @tune.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n update_resource @ride, ride_params\n end",
"def update\n respond_to do |format|\n if @tuning.update(tuning_params)\n format.html { redirect_to @tuning, notice: 'Tuning was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuning }\n else\n format.html { render :edit }\n format.json { render json: @tuning.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lun_disk = LunDisk.find(params[:id])\n\n respond_to do |format|\n if @lun_disk.update_attributes(params[:lun_disk])\n format.html { redirect_to @lun_disk, notice: 'Lun disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lun_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n if @etape.update_attributes(params[:etape])\n format.html { redirect_to @etape, notice: 'Etape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tbdotreport = Tbdotreport.find(params[:id])\n\n respond_to do |format|\n if @tbdotreport.update_attributes(params[:tbdotreport])\n format.html { redirect_to @tbdotreport, notice: 'Tbdotreport was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tbdotreport.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_admin_user\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @scan_path = ScanPath.find(params[:id])\n\n respond_to do |format|\n if @scan_path.update_attributes(params[:scan_path])\n format.html { redirect_to @scan_path, notice: 'Scan path was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scan_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n if @gtfs_trip.update_attributes(params[:gtfs_trip])\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarot.update(tarot_params)\n format.html { redirect_to @tarot, notice: 'Tarot was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarot }\n else\n format.html { render :edit }\n format.json { render json: @tarot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guest_update\n @trip = session[:trip]\n if @trip != nil\n @trip.update(trip_params)\n redirect_to trip_plans_guest_edit_path\n else\n redirect_to trip_plans_choose_path\n end\n end",
"def destroy_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.destroy_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.destroy_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#destroy_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @trip = Trip.find(params[:id])\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to oj_path, notice: 'Trip was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @you_tube_video = args[:you_tube_video] if args.key?(:you_tube_video)\n end",
"def show_tape_drive(tape_drive_id, opts = {})\n data, _status_code, _headers = show_tape_drive_with_http_info(tape_drive_id, opts)\n data\n end",
"def update\n @physical_disk = PhysicalDisk.find(params[:id])\n\n respond_to do |format|\n if @physical_disk.update_attributes(params[:physical_disk])\n format.html { redirect_to @physical_disk, notice: 'Physical disk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_disk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find_by_user_id(current_user.id)\n @trip = Trip.find(params[:id])\n if @trip.update_attributes(params.require(:trip).permit(:date, :time, :pickup_location, :destination, :price, :seats_available, :driver_id, :profile_id))\n redirect_to profile_trip_url(@profile, @trip)\n else\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @tablet.update(tablet_params)\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { render :show, status: :ok, location: @tablet }\n else\n format.html { render :edit }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @form = args[:form] if args.key?(:form)\n @link = args[:link] if args.key?(:link)\n @youtube_video = args[:youtube_video] if args.key?(:youtube_video)\n end",
"def update\n @magnetic_finger_print = MagneticFingerPrint.find(params[:id])\n\n respond_to do |format|\n if @magnetic_finger_print.update_attributes(params[:magnetic_finger_print])\n format.html { redirect_to @magnetic_finger_print, notice: 'Magnetic finger print was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magnetic_finger_print.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @drive_file = args[:drive_file] if args.key?(:drive_file)\n @drive_folder = args[:drive_folder] if args.key?(:drive_folder)\n @file = args[:file] if args.key?(:file)\n @folder = args[:folder] if args.key?(:folder)\n @name = args[:name] if args.key?(:name)\n @title = args[:title] if args.key?(:title)\n end",
"def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip_type.update(trip_type_params)\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_type }\n else\n format.html { render :edit }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { render :show, status: :ok, location: @duck }\n else\n format.html { render :edit }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @t = T.find(params[:id])\n\n respond_to do |format|\n if @t.update_attributes(params[:t])\n format.html { redirect_to @t, notice: 'T was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @t.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @gce_pd = args[:gce_pd] if args.key?(:gce_pd)\n @mount_path = args[:mount_path] if args.key?(:mount_path)\n end",
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ty.update(ty_params)\n format.html { redirect_to @ty, notice: 'Tie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tcard.update(tcard_params)\n format.html { redirect_to @tcard, notice: 'Tcard was successfully updated.' }\n format.json { render :show, status: :ok, location: @tcard }\n else\n format.html { render :edit }\n format.json { render json: @tcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to trips_path, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @duck.update(duck_params)\n format.html { redirect_to @duck, notice: 'Duck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @duck.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n respond_to do |format|\n if @ride_type.update(ride_type_params)\n format.html { redirect_to @ride_type, notice: 'Ride type was successfully updated.' }\n format.json { render :show, status: :ok, location: @ride_type }\n else\n format.html { render :edit }\n format.json { render json: @ride_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update\n @device.update(device_params)\n head :no_content\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # Logic to edit a driver and submit to DB\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n if @driver.update_attributes(params[:driver])\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @terminal_device.update(terminal_device_params)\n format.html { redirect_to @terminal_device, notice: 'Terminal device was successfully updated.' }\n format.json { render :show, status: :ok, location: @terminal_device }\n else\n format.html { render :edit }\n format.json { render json: @terminal_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { render :show, status: :ok, location: @driver }\n else\n format.html { render :edit }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show_tape_drive_by_tape_library_with_http_info(tape_library_id, tape_drive_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapeDrivesApi.show_tape_drive_by_tape_library ...'\n end\n # verify the required parameter 'tape_library_id' is set\n if @api_client.config.client_side_validation && tape_library_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_library_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # verify the required parameter 'tape_drive_id' is set\n if @api_client.config.client_side_validation && tape_drive_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tape_drive_id' when calling TapeDrivesApi.show_tape_drive_by_tape_library\"\n end\n # resource path\n local_var_path = '/tape_libraries/{tape_library_id}/tape_drives/{tape_drive_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s)).sub('{' + 'tape_drive_id' + '}', CGI.escape(tape_drive_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeDrive' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapeDrivesApi#show_tape_drive_by_tape_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_gtp.update(sub_gtp_params)\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_gtp }\n else\n format.html { render :edit }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dvd = Dvd.find(params[:id])\n\n respond_to do |format|\n if @dvd.update_attributes(params[:dvd])\n format.html { redirect_to @dvd, notice: 'Dvd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dvd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n if @dtpic.update_attributes(params[:dtpic])\n format.html { redirect_to @dtpic, notice: 'Dtpic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dtpic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n if @trip.update(trip_params)\r\n redirect_to trips_path, notice: 'Trip was successfully updated.'\r\n else\r\n redirect_to edit_trip_path, notice: 'Cannot leave information blank.'\r\n end\r\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @athlete = Athlete.find(params[:id])\n if @athlete.update_attributes(athlete_params)\n flash[:notice] = \"Athlete successfully updated\"\n redirect_to athletes_url\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @protocol_drug.update(protocol_drug_params)\n format.html { redirect_to @protocol_drug, notice: 'Protocol drug was successfully updated.' }\n format.json { render :show, status: :ok, location: @protocol_drug }\n else\n format.html { render :edit }\n format.json { render json: @protocol_drug.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @driver.update(driver_params)\n format.html { redirect_to @driver, notice: 'Driver was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7123454",
"0.6881105",
"0.6614381",
"0.66120595",
"0.64089686",
"0.6362001",
"0.633052",
"0.62931097",
"0.6285384",
"0.61413723",
"0.6138554",
"0.60976565",
"0.6066855",
"0.602786",
"0.60244465",
"0.601967",
"0.5998416",
"0.59709716",
"0.586796",
"0.586796",
"0.5853897",
"0.584407",
"0.5838327",
"0.5775417",
"0.5753839",
"0.57354903",
"0.5668573",
"0.56279176",
"0.55854595",
"0.55823284",
"0.55767125",
"0.55747163",
"0.55291325",
"0.5501431",
"0.54959047",
"0.54958355",
"0.5429176",
"0.5417455",
"0.54115677",
"0.5382917",
"0.5377436",
"0.53633136",
"0.53478557",
"0.5337297",
"0.53337544",
"0.53335005",
"0.53313744",
"0.5309239",
"0.5297506",
"0.5291476",
"0.5290195",
"0.52834964",
"0.52834964",
"0.5281949",
"0.5281445",
"0.52801865",
"0.5272886",
"0.52582425",
"0.52438676",
"0.5230551",
"0.52270913",
"0.5226911",
"0.52179986",
"0.5213051",
"0.52079964",
"0.520365",
"0.52003694",
"0.5191641",
"0.5189111",
"0.51874304",
"0.51772135",
"0.5177149",
"0.5176047",
"0.5175183",
"0.5171331",
"0.51710236",
"0.5168252",
"0.51647276",
"0.51647276",
"0.51645577",
"0.51609534",
"0.51562196",
"0.51562196",
"0.5149083",
"0.51466054",
"0.51466054",
"0.51466054",
"0.51466054",
"0.51466054",
"0.51466054",
"0.5140438",
"0.51400363",
"0.5133208",
"0.5122506",
"0.51217675",
"0.5121723",
"0.5121723",
"0.51181877",
"0.511786",
"0.5117759"
] |
0.62828296
|
9
|
choose the next move based on current state of the board
|
def move(board)
puts "Computer:"
case
#check for winning space
when victory(board) != nil
if board.valid_move?(victory(board))
victory(board)
end
#check for spaces to block
when block(board) != nil
if board.valid_move?(block(board))
block(board)
end
#make some other move
when !board.taken?("5")
"5"
else
space = (1+rand(9)).to_s
until board.valid_move?(space)
space = (1+rand(9)).to_s
end
space
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def next_state(state, move)\n # Deep copy position (is this the easiest way?)\n position = Marshal.load(Marshal.dump(state[:position]))\n player = state[:player]\n opp = opponent(player)\n pieces = Marshal.load(Marshal.dump(state[:pieces]))\n from = move[0]\n to = move[1]\n force_analysis = false\n check = false\n moving_piece = pieces[player].find { |piece| piece.location == from }\n if !moving_piece\n puts \"ERROR--no piece to move!\"\n end\n # Check for capture\n if position[to[0]][to[1]] != \".\"\n # Remove enemy piece\n pieces[opp].delete_if { |piece| piece.location == to }\n # Force AI to continue analysis\n force_analysis = true\n end\n # Check for promotion\n if moving_piece.class == Pawn && to[0] == end_row(player)\n # Replace pawn with queen\n # (Underpromotion not yet implemented)\n pieces[player].delete(moving_piece)\n moving_piece = Queen.new(self, to, player)\n pieces[player] << moving_piece\n end\n # Move piece\n position[from[0]][from[1]] = \".\"\n position[to[0]][to[1]] = moving_piece.icon\n moving_piece.location = to\n # Complete castling by moving rook\n if moving_piece.class == ChessKing && (from[1] - to[1]).abs == 2\n rook_column = to[1] == 6 ? 7 : 0\n castling_rook = pieces[player].find { |piece| piece.location == [from[0], rook_column] }\n if castling_rook\n rook_dest = to[1] == 6 ? 5 : 3\n position[from[0]][rook_column] = \".\"\n position[to[0]][rook_dest] = castling_rook.icon\n castling_rook.location = [to[0], rook_dest]\n else\n puts \"Castling error -- can't find rook!\"\n end\n end\n # Switch active player\n next_player = opp\n # # Create new state for testing whether king is in check\n # new_position_state = {\n # :position => position,\n # :player => player,\n # :pieces => pieces,\n # :check => false,\n # :force_analysis => false\n # }\n # # Test whether opponent's king is now in check\n # check = check?(new_position_state)\n # force_analysis = true if check\n # Return new state\n {\n :position => position,\n :player => next_player,\n :pieces => pieces,\n :check => check,\n :force_analysis => force_analysis\n }\n end",
"def next_move\n\t\tif @next_move.nil?\n\t\t\t@next_move = determine_next_move\n\t\tend\n\n\t\t@next_move\n\tend",
"def next_state(state, move)\n position = state[:position]\n player = state[:player]\n result = position.each_with_index.map do |row, x|\n row.each_with_index.map do |value, y|\n ( x >= move[0] && y >= move[1] ) ? 0 : value\n end\n end\n next_player = opponent(player)\n { :position => result, :player => next_player }\n end",
"def next_move gameboard\n @counter += 1\n @counter = 0 if @counter == gameboard.valid_moves.count\n gameboard.valid_moves[@counter]\n end",
"def move\n start_show_thinking\n @board.move(best_moves.first)\n stop_show_thinking\n board.last_move\n end",
"def next_move(game_state: nil)\n #We add only what is new, just in case the state_delta contains less info...\n new_moves = []\n if @board_state.length < game_state.length\n (@board_state.length...game_state.length).each do |i| \n @board_state << game_state[i] \n new_moves << game_state[i]\n end\n end\n moves = translate_acn(new_moves, board)\n update_board(@board, moves, @score)\n return decide_best_move @board, @score, @depth\n end",
"def next_state(move)\n # Need to create new hash for last_move?\n next_last_move = {}.merge(@last_move)\n next_outer_bounds = {}.merge(@outer_bounds)\n # Is this the easiest way to create a new copy of the position?\n next_position = Marshal.load(Marshal.dump(position))\n # Add appropriate symbol to move location\n next_position[move[0]][move[1]] = self.class::SYMBOLS[player]\n # Swap players\n next_player = opponent\n # FOR SIMPLICTY update last move\n next_last_move[player] = move\n next_outer_bounds[:top] = move[0] if move[0] < next_outer_bounds[:top]\n next_outer_bounds[:bottom] = move[0] if move[0] > next_outer_bounds[:bottom]\n next_outer_bounds[:left] = move[1] if move[1] < next_outer_bounds[:left]\n next_outer_bounds[:right] = move[1] if move[1] > next_outer_bounds[:right]\n # Return updated state\n GomokuState.new(next_position, next_player, next_last_move, next_outer_bounds)\n end",
"def next_move\n minimax(self.id)\n\n @board.board[@choice] = id\n @board.free.delete(@choice)\n p self\n puts \"player #{id + 1} chooses #{@choice}\"\n puts @board\n\n @board.winner || @board.free.empty?\n end",
"def move(board)\n\t\tself.minimax(board, self, 0)\n\t\treturn @choice\n\tend",
"def next_move(player,board,move)\n completed = false;\n blocking = false;\n if(move == 1) #First Move (hard coded)\n puts \"2 0\";\n elsif(move == 2) #Second Move (hard coded)\n if(board[1][1] == 'X')\n puts \"2 2\";\n else\n puts \"1 1\";\n end \n elsif(move == 3) #Third move (hard coded)\n if(board[0][1] == 'O' || board[1][0] == 'O' || board[1][2] == 'O' || board[2][1] == 'O')\n puts \"1 1\";\n elsif(board[1][1] == 'O')\n puts \"0 2\";\n elsif(board[0][2] == 'O' || board[2][2] == 'O')\n puts \"0 0\";\n else\n puts \"2 2\";\n end\n else #Any move after the 3rd\n completed = can_complete(player,board)\n if(completed == false)\n blocking = must_block(player,board);\n if(blocking == false)\n prevent = can_complete(player,board)\n if(move == 4 && (board[0][0] == 'X' || board[0][2] == 'X' || board[2][0] == 'X' || board[2][2] == 'X') && (board[0][1] == 'X' || board[1][0] == 'X' || board[1][2] == 'X' || board[2][1] == 'X'))\n if(board[0][1] == 'X' || board[2][1] == 'X')\n puts \"1 0\";\n else\n puts \"0 1\";\n end\n elsif(move == 4 && ((board[0][0] == 'X' && board[2][2] == 'X') || (board[0][2] == 'X' && board[2][0] == 'X') || (board[0][1] == 'X' && board[2][1] == 'X') || (board[1][0] == 'X' && board[1][2] == 'X')))\n if((board[0][0] == 'X' && board[2][2] == 'X') || (board[0][2] == 'X' && board[2][0] == 'X'))\n puts \"0 1\";\n else\n puts \"0 0\";\n end\n elsif(move == 6 && (board[2][1] == 'X' || board[0][1] == 'X') && (board[1][0] == 'X' || board[1][2] == 'X') && board[2][2] == '_')\n puts \"2 2\";\n elsif(board[0][0] == \"_\")\n puts \"0 0\";\n elsif(board[0][2] == \"_\")\n puts \"0 2\";\n elsif(board[2][2] == \"_\")\n puts \"2 2\";\n elsif(board[2][0] == \"_\")\n puts \"2 0\";\n elsif(board[0][1] == \"_\")\n puts \"0 1\";\n elsif(board[2][1] == \"_\")\n puts \"2 1\";\n elsif(board[1][0] == \"_\")\n puts \"1 0\";\n elsif(board[1][2] == \"_\")\n puts \"1 2\";\n else\n puts \"1 1\";\n end\n end\n end\n end\nend",
"def get_next_move\n\t\t\t\tif player_to_act.respond_to?(:get_move)\n\t\t\t\t\t# get the move, write it to the server and continue reading the gamestate\n\t\t\t\t\tmove = nil\n\t\t\t\t\tloop do\n\t\t\t\t\t\tmove = player_to_act.get_move\n\t\t\t\t\t\tbreak if move\n\t\t\t\t\t\t# in case player doesn't have enough info to move, try reading matchstate\n\t\t\t\t\t\tread_acpc_matchstate\n\t\t\t\t\tend\n\t\t\t\t\tsocket_put(action_str(move))\n\t\t\t\tend\n\t\t\t\treturn read_next_move\n\t\t\tend",
"def first_move(game)\n if self.ai_player == \"X\"\n self.choice = \"C3\"\n return 10\n elsif self.ai_player == \"O\"\n first_play = {\n \"A1\" => \"B2\",\n \"B1\" => \"B3\",\n \"C1\" => \"B2\",\n \"A2\" => \"A3\",\n \"B2\" => \"C3\",\n \"C2\" => \"C3\",\n \"A3\" => \"B2\",\n \"B3\" => \"C3\",\n \"C3\" => \"B2\" }\n m = Matrix[*game.board.cells].index{|a| a}\n coord = \"#{alphabetize(m[0])}#{m[1]+1}\"\n self.choice = first_play[coord]\n return \"10\"\n end\n end",
"def nextMove(n,r,c,grid)\n # place m on grid at r,c\n actions = generate_path(grid, 'm','p')\n puts actions[0]\n grid[r][c] = '-'\n if actions[0] == 'LEFT'\n grid[r][c-1]='m'\n elsif actions[0] == 'RIGHT'\n grid[r][c+1]='m'\n elsif actions[0] == 'UP'\n grid[r-1][c]='m'\n elsif actions[0] == 'DOWN'\n grid[r+1][c]='m'\n end\n actions[0]\n end",
"def computer_move\n return nil if @current_state.done?\n # Pick best move using minimax algorithm\n move = @current_state.best_move\n # Make the move\n move.display\n make_move(move)\n end",
"def next_move\n\n @board.board[@choice] = id\n @board.free.delete(@choice)\n p self\n puts \"player #{id + 1} chooses #{@choice}\"\n puts @board\n\n @board.winner || @board.free.empty?\n end",
"def next_state(move)\n # Fill this in. Sample code:\n # # Is this the easiest way to create a new copy of the position?\n # next_position = Marshal.load(Marshal.dump(position))\n # player = state[:player]\n # < define resulting position as next_position >\n # next_player = opponent(player)\n # { :position => next_position, :player => next_player}\n end",
"def move(board)\n @board = board\n valid_moves = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\n\n case\n when winning_move\n (winning_move + 1).to_s\n when blocking_move\n (blocking_move + 1).to_s\n when center?\n \"5\"\n when opposite_corner\n opposite_corner\n when corner\n (corner + 1).to_s\n else\n until !board.taken?(input)\n valid_moves.sample\n end\n end\n end",
"def choose_move\n choose_move_when_in_check\n #update to be player specific\n choose_piece_to_move\n which_piece_selected\n choose_where_to_move\n end",
"def find_best_move(brd)\n\n # Shortcircuit first move so 5 is always choosen\n return 5 if empty_squares(brd).count == 9\n\n\n best_val = -INFINITY\n best_move = nil\n\n brd.each do |cell, status|\n if status == INITIAL_MARKER\n brd[cell] = COMPUTER_MARKER\n move_val = minimax(brd, 0, 'player')\n brd[cell] = INITIAL_MARKER\n if move_val > best_val\n best_val = move_val\n best_move = cell\n end\n end\n end\n return best_move\n end",
"def move(board)\n if win?(board)\n (win?(board) + 1).to_s\n elsif block? board\n (block?(board) + 1).to_s\n elsif board.cells[4] == ' '\n \"5\"\n elsif corner? board\n (corner?(board).sample + 1).to_s\n else\n loop do\n move = (((rand*8).round)+1).to_s\n break if board.valid_move?(move)\n end\n return move\n end\n end",
"def next_turn\n print \"\\nYour move, #{@mover.designation}: \"\n move = get_move\n\n print \"\\nMover = #{@mover.designation}. Move = #{move}.\\n\"\n\n if move == 'Q'.to_i\n @is_active = false\n print \"\\n***** Game halted by user. *****\\n\"\n return\n end\n\n add_good_move(move)\n check_winner\n check_tie_game\n\n print_color_grid\n\n @turn = @turn + 1\n @mover = @player[@turn % 2]\n end",
"def next_move\n case Direction::DIRECTIONS[direction.current]\n when Direction::DIRECTIONS[0] # NORTH\n {x: 0, y: 1}\n when Direction::DIRECTIONS[1] # EAST\n {x: 1, y: 0}\n when Direction::DIRECTIONS[2] # SOUTH\n {x: 0, y: -1}\n when Direction::DIRECTIONS[3] # WEST\n {x: -1, y: 0}\n end\n end",
"def play_move(move)\n found_cell = false\n @state[move].map! do |cell|\n if (!found_cell && cell == :e)\n found_cell = true\n next_mover\n else\n cell\n end\n end\n \n @move_count += 1\n end",
"def imperative_move\n # if we can win *this turn*, then take it because\n # it rates winning next turn the same as winning in 3 turns\n game.available_moves.each do |move|\n new_game = game.pristine_mark move\n return move if new_game.over? && new_game.winner == player_number\n end\n \n # if we can block the opponent from winning *this turn*, then take it, because\n # it rates losing this turn the same as losing in 3 turns\n if moves_by_rating.all? { |move, rating, game| rating == -1 }\n Game.winning_states do |position1, position2, position3|\n a, b, c = board[position1-1, 1].to_i, board[position2-1, 1].to_i, board[position3-1, 1].to_i\n if a + b + c == opponent_number * 2\n return a.zero? ? position1 : b.zero? ? position2 : position3\n end\n end\n end\n end",
"def move(board)\n\t\tif(board.cells[4] == \" \")\n\t\treturn final_cell_move =\t\"5\"\n\t\telse\n\t\t\tif(attack_against_opponent(board) != nil)\n\t\t\t\t return final_cell_move = attack_against_opponent(board)\n\t\t\telsif(defend_against_opponent(board) !=nil)\n\t\t\t\t return final_cell_move = defend_against_opponent(board)\n\t\t\telsif(find_empty_corner(board) != nil)\n\t\t\t\t return final_cell_move = find_empty_corner(board)\n\t\t\t elsif(find_move(board) != nil)\n\t \t\t\t return final_cell_move = find_move(board) # +1\n\t\t\t elsif(all_corners_filled?(board))\n\t\t\t\t return final_cell_move = find_random_cell(board)\n\t\t\tend\n\t\tend\n\tend",
"def next_move\n moves.max{ |a, b| a.rank <=> b.rank }\n end",
"def next_move(_n, bot_pos_x, bot_pos_y, princess_position, _grid)\n case\n when princess_position[0] - bot_pos_x < 0 then move = 'UP'\n when princess_position[0] - bot_pos_x > 0 then move = 'DOWN'\n when princess_position[1] - bot_pos_y < 0 then move = 'LEFT'\n when princess_position[1] - bot_pos_y > 0 then move = 'RIGHT'\n end\n move\n end",
"def get_move\n cols = %w(a b c d e f g h)\n rows = %w(8 7 6 5 4 3 2 1)\n\n from_pos, to_pos = nil, nil\n until from_pos && to_pos\n @display.draw\n if from_pos\n row, col = from_pos\n piece = @display.board[from_pos].class\n puts \"#{piece} at #{cols[col]}#{rows[row]} selected. Where to move to?\"\n to_pos = @display.get_keyboard_input\n else\n @display.reset_errors_notification\n puts \"#{@color.capitalize}'s move\"\n puts 'What piece do you want to move?'\n selection = @display.get_keyboard_input\n from_pos = selection if selection && valid_selection?(selection)\n end\n end\n [from_pos, to_pos]\n end",
"def move(board)\n\t\tmove = 0 # Variable to hold the Computer player's selected move\n\t\tposition = 0\n\t\tplace = 0\n\t\tedge = 0\n\t\tcorner = 0\n\t\tcomputer_move = [] # Array to hold the moves available to the current Computer player\n\t\tvalid_moves = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"] # Defines allowed moves in a Tic Tac Toe game\n\t\t# Bring in some artificial intelligence\n\t\tposition = ai_block_win(board)\n\t\tplace = ai_best_moves(board)\n\t\tedge = ai_strategy_edges(board)\n\t\tcorner = ai_strategy_corners(board)\n\t\t# End artificial intelligence\n\t\tvalid_moves.each_with_index do |a,i| # Checks which of its valid moves are available to the Computer player\n\t\t\tif board.valid_move?(a)\n\t\t\t\tcomputer_move << ((i + 1).to_s) # If the move is valid add it to the available moves array\n\t\t\tend\n\t\tend\n\t\tif position != nil && !position.empty? && board.valid_move?(position[0][0]) # If move is valid and not nil or empty move takes position\n\t\t\tmove = position[0]\n\t\telsif edge != nil # If move returned by edge exists\n\t\t\tmove = edge\n\t\telsif corner != nil # If move returned by corner exists\n\t\t\tmove = corner\n\t\telsif place != nil # If move returned by place exists\n\t\t\tmove = place\n\t\telse\n\t\t\tmove = computer_move.sample # Take a random move from the available moves array if no other moves valid\n\t\tend\n\t\tmove # Return the move to be made to #game\n\tend",
"def make_move(row: , column: )\n symbol = current_symbol\n raise 'Round finished' if finished?\n raise 'Move already taken' if board(row: row, column: column) != '_'\n board_state[index_from_row_column(row, column)] = symbol\n self.update(board_state: board_state, current_player: next_player)\n end",
"def next_turn\n if @current_player == @player_1\n @current_player = @player_2\n else\n @current_player = @player_1\n end\n until @current_moves.length == 2\n ask_player_for_move(@current_player)\n end\n end",
"def move pos\n new_board = nil\n next_player = @current_player == :x ? :o : :x\n new_board = @board.make_move @current_player, pos\n State.new new_board, next_player, @computer_player\n end",
"def select_move(board)\n possible_moves = board.possible_moves\n\n state = board_to_nn_inputs(board.state)\n # run the network and pass the qvalues through softmax\n q_values = @fann.run(state)\n probabilities = softmax(q_values)\n # reject all moves that are not possible according to the board by setting their probability to 0\n probabilities.map!.with_index {|v, i| possible_moves.include?(i) ? v : 0}\n # pick move with highest value that is possible from the moves that are possible\n max_probability = probabilities.max\n # find all moves that have the highest value, and pick one of them\n # turn into using probability band\n move = probabilities.map.with_index {|v, i| max_probability <= 1.01 * v ? i : nil}.compact.sample\n\n # Log data for training at the end of the game\n @next_q_max_log << q_values[move] unless @action_log.empty?\n @state_log << board.state.clone\n @q_values_log << q_values.clone\n @action_log << move\n return move\n end",
"def generate_possible_moves(state)\n end",
"def nextMove(n,r,c,grid)\n return false if n == 0 && grid.empty?\n\n bot_position = getBotPosition(n, grid)\n princess_position = findPrincessPosition(n, grid)\n\n bot = bot_position.flatten!\n princess = princess_position.flatten!\n\n return false unless bot[0] == r\n if bot[0] < princess[0]\n puts 'DOWN'\n elsif bot[0] > princess[0]\n puts 'UP'\n elsif bot[1] > princess[1]\n puts 'LEFT'\n elsif bot[1] < princess[1]\n puts 'RIGHT'\n end\nend",
"def get_random_next_move(arena)\n head = get_head_coords\n moves = []\n # N\n cell = arena.get(head[:x], head[:y] - 1)\n moves << 'N' if cell == 'empty' || cell[0..3] == 'tail'\n # S\n cell = arena.get(head[:x], head[:y] + 1)\n moves << 'S' if cell == 'empty' || cell[0..3] == 'tail'\n # E\n cell = arena.get(head[:x] + 1, head[:y])\n moves << 'E' if cell == 'empty' || cell[0..3] == 'tail'\n # W\n cell = arena.get(head[:x] - 1, head[:y])\n moves << 'W' if cell == 'empty' || cell[0..3] == 'tail'\n\n # Return any direction or nil\n moves.sample\n end",
"def make_move(move)\n @current_state = @current_state.next_state(move)\n end",
"def next_move(bot_pos_x, bot_pos_y, princess_position)\n case\n when princess_position[0] - bot_pos_x < 0 then move = 'UP'\n when princess_position[0] - bot_pos_x > 0 then move = 'DOWN'\n when princess_position[1] - bot_pos_y < 0 then move = 'LEFT'\n when princess_position[1] - bot_pos_y > 0 then move = 'RIGHT'\n end\n move\nend",
"def calculate_next_cell_state(row, col)\n living_neighbours = count_living_neighbours(row, col)\n current_cell_state = @current_board[row][col]\n\n current_cell_state = if living_neighbours < 2 || living_neighbours > 3\n 0\n elsif (living_neighbours == 2 && current_cell_state != 0) || living_neighbours == 3\n 1\n else\n 0\n end\n\n current_cell_state\n end",
"def next_turn\n @player_turn = @players.reject { |player| player.id == @board_turn.player.id }.first\n @board_turn = @boards.select { |board| board.player.id == @player_turn.id }.first\n end",
"def second_move() \r\n\t\tif first_move == false && board[4].class = Fixnum\r\n\t\t\tboard[4] = marker\r\n\t\telse\r\n\t\t\tcorner\r\n\t\tend\r\n\tend",
"def move(state)\n @iteration_count = 0\n #make an array of all possible moves\n choices = []\n state.legal_moves.each do |move| \n hash = tabulate_outcomes(move)\n hash[:move] = move\n choices << hash\n end\n puts \"Finished tabulation in #{@iteration_count} calls.\"\n \n #pick best worst case scenario\n best = choices.sort_by { |c| [-c[:worst], -c[@playing_mark]] }.first\n return best[:move]\n end",
"def move(board)\n if @players == \"X\" && board.cells[0] == \"X\" && (board.cells[1] == \"O\"|| board.cells[3] == \"O\"|| board.cells[4] == \"O\")\n ai_move = [\"3\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[1] == \"X\" && (board.cells[0] == \"O\"|| board.cells[2] == \"O\"|| board.cells[3] == \"O\" || board.cells[4] == \"O\" || board.cells[5] == \"O\")\n ai_move = [\"4\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[2] == \"X\" && (board.cells[1] == \"O\"|| board.cells[4] == \"O\"|| board.cells[5] == \"O\")\n ai_move = [\"1\", \"5\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[3] == \"X\" && (board.cells[0] == \"O\"|| board.cells[1] == \"O\"|| board.cells[4] == \"O\" || board.cells[6] == \"O\" || board.cells[7] == \"O\")\n ai_move = [\"4\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[4] == \"X\" && (board.cells[0] == \"O\"|| board.cells[1] == \"O\"|| board.cells[2] == \"O\" || board.cells[3] == \"O\" || board.cells[5] == \"O\" || board.cells[6] == \"O\" || board.cells[7] == \"O\" || board.cells[8] == \"O\")\n ai_move = [\"1\", \"3\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[5] == \"X\" && (board.cells[1] == \"O\"|| board.cells[2] == \"O\"|| board.cells[4] == \"O\" || board.cells[7] == \"O\" || board.cells[8] == \"O\")\n ai_move = [\"3\", \"4\", \"5\", \"9\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[6] == \"X\" && (board.cells[3] == \"O\"|| board.cells[4] == \"O\"|| board.cells[7] == \"O\")\n ai_move = [\"1\", \"3\", \"5\", \"9\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[7] == \"X\" && (board.cells[3] == \"O\"|| board.cells[4] == \"O\"|| board.cells[5] == \"O\" || board.cells[6] == \"O\" || board.cells[8] == \"O\")\n ai_move = [\"2\", \"5\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"X\" && board.cells[8] == \"X\" && (board.cells[4] == \"O\"|| board.cells[5] == \"O\"|| board.cells[7] == \"O\")\n ai_move = [\"1\", \"3\", \"5\", \"6\"]\n ai_move.sample\n\n elsif @players == \"O\" && board.cells[0] == \"O\" && (board.cells[1] == \"X\"|| board.cells[3] == \"O\"|| board.cells[4] == \"O\")\n ai_move = [\"3\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[1] == \"O\" && (board.cells[0] == \"X\"|| board.cells[2] == \"X\"|| board.cells[3] == \"X\" || board.cells[4] == \"X\" || board.cells[5] == \"X\")\n ai_move = [\"4\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[2] == \"O\" && (board.cells[1] == \"X\"|| board.cells[4] == \"X\"|| board.cells[5] == \"X\")\n ai_move = [\"1\", \"5\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[3] == \"O\" && (board.cells[0] == \"X\"|| board.cells[1] == \"X\"|| board.cells[4] == \"X\" || board.cells[6] == \"X\" || board.cells[7] == \"X\")\n ai_move = [\"4\", \"5\", \"6\", \"8\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[4] == \"O\" && (board.cells[0] == \"X\"|| board.cells[1] == \"X\"|| board.cells[2] == \"X\" || board.cells[3] == \"X\" || board.cells[5] == \"X\" || board.cells[6] == \"X\" || board.cells[7] == \"X\" || board.cells[8] == \"X\")\n ai_move = [\"1\", \"3\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[5] == \"O\" && (board.cells[1] == \"X\"|| board.cells[2] == \"X\"|| board.cells[4] == \"X\" || board.cells[7] == \"X\" || board.cells[8] == \"X\")\n ai_move = [\"3\", \"4\", \"5\", \"9\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[6] == \"O\" && (board.cells[3] == \"X\"|| board.cells[4] == \"X\"|| board.cells[7] == \"X\")\n ai_move = [\"1\", \"3\", \"5\", \"9\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[7] == \"O\" && (board.cells[3] == \"X\"|| board.cells[4] == \"X\"|| board.cells[5] == \"X\" || board.cells[6] == \"X\" || board.cells[8] == \"X\")\n ai_move = [\"2\", \"5\", \"7\", \"9\"]\n ai_move.sample\n elsif @players == \"O\" && board.cells[8] == \"O\" && (board.cells[4] == \"X\"|| board.cells[5] == \"X\"|| board.cells[7] == \"X\")\n ai_move = [\"1\", \"3\", \"5\", \"6\"]\n ai_move.sample\n\n else\n ai_move = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\n ai_move.sample\n# def move(board)\n# ai_move = [\"2\", \"4\", \"6\", \"8\"]\n# ai_move.sample\n# elsif (board.cells[1] || board.cells[3] || board.cells[5] || board.cells[7]) == \"X\"\n# ai_move = [\"1\", \"3\", \"5\", \"7\", \"9\"]\n# ai_move.sample\n# elsif (board.cells[0] || board.cells[2] || board.cells[4] || board.cells[6] || board.cells[8]) == \"O\"\n# ai_move = [\"2\", \"4\", \"6\", \"8\"]\n# ai_move.sample\n# elsif (board.cells[1] || board.cells[3] || board.cells[5] || board.cells[7]) == \"O\"\n# ai_move = [\"1\", \"3\", \"5\", \"7\", \"9\"]\n# ai_move.sample\n# else\n# ai_move = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"]\n# ai_move.sample\n end\n end",
"def second_move() \n\t\tif first_move == false && board[4].class = Fixnum\n\t\t\tboard[4] = marker\n\t\telse\n\t\t\tcorner\n\t\tend\n\tend",
"def move to_move\r\n\t\tif to_move == 0\r\n\t\t\tvia_road = driver.location.west_road\r\n\t\t\tdriver.location = driver.location.west_location\r\n\t\t\treturn via_road\r\n\t\telsif to_move == 1\r\n\t\t\tvia_road = driver.location.north_road\r\n\t\t\tdriver.location = driver.location.north_location\r\n\t\t\treturn via_road\r\n\t\telsif to_move == 2\r\n\t\t\tvia_road = driver.location.east_road\r\n\t\t\tdriver.location = driver.location.east_location\r\n\t\t\treturn via_road\r\n\t\telsif to_move == 3\r\n\t\t\tvia_road = driver.location.south_road\r\n\t\t\tdriver.location = driver.location.south_location\r\n\t\t\treturn via_road\r\n\t\tend\r\n\t\t\r\n\tend",
"def read_next_move\n\t\t\t\tms = read_acpc_matchstate\n\t\t\t\treturn ms[:last_action]\n\t\t\tend",
"def perfect_move(marker, index)\n\t\tif board[index] == perfect_move\n\t\t\tboard[index] = marker\n\tend\n\n\t#final moves in order to win\n\tdef win(board, marker)\n\t\t#horizontal top\n\t\tif board[0] && board[1] == marker\n\t\t\tboard[2] == perfect_move\n\t\telsif board[0] && board[2] == marker\n\t\t\tboard[1] == perfect_move\n\t\telsif board[1] && board[2] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#horiz middle\n\t\telsif board[3] && board[4] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[3] && board[5] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[5] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#horiz bottom\n\t\telsif board[6] && board[7] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[6] && board[8] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[7] && board[8] == marker\n\t\t\tboard[6] == perfect_move\n\t\t#vertical left\n\t\telsif board[0] && board[3] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[3] && board[6] == marker\n\t\t\tboard[0] == perfect_move\n\t\telsif board[0] && board[6] == marker\n\t\t\tboard[3] == perfect_move\n\t\t#vert middle\n\t\telsif board[1] && board[4] == marker\n\t\t\tboard[7] == perfect_move\n\t\telsif board[1] && board[7] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[7] == marker\n\t\t\tboard[1] == perfect_move\n\t\t#vert right\n\t\telsif board[2] && board[5] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[2] && board[8] == marker\n\t\t\tboard[5] == perfect_move\n\t\telsif board[5] && board[8] == marker\n\t\t\tboard[2] == perfect_move\n\t\t#diaginal top left \n\t\telsif board[0] && board[4] == marker\n\t\t\tboard[8] == perfect_move\n\t\telsif board[0] && board[8] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[8] == marker\n\t\t\tboard[0] == perfect_move\n\t\t#diag bottom left\n\t\telsif board[2] && board[4] == marker\n\t\t\tboard[6] == perfect_move\n\t\telsif board[2] && board[6] == marker\n\t\t\tboard[4] == perfect_move\n\t\telsif board[4] && board[6] == marker\n\t\t\tboard[2] == perfect_move\n\t\telse\n\n\t\tend\n\tend\n\n\t#blocks an opponent from making the winning move\n\tdef block(human, marker, index)\n\t\tif human[marker] == win\n\t\t\tboard[index] = perfect_move\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend\n\n\tdef fork()\n\tend\n\n\tdef fork_block()\n\tend\n\n\tdef opposite_corner()\n\tend\n\n\tdef empty_corner()\n\tend\n\n\tdef empty_side()\n\tend\n\nend",
"def perfect_move(marker, index)\r\n\t\tif board[index] == perfect_move\r\n\t\t\tboard[index] = marker\r\n\tend\r\n\r\n\t#final moves in order to win\r\n\tdef win(board, marker)\r\n\t\t#horizontal top\r\n\t\tif board[0] && board[1] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telsif board[0] && board[2] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\telsif board[1] && board[2] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#horiz middle\r\n\t\telsif board[3] && board[4] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[3] && board[5] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[5] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#horiz bottom\r\n\t\telsif board[6] && board[7] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[6] && board[8] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[7] && board[8] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\t#vertical left\r\n\t\telsif board[0] && board[3] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[3] && board[6] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\telsif board[0] && board[6] == marker\r\n\t\t\tboard[3] == perfect_move\r\n\t\t#vert middle\r\n\t\telsif board[1] && board[4] == marker\r\n\t\t\tboard[7] == perfect_move\r\n\t\telsif board[1] && board[7] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[7] == marker\r\n\t\t\tboard[1] == perfect_move\r\n\t\t#vert right\r\n\t\telsif board[2] && board[5] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[2] && board[8] == marker\r\n\t\t\tboard[5] == perfect_move\r\n\t\telsif board[5] && board[8] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\t#diagonal top left \r\n\t\telsif board[0] && board[4] == marker\r\n\t\t\tboard[8] == perfect_move\r\n\t\telsif board[0] && board[8] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[8] == marker\r\n\t\t\tboard[0] == perfect_move\r\n\t\t#diag bottom left\r\n\t\telsif board[2] && board[4] == marker\r\n\t\t\tboard[6] == perfect_move\r\n\t\telsif board[2] && board[6] == marker\r\n\t\t\tboard[4] == perfect_move\r\n\t\telsif board[4] && board[6] == marker\r\n\t\t\tboard[2] == perfect_move\r\n\t\telse\r\n\r\n\t\tend\r\n\tend\r\n\r\n\t#blocks an opponent from making the winning move\r\n\tdef block(human, marker, index)\r\n\t\tif human[marker] == win\r\n\t\t\tboard[index] = perfect_move\r\n\t\t\ttrue\r\n\t\telse\r\n\t\t\tfalse\r\n\t\tend\r\n\tend\r\n\r\n\tdef fork()\r\n\tend\r\n\r\n\tdef fork_block()\r\n\tend\r\n\r\n\tdef opposite_corner()\r\n\tend\r\n\r\n\tdef empty_corner()\r\n\tend\r\n\r\n\tdef empty_side()\r\n\tend\r\n\r\nend",
"def next_move gameboard\n result_pairs = []\n\n gameboard.valid_moves.each do |move|\n new_gameboard = gameboard.move move\n result_pairs << { score: new_gameboard.score, move: move } unless gameboard.equal_tile_layout? new_gameboard\n end\n\n result_pairs.sort_by{ |s| s[:score] }.reverse.first[:move]\n end",
"def moves(board, start_pos)\n end",
"def next_moves(my_color = true)\n color = my_color ? @my_color : @opponent_color\n @board.next_moves(color)\n end",
"def make_move(board)\n puts \"Opponent is thinking...\\n\"\n minimax(board, @char, 0)\n if board.update('O', @choice[0], @choice[1])\n board.draw\n puts \"Opponent chose coordinates (#{@choice[0]+1}, #{@choice[1]+1})\\n\"\n else\n puts \"Something went wrong. The opponent made an illegal move.\\n\"\n end\n end",
"def winning_state_for_next_move?\n # for each possible move that could be made:\n # return true if the move leaves a losing_state_for_next_move for the opponent\n # else\n # false\n # end\n\n\n # a player can win with one move\n # / there is a move that makes true losing_state_for_next_move\n\n # if you can set up 1,1,1 by making your move, it's a winning move\n end",
"def move(board)\n \trandom_move(board)\n\tend",
"def state_next_gen(matrix,next_matrix,x,y)\r\n #Get number of neighbors\r\n matrix[[x,y]].get_neighbor(matrix)\r\n #Rules for live cells\r\n if matrix[[x,y]].state==1\r\n if matrix[[x,y]].live_neighbor<2||matrix[[x,y]].live_neighbor>3\r\n next_matrix[[x,y]].die\r\n else next_matrix[[x,y]].live\r\n end\r\n #Rules for dead cells\r\n else\r\n if matrix[[x,y]].live_neighbor==3\r\n next_matrix[[x,y]].live\r\n else next_matrix[[x,y]].die\r\n end\r\n end\r\nend",
"def move \n while true \n choose_next_position \n if [:found, :fail].include? @result\n break \n end\n end\n end",
"def first_move\n if color == 'black'\n if y_position == 1\n return 2\n else\n return 1\n end\n elsif y_position == 6\n return 2\n else\n return 1\n end\n end",
"def make_move(player)\n # clone the board state, because the training data must have the state before the move and the move itself.\n previous_state = @board.state.clone\n position = player.select_move(@board)\n @board.state[position] = player.value\n player.moves << position\n puts \"#{player.stone} set on #{position}\" if @display_output\n move = [0] * 9\n move[position] = player.value\n return [previous_state, move].flatten\n end",
"def find_move(board)\n\t\tcell_found = nil\n\t\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\t\thash = Hash.new\n\t\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\t\t# finds a possible win move\n\t\t\tif(hash.values.count(\"O\") == 1 && hash.values.count(\" \") == 2)\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend\n\t\tcell_found\n\tend",
"def move(board)\n if !board.taken?(\"5\")\n board = \"5\"\n elsif board.turn_count == 1\n board = \"1\"\n elsif board.turn_count == 2\n board = [\"3\", \"7\", \"9\"].detect do |position|\n !board.taken?(position)\n end\n elsif board.turn_count > 2 && board.turn_count < 6\n win_combo_array = []\n Game::WIN_COMBINATIONS.select do |win_combo|\n if ((board.position((win_combo[0] + 1).to_s) == opponent_token) && (board.position((win_combo[1] + 1).to_s) == opponent_token)) ||\n ((board.position((win_combo[1] + 1).to_s) == opponent_token) && (board.position((win_combo[2] + 1).to_s) == opponent_token)) ||\n ((board.position((win_combo[2] + 1).to_s) == opponent_token) && (board.position((win_combo[0] + 1).to_s) == opponent_token)) == true\n win_combo_array << win_combo\n end\n end\n number_at_index = win_combo_array[0].select do |number|\n position_number = (number + 1).to_s\n if board.position(position_number) != opponent_token\n position_number\n end\n end\n board = (number_at_index[0] + 1).to_s\n else\n win_combo_array = []\n Game::WIN_COMBINATIONS.select do |win_combo|\n if ((board.position((win_combo[0] + 1).to_s) == token) && (board.position((win_combo[1] + 1).to_s) == token)) ||\n ((board.position((win_combo[1] + 1).to_s) == token) && (board.position((win_combo[2] + 1).to_s) == token)) ||\n ((board.position((win_combo[2] + 1).to_s) == token) && (board.position((win_combo[0] + 1).to_s) == token)) == true\n win_combo_array << win_combo\n end\n end\n number_at_index = win_combo_array[0].select do |number|\n position_number = (number + 1).to_s\n if board.position(position_number) != opponent_token\n position_number\n end\n end\n board_n = (number_at_index[0] + 1).to_s\n board = final_moves(board, board_n)\n end\n end",
"def movement(row1, col1, board)\n\n possible_moves=Array.new\n if @color==\"white\"\n # checking square in front\n if row1+1<8 && board.get_square(row1+1,col1).occupied==false\n possible_moves <<[row1+1,col1]\n\n #checking 2 squares forward\n if @position==\"initial\" && !board.get_square(row1+2,col1).occupied\n possible_moves <<[row1+2,col1]\n end\n end\n\n # checking attacking squares\n if row1+1<8 && col1-1>=0\n atk_sq1 = board.get_square(row1+1,col1-1)\n\n if atk_sq1.occupied && atk_sq1.piece.color != @color || !atk_sq1.occupied && atk_sq1.en_passanted\n possible_moves <<[row1+1,col1-1]\n end\n end\n if row1+1<8 && col1+1<8\n atk_sq2 = board.get_square(row1+1,col1+1)\n if atk_sq2.occupied && atk_sq2.piece.color != @color || !atk_sq2.occupied && atk_sq2.en_passanted\n possible_moves <<[row1+1,col1+1]\n end\n end\n\n elsif @color==\"black\"\n # checking square in front\n if row1-1>=0 && board.get_square(row1-1,col1).occupied==false\n possible_moves <<[row1-1,col1]\n\n # checking for 2 squares forward\n if @position==\"initial\" && board.get_square(row1-2,col1).occupied==false\n possible_moves <<[row1-2,col1]\n end\n end\n\n # checking attacking squares\n if row1-1>=0 && col1-1>=0\n atk_sq1 = board.get_square(row1-1,col1-1)\n if (atk_sq1.occupied && atk_sq1.piece.color != @color) || (!atk_sq1.occupied && atk_sq1.en_passanted)\n possible_moves <<[row1-1,col1-1]\n end\n end\n if row1-1>=0 && col1+1<8\n atk_sq2 = board.get_square(row1-1,col1+1)\n if (atk_sq2.occupied && atk_sq2.piece.color != @color) || (!atk_sq2.occupied && atk_sq2.en_passanted)\n possible_moves <<[row1-1,col1+1]\n end\n end\n end\n\n #removing moves that go off the board\n possible_moves = possible_moves.select do |a|\n a[0]>=0 && a[0]<8 && a[1]>=0 && a[1]<8\n end\n\n return possible_moves\n\n end",
"def choose_move\n puts \"#{current_player}, select a cell to place your #{whose_turn}. Select a number between 1 - 9.\"\n move = gets.chomp.to_i\n puts\n\n # If move is valid and is not taken, then create a key-value pair in @taken: number => X or O.\n if valid_move?(move) && !taken?(move)\n @taken[move] = whose_turn\n update_board(move)\n # When it is not a valid move and the cell is not taken\n elsif !valid_move?(move) && !taken?(move)\n puts \"That is not a valid choice. Please select a number between 1 and 9.\"\n \t# When it is a valid move and the cell is taken \n elsif valid_move?(move) && taken?(move)\n puts \"That one has already been taken. Please select another cell.\"\n end\n end",
"def successor_function(board, player)\n states = []\n actions = []\n 6.times do |row|\n 6.times do |col|\n if board[row][col] == 0\n #copy the board and set the indeces to the player's glyph\n copiedBoard = copy_board(board)\n copiedBoard[row][col] = player\n states.push(copiedBoard)\n actions.push([row, col])\n end\n end\n end\n return actions, states\n end",
"def get_cpu_move(board, player)\n # for the first move, the cpu will pick one of the four corners randomly.\n if board.is_empty then\n if rand(2) == 1 then\n row = 0\n else \n row = 2\n end\n\n if rand(2) == 1 then\n col = 0\n else\n col = 2\n end\n return row, col \n else\n # otherwise, it will find the best move to play that eliminates\n # its chances of losing\n return minimax(board, player)[1]\n end\nend",
"def move(board,position,choice=\"X\")\n iPosition = position.to_i\n board[iPosition-1] = choice\nend",
"def next_direction #:nodoc:\n loop do\n direction = @tries.pop\n nx, ny = @maze.move(@x, @y, direction)\n\n if @maze.valid?(nx, ny) && (@maze[@x, @y] & (direction | (direction << Maze::UNDER_SHIFT)) == 0)\n if @maze[nx, ny] == 0\n return direction\n elsif !@maze.dead?(@maze[nx, ny]) && @maze.weave > 0 && rand(100) < @maze.weave\n # see if we can weave over/under the cell at (nx,ny)\n return direction if @maze.weave_allowed?(@x, @y, nx, ny, direction)\n end\n end\n\n while @tries.empty?\n if @stack.empty?\n @pending = false\n return nil\n else\n @x, @y, @tries = @stack.pop\n end\n end\n end\n end",
"def turn\n \n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def turn\n most_recent_move = current_player.move(@board)\n if !@board.valid_move?(most_recent_move)\n turn\n else\n @board.update(most_recent_move, current_player)\n end\n end",
"def each_move\n SQ.select { |i| @colors[i] == @mx }.each do |f|\n if @pieces[f] == PAWN\n t = f + UP[@mx]\n yield(f, t + 1) if @colors[t + 1] == @mn && SQ120[SQ64[t] + 1] != NULL\n yield(f, t - 1) if @colors[t - 1] == @mn && SQ120[SQ64[t] - 1] != NULL\n next unless @colors[t] == EMPTY\n yield(f, t)\n yield(f, t + UP[@mx]) if @colors[t + UP[@mx]] == EMPTY && (f >> 3) == (SIDE[@mx] - 1).abs\n next\n end\n STEPS[@pieces[f]].each do |s|\n t = SQ120[SQ64[f] + s]\n while t != NULL\n yield(f, t) if @colors[t] != @mx\n break if @pieces[f] == KING || @pieces[f] == KNIGHT || @colors[t] != EMPTY\n t = SQ120[SQ64[t] + s]\n end\n end\n end\n end",
"def get_next_state(matrix,x2,y2)\r\n if 1==matrix[[@x+x2,@y+y2]].state\r\n @live_neighbor=@live_neighbor.to_i+1\r\n end\r\n end",
"def findNextState\n # Allow a :catch transition if the explicit value was not found.\n if @state_list[@state][@transition].nil? && !@state_list[@state][:catch].nil?\n @transition = :catch\n end\n\n # Attempt to find a suitable state given the most recent @transition value.\n if !@state_list[@state][@transition].nil?\n transition = @state_list[@state][@transition]\n else\n raise \"Unable to locate a transition from \\\"#{@state}\\\" using the transition \\\"#{@transition}\\\"\"\n end\n\n if !transition.nil? && !transition.wait.nil?\n @wait = transition.wait\n else\n @wait = 0\n end\n\n if !transition.nil? && !transition.retries.nil?\n @retries = transition.retries\n else\n @retries = 0\n end\n\n transition.attempts += 1\n if transition.retries > 0\n if transition.attempts > transition.retries\n raise \"Too many retries\"\n end\n end\n\n @state = transition.to\n end",
"def get_computer_move(board, computer_letter)\n # Straghten out the letters in play\n if computer_letter == 'X'\n player_letter = 'O'\n else\n player_letter = 'X'\n end\n \n # First, check if the computer can win in the next move\n (BOARD_RANGE).each do |i|\n copy = copy_board(board)\n if space_available?(copy, i)\n make_move(copy, computer_letter, i)\n if winner?(copy, computer_letter)\n return i\n end\n end\n end\n \n # Block the player if he is going to win\n (BOARD_RANGE).each do |i|\n copy = copy_board(board)\n if space_available?(copy, i)\n make_move(copy, player_letter, i)\n if winner?(copy, player_letter)\n return i\n end\n end\n end\n \n # Check to see if the player has made a strategic move.\n # If player chose center, take a corner\n if board[4] == player_letter\n move = choose_random_move(board, [0, 2, 6, 8])\n if move != nil\n return move\n end\n end\n\n # If player chose corner, take the center\n if board[0] == player_letter ||\n board[2] == player_letter ||\n board[6] == player_letter ||\n board[8] == player_letter\n\n if space_available?(board, 4)\n return 4\n else\n return choose_random_move(board, [1, 3, 5, 7])\n end\n end\n\n # ...else, the computer will make a strategic move.\n # Take corner first\n move = choose_random_move(board, [0, 2, 6, 8])\n if move != nil\n return move\n end\n \n # Take center\n if space_available?(board, 4)\n return 4\n end\n \n # All else fails, take a side\n choose_random_move(board, [1, 3, 5, 7])\n end",
"def state\n State.new(board_size, moves)\n end",
"def move(board)\n\t\tgood = false\n\t\tuntil good == true\n\t\t\t@board.board = board\t\t\n\t\t\tai_pieces = Array.new\n\t\t\t@board.board.each do |key, piece|\n\t\t\t\tif piece.color == 'black'\n\t\t\t\t\tai_pieces << key\n\t\t\t\tend\n\t\t\tend\n\t\t\tai_pieces.each do |piece|\n\t\t\tend\n\t\t\tpiece_to_move = ai_pieces[rand(ai_pieces.length)]\n\t\t\tavailable_moves = board[piece_to_move].moves\n\t\t\tif available_moves.length > 0\n\t\t\t\ttarget = available_moves[rand(available_moves.length)]\n\t\t\t\tgood = @board.move(piece_to_move, target, 'black')\n\t\t\tend\n\t\tend\n\t\t@board\n\tend",
"def minimax(board, player) \n\n # First check to see if the game has been won. If it has, then\n # return 1 if the current player is the winner, because this state\n # has a minimax score of 1 for the player, and return -1 if the\n # other player is the winner, because this state has a minimax\n # score of -1 for the player (since the opponent wins)\n if board.game_over then\n return [-1, [-1, -1]]\n end\n\n move = [-1, -1]\n score = -2 # lower than the lowest possible score\n\n [0, 1, 2].each do |row|\n [0, 1, 2].each do |col| # all possible locations\n if board.state[row][col] == \" \" then # only valid moves\n new_board_state = board.get_copy\n new_board_state.state[row][col] = player\n\n # negate the opponent's score.\n score_for_this_move = -1 * (minimax(new_board_state, get_opposite_player(player))[0])\n\n if score_for_this_move > score then \n\n score = score_for_this_move\n\n move[0] = row\n move[1] = col\n end\n end\n end\n end\n\n # no possible moves, it's a draw\n if move[0] == -1 then\n return [0, move]\n end\n \n return [score, move]\nend",
"def get_move(state)\n value = min_max(state, FIXNUM_MIN, FIXNUM_MAX, true)\n result_action\n end",
"def winning_move\n win_combo = WIN_COMBINATIONS.find do |combo|\n (@board.cells[combo[0]] == @token && @board.cells[combo[1]] == @token && @board.cells[combo[2]] == \" \") || (@board.cells[combo[0]] == @token && @board.cells[combo[2]] == @token && @board.cells[combo[1]] == \" \") || (@board.cells[combo[1]] == @token && @board.cells[combo[2]] == @token && @board.cells[combo[0]] == \" \")\n end\n if win_combo != nil\n win_cell = win_combo.find do |spot|\n @board.cells[spot] == \" \"\n end\n end\n end",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n end\n end",
"def try_move(move)\n\t\tsetup if !ready?\n\n\t\t# gen all possible moves\n\t\tmoves = generate_moves(self.pieces, self.turn)\n\t\treturn nil if moves.length == 0\n\t\tvalid_move = moves.find { | m | m.from == move.from && m.to == move.to }\n\t\treturn nil if valid_move.nil?\n\n\t\t# filter out moves that would leave us in check\n\t\tmoves = filter_for_self_check(self.pieces, moves, self.turn)\n\t\treturn nil if moves.length == 0\n\t\tvalid_move = moves.find { | m | m.from == move.from && m.to == move.to }\n\t\treturn nil if valid_move.nil?\n\n\t\t# perform the move\n\t\tvalid_move = perform_move(valid_move)\n\t\tif valid_move.promoted.nil?\n\t\t\tvalid_move = update_after_move(valid_move)\n\t\tend\n \n\t\t# create a new board and set it equal to this one, then save it\n\t\tnext_board = Board.new\n\t\tnext_board.game = self.game\n\t\tnext_board.set(self.fen)\n\t\tif !next_board.save!\n\t\t\treturn nil\n\t\tend\n\n\t\t# finally return our move to the game model\n\t\treturn valid_move\n\tend",
"def next_move\n return false if @n.zero? && @grid.empty?\n show_path\n end",
"def pick_move(state)\n legal_moves = @game.legal_moves(state)\n # Check to see whether any moves have not yet been tried\n untried_moves = []\n untried_moves = legal_moves.select { |move|\n !@state_stats.has_key?(@game.next_state(state, move))\n }\n\n # If all moves tried, pick using upper confidence bound\n if untried_moves.empty?\n return ubt_move(state)\n end\n \n # If moves remain untried, pick one at random\n untried_moves.sample\n end",
"def next_turn(ending_cup_idx)\n return :prompt if ending_cup_idx == 6 || ending_cup_idx == 13\n return :switch if @cups[ending_cup_idx].count == 1\n return ending_cup_idx\n end",
"def update_move\n if !@ch.moving? && @moves.size > 0\n @moves.shift if proccess_move(@moves[0])\n end\n end",
"def state x, y, m, n, board\n old_state = board[ x ][ y ]\n live_count = 0\n (x-1..x+1).each { |i|\n (y-1..y+1).each { |j|\n if i == x and j == y\n next\n end\n if 0 <= i and i < m and 0 <= j and j < n\n if wasLive board[ i ][ j ]\n live_count = live_count + 1\n end\n end\n }\n }\n if wasLive old_state\n if live_count == 2 or live_count == 3\n new_state = 1\n else\n new_state = 2\n end\n else\n if live_count == 3\n new_state = 3\n else\n new_state = 0\n end\n end\n new_state\nend",
"def next_state(column, row)\n live_count = 0\n [ [-1, 1], [0, 1], [1, 1],\n [-1, 0], [1, 0],\n [-1, -1], [0, -1], [1, -1] ].each do |xo, yo|\n live_count += cell_alive?(column + xo, row + yo) ? 1 : 0\n end\n if cell_alive?(column, row)\n KEEP_LIVING_NEXT_GENERATION[live_count] ? 2 : 0\n else\n SPAWN_NEXT_GENERATION[live_count] ? 1 : -1\n end\n end",
"def move(board)\n if self.can_win(board) # First, checks to see if it can win\n array = self.can_win(board)\n game_ending_position(array, board)\n elsif self.must_stop_opp(board) # Second, checks to see if it must stop opposing win\n array = self.must_stop_opp(board)\n game_ending_position(array, board)\n else # Third, makes a random move (Game.turn will ensure the move is valid)\n rand(1..9).to_s\n end\n end",
"def next_state\n newstate = state_transition_out\n newiteration = @iteration\n if [:day, :signup].include?(@state)\n newiteration = @iteration + 1\n end\n @state = newstate\n @iteration = newiteration\n #state_transition_in\n @state\n end",
"def choose_move(player, check)\n\t\t@viable_move = false\n\t\tfinish = nil\n\t\tstart = get_space(player, check, \"start\", nil)\n\t\tif start == \"save\"\n\t\t\tsave_game\n\t\t\tstart = nil\n\t\tend\n\t\tfinish = get_space(player, check, \"finish\", start) unless start == nil\n\t\tif finish != nil\n\t\t\t@board.move(start, finish)\n\t\t\t@viable_move = true\n\t\tend\n\tend",
"def calculate_next_board\n next_board = Array.new(size) { Array.new(size) }\n\n current_board.each_with_index do |row_items, row|\n row_items.each_with_index do |_col_items, col|\n next_board[row][col] = calculate_next_cell_state(row, col)\n end\n end\n @current_board = next_board\n end",
"def find_best_move\n return 5 if @board.unmarked_keys.count == 9\n\n bests = { val: -INFINITY, move: nil }\n\n board.squares.each do |cell, square|\n if square.unmarked?\n move_val = simulate_computer_move(cell)\n if move_val > bests[:val]\n bests[:val] = move_val\n bests[:move] = cell\n end\n end\n end\n bests[:move]\n end",
"def get_move(game_board)\n position = game_board.index(\"\") # get the index of the first open position\n move = @moves[position] # get the corresponding location for the index\n end",
"def make_move(move)\n\t\t@board.make_move(move)\n\t\t@skipped=false\n\tend",
"def get_move\n\t\tif(row_winning_move)\n\t\t\treturn row_winning_move\n\t\tend\n\t\tif(column_winning_move)\n\t\t\treturn column_winning_move\n\t\tend\n\t\tif(left_diag_winning_move)\n\t\t\treturn left_diag_winning_move\n\t\tend\n\t\tif(right_diag_winning_move)\n\t\t\treturn right_diag_winning_move\n\t\tend\n\n\t\t[rand(3), rand(3)]\n\tend",
"def do_move()\n\n loop do\n # prompt or retreive for initial position\n if @first_move\n initialPos = prompt_for_postion(\"[#{@name}] Initial position: \")\n else\n initialPos = @last_location\n end\n\n # prompt for new position\n newPos = prompt_for_postion(\"[#{@name}] New position: \")\n\n # complete action using positions\n action = @current_board.action(newPos, initialPos, @colour)\n\n # respond to action result\n case (action)\n when :E, :P\n @first_move = true\n @last_location = [0,0]\n return action\n when :A, :W\n @last_location = newPos\n @first_move = false\n return action\n end\n end\n end",
"def move board\n free_pieces = board.free_pieces\n piece = free_pieces.random\n moves = board.possible_moves(piece)\n return [piece.x, piece.y], moves.random \n end",
"def step!(next_state)\n @state = case @state\n when :a\n next_state == :b ? :b : :a\n when :b\n [:a, :c].include?(next_state) ? next_state : :b\n when :c\n :d\n else\n :a\n end\n end",
"def best_move\n\t\tpossible_moves.send(@turn == \"x\" ? :max_by: :min_by) { |idx| minimax(idx) }\n\tend",
"def move_piece(move, color) \n squares = find_start_and_end(move) # [start, end]\n\n return false if @display[squares[0][0]][squares[0][1]].guest == ' '\n\n start_piece = @display[squares[0][0]][squares[0][1]].guest\n\n return false if start_piece.color != color \n\n moves = get_legal_moves(squares[0], start_piece, start_piece.poss_moves(squares[0]))\n\n\n if moves.include?(squares[1])\n\n # castling\n if start_piece.id == 'king' && start_piece.color == 'white' && squares[1] == [7, 1] \n make_move(squares[0], squares[1], start_piece)\n make_move([7, 0], [7, 2], @display[0][0].guest)\n elsif start_piece.id == 'king' && start_piece.color == 'black' && squares[1] == []\n make_move(squares[0], squares[1], start_piece)\n make_move([0, 0], [0, 2], @display[7][0].guest)\n\n # pawn -> queen upgrade\n elsif start_piece.id == 'pawn' && start_piece.color == 'white' && squares[1][0].zero?\n make_move(squares[0], squares[1], Queen.new('white'))\n elsif start_piece.id == 'pawn' && start_piece.color == 'black' && squares[1][0] == 7\n make_move(squares[0], squares[1], Queen.new('black'))\n\n else\n make_move(squares[0], squares[1], start_piece)\n end\n else\n false\n end\n end"
] |
[
"0.76031125",
"0.7554846",
"0.7477962",
"0.7418566",
"0.7414143",
"0.7375111",
"0.7278632",
"0.7238594",
"0.72340727",
"0.7228966",
"0.7159433",
"0.71560174",
"0.7136547",
"0.7114396",
"0.70930517",
"0.7041221",
"0.7032134",
"0.6998281",
"0.69622576",
"0.69289726",
"0.69189376",
"0.6909867",
"0.6903884",
"0.6901753",
"0.68989956",
"0.6881753",
"0.687419",
"0.6874172",
"0.6866082",
"0.6859713",
"0.6853956",
"0.6834176",
"0.6814904",
"0.68126416",
"0.6798875",
"0.6783368",
"0.67748415",
"0.67620116",
"0.67571807",
"0.673181",
"0.6716187",
"0.6691782",
"0.66847336",
"0.6684452",
"0.66728103",
"0.6655905",
"0.66437924",
"0.66436875",
"0.6625259",
"0.6594723",
"0.6593",
"0.6592808",
"0.65919137",
"0.6576334",
"0.6568737",
"0.65672314",
"0.65641135",
"0.6556692",
"0.65444535",
"0.6543932",
"0.65337926",
"0.65328926",
"0.6527898",
"0.6526943",
"0.65251625",
"0.65220547",
"0.6513555",
"0.6512199",
"0.6512199",
"0.65075207",
"0.6505647",
"0.6485923",
"0.64769626",
"0.64667284",
"0.64661956",
"0.6463177",
"0.64594024",
"0.64577794",
"0.6451214",
"0.6446626",
"0.64440423",
"0.64399624",
"0.64389104",
"0.6438095",
"0.6422583",
"0.6413597",
"0.64125794",
"0.6411117",
"0.6408601",
"0.64033425",
"0.6402905",
"0.64000887",
"0.63943094",
"0.6391231",
"0.6385641",
"0.63837135",
"0.63722",
"0.63596815",
"0.6354277",
"0.6348821"
] |
0.641749
|
85
|
Checks for imminent victory and takes it
|
def victory(board)
opponent_token = find_opponent_token
victory_options = []
WIN_COMBINATIONS.each do |combo|
if combo.reject {|i| board.cells[i] == @token}.length == 1
victory_options << combo.detect {|i| board.cells[i] == " "}
end
end
victory_move = victory_options.first
if victory_move != nil
(victory_move+=1).to_s
end
victory_move
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def check_victory\n if victory?\n $windows.msg_win.msg.set_text(I18n.t(:player) + ($player.act_p.mark_markup == $glob.x_markup ? ' O ' : ' X ') + I18n.t(:win))\n $windows.msg_win.show_all\n elsif $glob.num_moves >= 8\n $windows.msg_win.msg.set_text(I18n.t(:draw))\n $windows.msg_win.show_all\n end\n end",
"def checkVictory\n if @player.x > @exitDoor.x - @exitDoor.width / 2 and @player.x < @exitDoor.x + @exitDoor.width / 2 and @player.y >\n @exitDoor.y - @exitDoor.height / 2 and @player.y < @exitDoor.y + @exitDoor.height / 2\n winGame\n end\n end",
"def check_victory_condition\n\t\t@winner = @board.victory?\n\n\t\tif @winner == 'X'\n\t\t\t@player_2.declare_defeated @board, @id, 2\n\t\t\t@player_1.declare_victorious @board, @id, 1\n\t\t\ttrue\n\t\telsif @winner == 'O'\n\t\t\t@player_2.declare_victorious @board, @id, 2\n\t\t\t@player_1.declare_defeated @board, @id, 1\n\t\t\ttrue\n\t\telsif @winner == 'DRAW'\n\t\t\t@player_2.declare_draw @board, @id, 2\n\t\t\t@player_1.declare_draw @board, @id, 1\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"def victory_phase?\n @phase == :victory\n end",
"def process_victory\n return if @victory; @victory = true\n $game_system.battle_end_me.play if CP::VICTORY::USE_ME && !skip?\n RPG::BGM.fade(500) unless skip? || CP::VICTORY::USE_ME\n 20.times do; Graphics.update; end\n SceneManager.scene.close_status_window\n Audio.return_audio if $imported[\"CP_CROSSFADE\"]\n play_battle_end_me unless skip? ## Skip the bgm change again.\n @phase = :victory\n SceneManager.scene.show_victory_windows\n exp = gain_exp\n gold = gain_gold\n gain_drop_items\n turns = $game_troop.turn_count\n dlt = Grade.score_items[:damage].dealt\n rcv = Grade.score_items[:damage].recieved\n SceneManager.scene.update_scores(dlt, rcv, turns)\n SceneManager.scene.update_window_rates(exp, gold, Grade.rate[4])\n SceneManager.scene.exp_window_update(exp)\n return true\n end",
"def victory?\n x = $last_btn.x\n y = $last_btn.y\n vic = false\n if x == 0\n vic = check_2_btns($glob.btns.by_c(x + 1,y),$glob.btns.by_c(x + 2,y))\n elsif x == 1\n vic = check_2_btns($glob.btns.by_c(x + 1,y),$glob.btns.by_c(x - 1,y))\n else\n vic = check_2_btns($glob.btns.by_c(x - 1,y),$glob.btns.by_c(x - 2,y))\n end\n if vic == false\n if y == 0 \n vic = check_2_btns($glob.btns.by_c(x,y + 1),$glob.btns.by_c(x,y + 2))\n elsif y == 1\n vic = check_2_btns($glob.btns.by_c(x,y + 1),$glob.btns.by_c(x,y - 1))\n else\n vic = check_2_btns($glob.btns.by_c(x,y - 1),$glob.btns.by_c(x,y - 2))\n end \n else\n return vic\n end \n if vic == false\n if x == 0 and y == 0\n vic = check_2_btns($glob.btns.by_c(1,1),$glob.btns.by_c(2,2))\n elsif x == 2 and y == 2\n vic = check_2_btns($glob.btns.by_c(0,0),$glob.btns.by_c(1,1))\n elsif x == 2 and y == 0\n vic = check_2_btns($glob.btns.by_c(1,1),$glob.btns.by_c(0,2))\n elsif x == 0 and y == 2\n vic = check_2_btns($glob.btns.by_c(1,1),$glob.btns.by_c(2,0))\n elsif x == 1 and y == 1\n vic = check_2_btns($glob.btns.by_c(0,0),$glob.btns.by_c(2,2))\n return vic if vic != false\n vic = check_2_btns($glob.btns.by_c(2,0),$glob.btns.by_c(0,2))\n end \n end \n return vic\n end",
"def victory(player) # Recense toutes les conditions de victoire (8 au total)\n\n if @cells[0].value == @cells[1].value && @cells[1].value == @cells[2].value\n return true\n\n elsif @cells[3].value == @cells[4].value && @cells[4].value == @cells[5].value\n return true\n\n elsif @cells[6].value == @cells[7].value && @cells[7].value == @cells[8].value\n return true\n\n elsif @cells[0].value == @cells[3].value && @cells[3].value == @cells[6].value\n return true\n\n elsif @cells[1].value == @cells[4].value && @cells[4].value == @cells[7].value\n return true\n\n elsif @cells[2].value == @cells[5].value && @cells[5].value == @cells[8].value\n return true\n\n elsif @cells[2].value == @cells[4].value && @cells[4].value == @cells[6].value\n return true\n\n elsif @cells[0].value == @cells[4].value && @cells[4].value == @cells[8].value\n return true\n\n end\n end",
"def victory_check(player_name, player_icon, game_over)\n player_victory = [player_icon, player_icon, player_icon] # player's icon needs to appear consecutively 3 times\n\n\n victory_1 = [@board[0], @board[1], @board[2]]\n victory_2 = [@board[3], @board[4], @board[5]]\n victory_3 = [@board[6], @board[7], @board[8]]\n victory_4 = [@board[0], @board[3], @board[6]]\n victory_5 = [@board[1], @board[4], @board[7]]\n victory_6 = [@board[2], @board[5], @board[8]]\n victory_7 = [@board[0], @board[4], @board[8]]\n victory_8 = [@board[2], @board[4], @board[6]]\n\n # check different victory conditions to see if the current player has won the game\n if ((player_victory.eql?(victory_1)) || (player_victory.eql?(victory_2)) || (player_victory.eql?(victory_3)) || (player_victory.eql?(victory_4)) ||\n(player_victory.eql?(victory_5)) || (player_victory.eql?(victory_6)) || (player_victory.eql?(victory_7)) || (player_victory.eql?(victory_8)))\n @winner = player_name\n @game_over = true\n else\n return\n end\n\n end",
"def vertical_victory(b)\n win = false\n\n (1..BOARD_WIDTH).each do |i|\n column_values = board_column_values(b, i)\n win = i if victory_column?(column_values)\n end\n\n win\nend",
"def victory(player)\n condition1 = @board[0..2].all? { |i| i == player}\n condition2 = @board[3..5].all? { |i| i == player}\n condition3 = @board[6..8].all? { |i| i == player}\n condition4 = @board[0] == player && @board[3] == player && @board[6] == player\n condition5 = @board[1] == player && @board[4] == player && @board[7] == player\n condition6 = @board[2] == player && @board[5] == player && @board[8] == player\n condition7 = @board[0] == player && @board[4] == player && @board[8] == player\n condition8 = @board[2] == player && @board[4] == player && @board[6] == player\n \n if condition1 || condition2 || condition3 || condition4 || condition5 || condition6 || condition7 || condition8\n true\n else\n false\n end\n end",
"def victory\n @wins += 1\n end",
"def victory?\n !!get_winner\n end",
"def victory_loss(victory)\n if victory\n @points += 1\n else\n return @points\n end\n end",
"def victory?\n @code == @last_guess\n end",
"def victory?\n # Loop over all Nx1 lines in the board\n [*@board, *columns, *diagonals].each do |line|\n return :x if line.all?(:x)\n return :o if line.all?(:o)\n end\n\n false\n end",
"def victory?\n if @morpion[1] == @morpion[2] && @morpion[1] == @morpion[3] && @morpion[1] != @morpion[0]\n if @morpion[1] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n end\n return true\n elsif @morpion[4] == @morpion[5] && @morpion[4] == @morpion[6] && @morpion[4] != @morpion[0]\n if @morpion[4] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n end\n return true\n elsif @morpion[7] == @morpion[8] && @morpion[7] == @morpion[9] && @morpion[7] != @morpion[0]\n if @morpion[7] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n elsif @morpion[1] == @morpion[5] && @morpion[1] == @morpion[9] && @morpion[1] != @morpion[0]\n if @morpion[1] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n elsif @morpion[3] == @morpion[5] && @morpion[3] == @morpion[7] && @morpion[3] != @morpion[0]\n if @morpion[3] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n elsif @morpion[1] == @morpion[4] && @morpion[1] == @morpion[7] && @morpion[1] != @morpion[0]\n if @morpion[1] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n elsif @morpion[2] == @morpion[5] && @morpion[2] == @morpion[8] && @morpion[2] != @morpion[0]\n if @morpion[2] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n elsif @morpion[3] == @morpion[6] && @morpion[3] == @morpion[9] && @morpion[3] != @morpion[0]\n if @morpion[3] == \"X\"\n puts \"Fécilication #{player1.name}, tu as gagné\"\n exit\n else\n puts \"Fécilication #{player2.name}, tu as gagné\"\n exit\n end\n return true\n end\n end",
"def victorymethod\r\n\tputs \"\"\r\n\tputs \"\"\r\n\tputs \"\"\r\n\tputs \"*******************************************************************************************************\"\r\n\t\r\n\tif $v25 == 0 and $v50 == 0 and $v75 == 0\r\n\t\tflawlessvictory\r\n\telse \r\n\t\tif $v25 == 1 and $v50 == 0 and $v75 == 0\r\n\t\t\tvictory25\r\n\t\telse \r\n\t\t\tif $v25 == 0 and $v50 == 1 and $v75 == 0\r\n\t\t\t\tvictory50\r\n\t\t\telse \r\n\t\t\t\tif $v25 == 0 and $v50 == 0 and $v75 == 1\r\n\t\t\t\t\tvictory75\r\n\t\t\t\telse \r\n\t\t\t\t\tif $v25 == 1 and $v50 == 1 and $v75 == 0\r\n\t\t\t\t\t\tvictory2550\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\tif $v25 == 1 and $v50 == 0 and $v75 == 1\r\n\t\t\t\t\t\t\tvictory2575\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\tif $v25 == 0 and $v50 == 1 and $v75 == 1\r\n\t\t\t\t\t\t\t\tvictory5075\t\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\tif $v25 == 1 and $v50 == 1 and $v75 == 1\r\n\t\t\t\t\t\t\t\t\tvictory255075\r\n\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\r\nend",
"def horizontal_victory(b)\n win = false\n\n (1..BOARD_HEIGHT).each do |i|\n row_values = board_row_values(b, i)\n win = i if victory_row?(row_values)\n end\n\n win\nend",
"def victory_check\n if @word == @player\n @game_over = true\n puts \"Victory!\"\n elsif @wrong_count >= 5\n @game_over = true\n puts \"Defeat!\"\n puts \"The word was: '#{@word.join('')}'\"\n end\n end",
"def victory\n if self.enemies.count == 0\n self.groups.destroy_all\n if self.owner.present_kingdom && (@tax = (self.gold * self.owner.present_kingdom.tax_rate/100.0).to_i) > 0\n Kingdom.pay_tax(@tax, self.owner.in_kingdom)\n self.update_attribute(:gold, self.gold - @tax)\n end\n PlayerCharacter.transaction do\n self.owner.lock!\n self.owner.gold += self.gold\n self.owner.save!\n end\n @items=[]\n self.items.each{|i| PlayerCharacterItem.update_inventory(self.owner_id,i.item_id,i.quantity)\n @items << i.quantity.to_s + \" \" + (i.quantity > 1 ? i.item.name.pluralize : i.item.name) }\n return {:gold => self.gold, :tax => @tax, :items => @items}\n else\n return false\n end\n end",
"def victory\n @current_player = @players[\"plyr2\"]\n unless @winner == false\n @over = true\n puts \" \"\n puts \" Code-breaker #{@current_player} wins!!\"\n puts \" \"\n end\n end",
"def check_for_victory(word, new_progress_message)\n if word == @new_progress_message\n @victory = true\n true\n end\nend",
"def victory?\n if @board_game.hash_board[\"a1\"] == @player1.symbol && @board_game.hash_board[\"b1\"] == @player1.symbol && @board_game.hash_board[\"c1\"] == @player1.symbol ||\n @board_game.hash_board[\"a2\"] == @player1.symbol && @board_game.hash_board[\"b2\"] == @player1.symbol && @board_game.hash_board[\"c2\"] == @player1.symbol ||\n @board_game.hash_board[\"a3\"] == @player1.symbol && @board_game.hash_board[\"b3\"] == @player1.symbol && @board_game.hash_board[\"c3\"] == @player1.symbol ||\n @board_game.hash_board[\"a1\"] == @player1.symbol && @board_game.hash_board[\"a2\"] == @player1.symbol && @board_game.hash_board[\"a3\"] == @player1.symbol ||\n @board_game.hash_board[\"b1\"] == @player1.symbol && @board_game.hash_board[\"b2\"] == @player1.symbol && @board_game.hash_board[\"b3\"] == @player1.symbol ||\n @board_game.hash_board[\"c1\"] == @player1.symbol && @board_game.hash_board[\"c2\"] == @player1.symbol && @board_game.hash_board[\"c3\"] == @player1.symbol ||\n @board_game.hash_board[\"a1\"] == @player1.symbol && @board_game.hash_board[\"b2\"] == @player1.symbol && @board_game.hash_board[\"c3\"] == @player1.symbol ||\n @board_game.hash_board[\"c1\"] == @player1.symbol && @board_game.hash_board[\"b2\"] == @player1.symbol && @board_game.hash_board[\"a3\"] == @player1.symbol \n return @player1\n elsif @board_game.hash_board[\"a1\"] == @player2.symbol && @board_game.hash_board[\"b1\"] == @player2.symbol && @board_game.hash_board[\"c1\"] == @player2.symbol ||\n @board_game.hash_board[\"a2\"] == @player2.symbol && @board_game.hash_board[\"b2\"] == @player2.symbol && @board_game.hash_board[\"c2\"] == @player2.symbol ||\n @board_game.hash_board[\"a3\"] == @player2.symbol && @board_game.hash_board[\"b3\"] == @player2.symbol && @board_game.hash_board[\"c3\"] == @player2.symbol ||\n @board_game.hash_board[\"a1\"] == @player2.symbol && @board_game.hash_board[\"a2\"] == @player2.symbol && @board_game.hash_board[\"a3\"] == @player2.symbol ||\n @board_game.hash_board[\"b1\"] == @player2.symbol && @board_game.hash_board[\"b2\"] == @player2.symbol && @board_game.hash_board[\"b3\"] == @player2.symbol ||\n @board_game.hash_board[\"c1\"] == @player2.symbol && @board_game.hash_board[\"c2\"] == @player2.symbol && @board_game.hash_board[\"c3\"] == @player2.symbol ||\n @board_game.hash_board[\"a1\"] == @player2.symbol && @board_game.hash_board[\"b2\"] == @player2.symbol && @board_game.hash_board[\"c3\"] == @player2.symbol ||\n @board_game.hash_board[\"c1\"] == @player2.symbol && @board_game.hash_board[\"b2\"] == @player2.symbol && @board_game.hash_board[\"a3\"] == @player2.symbol \n return @player2 \n else\n return false \n end\n end",
"def victory?\n self.grid.flatten.select {|space| !space.mine }.\n all? {|space| space.visible }\n end",
"def adjust_shiny_iv\n return if !self.shiny_ebdx\n # check cached data as well\n d1 = EliteBattle.get(:nextBattleData)\n d1 = (d1 && d1[:PERFECT_IVS]) ? d1[:PERFECT_IVS] : nil\n d2 = EliteBattle.get_data(self.species, :Species, :PERFECT_IVS)\n # set perfect IVs for shiny mons\n perfect = self.superShiny? ? EliteBattle::PERFECT_IV_SUPER : EliteBattle::PERFECT_IV_SHINY\n perfect = [perfect, (d1 ? d1 : 0), (d2 ? d2 : 0)].max\n return if !perfect.is_a?(Numeric) || perfect < 1\n stats = self.iv.keys.clone\n # apply stats\n [perfect, stats.length].min.times do\n i = rand(stats.length)\n self.iv[stats[i]] = Pokemon::IV_STAT_LIMIT\n stats.delete_at(i)\n end\n # recalculate stats\n self.calc_stats\n end",
"def handle_victory(_fighter)\n raise(NotImplementedError, 'A Fighter must know how to handle victory.')\n end",
"def victory_check?\n\t\toutcome = []\n\t\toutcome << three_in_a_row? << three_in_a_column? << three_in_a_diagonal?\n\t\toutcome.each do |element|\n\t\t\tif element[0] == true\n\t\t\t\t@playing = false\n\t\t\t\tputs \"GAME OVER\"\n\t\t\t\tif element[1] == @player.letter\n\t\t\t\t\tputs \"YOU WIN!\"\n\t\t\t\telse\n\t\t\t\t\tputs \"COMPUTER WINS!\"\n\t\t\t\tend\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\n\t\tif @board.available_spaces.size == 0\n\t\t\t@playing = false\n\t\t\tputs \"GAME OVER\"\n\t\t\tputs \"TIE!\"\n\t\tend\n\tend",
"def has_victory?\n vertical_c4? || horizontal_c4? || diagonal_c4?\n end",
"def game_over?\n return true if victory? || (@turns == 12)\n false\n end",
"def victory?\n won = false\n @board.winning_combos.each do |combo|\n won = true if (combo & @other_player.squares) == combo\n end\n won\n end",
"def victory_screen\n system 'clear'\n 'GAME OVER'\n Catpix::print_image \"victory_screen.jpg\",\n :limit_x => 1.0,\n :limit_y => 0,\n :center_x => true,\n :center_y => true,\n :bg => \"white\",\n :bg_fill => true\n abort(\"See you next time.\".red)\nend",
"def victim_tunneled\n\t\t\t\tbegin\n\t\t\t\t\treturn find(XSSF_VICTIM_DB, XSSF_VICTIM_HASH, {\"TUNNELED\" => true, \"ACTIVE\" => true})\n\t\t\t\trescue\n\t\t\t\t\tprint_error(\"Error 16: #{$!}\") if (XSSF_MODE[0] =~ /^Debug$/i)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn nil\n\t\t\tend",
"def victorious\n @victories ||= 0\n @victories += 1\n self\n end",
"def attacking_vertical?\n false\n end",
"def check_victory(number)\n\t\t3.times do |i|\n\t\t\tif @board[i][0] == board[i][1] && board[i][1] == board[i][2] && @board[i][0] != 0\n\t\t\t\treturn true\n\t\t\telsif @board[0][i] == board[1][i] && board[1][i] == board[2][i] && @board[0][i] != 0\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\t\tif @board[2][0] == board[1][1] && board[1][1] == board[0][2] && @board[0][2] != 0\n\t\t\treturn true\n\t\telsif @board[0][0] == board[1][1] && board[1][1] == board[2][2] && @board[2][2] != 0\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def track_victory(winnerofturn) #algorythmic\n if winnerofturn == @Player1\n @win_counter[\"P1\"] += 1\n elsif winnerofturn == @Player2\n @win_counter[\"P2\"] += 1\n end\n end",
"def victor\n return @attack_initiator if @attack_initiator.soldiers_alive.count > 0\n return @other_army if @other_army.soldiers_alive.count > 0\n end",
"def check_captive_behind_enemy \n return true if @captives > 0 and check_for_a_bomb and \n warrior.feel(:left).empty? and !warrior.feel(:left).wall? and\n warrior.look(:forward)[1].to_s.to_sym == :Captive and\n warrior.look(:forward)[0].to_s.to_sym == :Sludge\n return false\n end",
"def stop_if_not_passable\n ## TODO: BUGGED: STOPS IF HITS WATER\n tempx = ($game_map.screen.pictures[@picture_index].x) / 32\n tempy = ($game_map.screen.pictures[@picture_index].y) / 32\n if $game_map.check_passage(tempx.round, tempy.round, 0x0200) || $game_map.check_passage(tempx.round, tempy.round, 0x0400)\n return true\n else\n if $game_map.check_passage(tempx.round, tempy.round, 0x0f) #|| $game_map.check_passage(tempx.round, tempy.round, 0x0800)\n return false\n end\n end\n return true\n end",
"def continue\n @victory = false\n @level += 1\n drawFromPixmap\n end",
"def winGame\n @victory = true\n if @level == 2\n @win = true\n end\n end",
"def run(opponent)\n rand(EscapeRate) == 0\n end",
"def detect_injury \n @last_hit = time unless events['got_hit'].empty? \n if @last_hit and time - @last_hit < 4\n say('hit')\n @turn_speed = @FAST_TURN \n elsif @last_hit and (time - @last_hit < 10)\n say('not hit')\n @turn_speed = rand(1...@NORMAL_TURN) \n end \n end",
"def game_over?\n if victory?\n puts \"The code has been broken!\"\n true\n elsif (@turns == 12)\n puts \"The codebreaker failed.\"\n true\n else\n false\n end\n end",
"def invited_or_captain\n self.captain || invited?\n end",
"def set_victory_battlecry\n @victory_battlercry_battler\n battle_cry_set = []\n for battler in $game_party.actors\n if check_bc_basic(battler, \"VICTORY\") and not battler.dead?\n battle_cry_set << battler\n end\n end\n unless battle_cry_set.empty? or $game_temp.no_actor_victory_bc\n @victory_battlercry_battler = rand(battle_cry_set.size)\n end \n if @last_active_actor != nil and not @last_active_actor.dead? and not\n $game_temp.no_actor_victory_bc and battle_cry_set.include?(@last_active_enemy)\n @victory_battlercry_battler = @last_active_actor\n end\n battle_cry_basic(@victory_battlercry_battler, \"VICTORY\") if @victory_battlercry_battler != nil\n end",
"def attempt(x,y) \n if x >@height or y> @height\n abort(\"Invalid coordinates!\")\n end\n\n if not isMine(x,y)\t\t\n #puts \"LOOSE\"\n @status = \"LOOSE\\nYou Loose!\"\t\n else\n #puts \"BOOOOOM\"\n @status = \"BOOOOOM\\nYou Won!\"\t\n end \n end",
"def victory(joueur)\n\t\t# On définit les 8 possibilités de victoires si elles se vérifient les 3 dans la combinaison donnée alors la partie s'arrête\n\t\tif (plateau[0] == joueur.value) && (plateau[1] == joueur.value) && (plateau[2] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\n\t\telsif (plateau[3] == joueur.value) && (plateau[4] == joueur.value) && (plateau[5] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telsif (plateau[0] == joueur.value) && (plateau[3] == joueur.value) && (plateau[6] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telsif (plateau[2] == joueur.value) && (plateau[4] == joueur.value) && (plateau[6] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telsif (plateau[0] == joueur.value) && (plateau[4] == joueur.value) && (plateau[8] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telsif (plateau[2] == joueur.value) && (plateau[5] == joueur.value) && (plateau[8] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telsif (plateau[1] == joueur.value) && (plateau[4] == joueur.value) && (plateau[7] == joueur.value)\n\t\t\tputs \"#{joueur.name} a eu plus de chance que toi ¯\\_(ツ)_/¯\"\n\t\t\tdisplay\n\t\t\texit\n\t\telse\n\t\t\treturn\n\t\tend\n\tend",
"def update_bitmap\n # Check if hiding HP from enemy view is true\n if @unit.army.officer.hide_hp and !@unit.army.playing\n self.bitmap = RPG::Cache.picture(\"hp_hide\")\n else # Display normal HP value\n # If unit has damage on it\n if @unit.unit_hp < 10\n self.bitmap = RPG::Cache.picture(\"hp_\" + @unit.unit_hp.to_s)\n # Otherwise, draw no flag\n else\n self.bitmap = nil\n end\n end\n end",
"def test_consumes_a_victim\n werewolf = Werewolf.new(\"Josh\")\n victim = Victim.new\n assert_equal :alive, victim.status\n assert_equal 0, werewolf.victims\n werewolf.change!\n werewolf.feed(victim)\n assert_equal 1, werewolf.victims\n assert_equal :dead, victim.status\n\n end",
"def i_hit(others, velocity); end",
"def play_out\n begin\n make_move(choose_move) until @minefield.clear?\n DISPLAY.call 'Victory!'\n rescue TrippedMineError\n DISPLAY.call 'Boom!'\n return false\n end\n true\n end",
"def attacked_victims\n\t\t\t\tbegin\n\t\t\t\t\tvictims = Hash.new(\"victims\")\n\n\t\t\t\t\tfind_all(XSSF_WAITING_ATTACKS_DB, XSSF_WAITING_ATTACKS_HASH).each do |wa|\n\t\t\t\t\t\tvictims.has_key?([XSSF_WAITING_ATTACKS_HASH[\"VICTIM_ID\"]]) ? (victims[[XSSF_WAITING_ATTACKS_HASH[\"VICTIM_ID\"]]] = victims[[XSSF_WAITING_ATTACKS_HASH[\"VICTIM_ID\"]]] + 1) : (victims[[XSSF_WAITING_ATTACKS_HASH[\"VICTIM_ID\"]]] = 1)\n\t\t\t\t\tend\n\t\t\t\trescue\n\t\t\t\t\tprint_error(\"Error 18: #{$!}\") if (XSSF_MODE[0] =~ /^Debug$/i)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif (not victims.empty?)\n\t\t\t\t\tstr = \"Remaining victims to attack: \"\n\t\t\t\t\tvictims.each_pair {|key, value| str << \"[#{key} (#{value})] \" }\n\t\t\t\t\tprint_good(str) if not (XSSF_MODE[0] =~ /^Quiet$/i)\n\t\t\t\telse\n\t\t\t\t\tprint_good(\"Remaining victims to attack: NONE\") if not (XSSF_MODE[0] =~ /^Quiet$/i)\n\t\t\t\tend\n\t\t\tend",
"def double_check\n if any_damage?\n @used = true\n @missed = false\n @evaded = false\n end\n end",
"def attack (row, col, grid)\n\t\t$error = 0\n\t\t$hit = 0\n\t\tif grid == 1\n\t\t\tgrid = $comp\n\t\t\tgridshow = $shots\n\t\telse\n\t\t\tgrid = $shot_at\n\t\t\tgridshow = $shot_at\n\n\t\tend\n\n\t\tgridshow\n\n\t\trow -=1\n\t\tcol -=1\n\n\t\tcase grid[row][col]\n\t\twhen 0\n\t\t\tgrid[row][col] = \"X\"\n\t\t\tgridshow[row][col] = \"X\"\n\n\t\t\tif grid == $comp\n\t\t\t\tputs \"You missed.\"\n\t\t\telse\n\t\t\t\tputs \"They missed!\"\n\t\t\tend\n\n\t\twhen 1\n\t\t\tif grid == $comp\n\t\t\t\tputs \"YOU HIT THEIR SHIP!\"\n\t\t\telse\n\t\t\t\tputs \" YOU HAVE BEEN HIT!\"\n\t\t\tend\n\t\t\tgrid[row][col] = \"*\"\n\t\t\tgridshow[row][col] = \"*\"\n\t\t\t$hit = 1\n\t\telse\n\t\t\twrong\n\t\t\t$error = 1\n\t\tend\n\tend",
"def diagonal_victory(b)\n if victory_diagonal?(board_diagonal_values(b, true))\n 1\n elsif victory_diagonal?(board_diagonal_values(b, false))\n 2\n else\n false\n end\nend",
"def clear_shot? warrior\n\t\tlook = warrior.look :forward\n\t\tdistance_to_enemy2 = look.index { |space| space.enemy? == true } || MAX_LOOK\n\t\tdistance_to_captive2 = look.index { |space| space.captive? == true } || MAX_LOOK\n\t\t@direction = :forward if distance_to_enemy2 < distance_to_captive2\n\t\tlook = warrior.look :backward\n\t\tdistance_to_enemy = look.index { |space| space.enemy? == true } || MAX_LOOK\n\t\tdistance_to_captive = look.index { |space| space.captive? == true } || MAX_LOOK\n\t\t@direction = :backward if distance_to_enemy < distance_to_captive\n\t\t!@took_damage && ((distance_to_enemy < distance_to_captive) || (distance_to_enemy2 < distance_to_captive2)) \n\tend",
"def draw?\n !victory? && @board.flatten.compact.size == 9\n end",
"def update event\n @image.fill :white\n enemy_in_range?\n attack! unless @target.nil?\n end",
"def update\n if idle?\n if Gosu.distance(@hb.x,@hb.y,$WINDOW.player.hb.x, $WINDOW.player.hb.y) < 150\n # If distance is 150 or less, behaviour changes to approaching\n change_state(GameStates::States::WALKING)\n @vect_v = 1\n @vect_angle = Gosu.angle(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y)\n end\n elsif walking?\n # While walking, wolf tries to approach the main character\n @vect_angle = Gosu.angle(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y)\n if @una_check_tiks <= 0\n # When next attack check counter reaches 0, wolf can attack.\n dieroll = Random.rand\n if dieroll <= ATTACK_PROBABILITY\n # If random is within attack probability, the wolf changes behaviour to attack\n change_state(GameStates::States::ATTACKING)\n @event_tiks =60\n @vect_v = 0\n else\n #If random is not within attack probability, next attack check counter is reset to 30.\n @una_check_tiks = 30\n end\n end\n check_change_dir\n elsif attacking?\n # If attacking, wolf waits for a little while, then charges in a straight line. Then waits a little while.\n if @event_tiks > 20\n check_change_dir\n elsif @event_tiks == 20\n @vect_angle = Gosu.angle(@hb.x, @hb.y, $WINDOW.player.hb.x, $WINDOW.player.hb.y)\n @vect_v = 3.5\n elsif @event_tiks == 10\n @venct_v = 0\n elsif @event_tiks <= 0\n change_state(GameStates::States::IDLE)\n @una_check_tiks = 100\n end\n end\n\n if normal? && $WINDOW.player.inv_frames <= 0 && !$WINDOW.player.recoiling? && @hb.check_brute_collision($WINDOW.player.hb)\n # If it connects with player, player is set to impacted.\n $WINDOW.player.impacted(@hb.center, @attack_dmg)\n end\n\n if !idle? && Gosu.distance(@hb.x,@hb.y,$WINDOW.player.hb.x, $WINDOW.player.hb.y) > 250\n #If distance surpasses 250, the wolf turns back to idle.\n change_state(GameStates:States::IDLE)\n end\n\n super\n @una_check_tiks -= 1 unless idle? || @una_check_tiks <= 0\n end",
"def handle_victory(entity)\n # Determine the rewards for defeating the entity.\n gold = entity.sample_gold\n treasure = entity.sample_treasures\n\n add_loot(gold, [treasure]) unless gold.nil? && treasure.nil?\n end",
"def flying?\n not $game_map.screen.pictures[@picture_index].name == \"\"\n end",
"def did_player_win\n (@purses[@current_player] != 6)\n end",
"def attack() stat(:attack) end",
"def isLoose?\r\n @hitpoint <= 0\r\n end",
"def isLoose?\r\n @hitpoint <= 0\r\n end",
"def evaluate(board, player = 'o', opponent = 'x')\r\n # Checking rows for victory\r\n 3.times do |row|\r\n if are_equal?(board[row][0], board[row][1], board[row][2], player, opponent)\r\n return player?(board[row][0], player, opponent)\r\n end\r\n end\r\n # Checking cols for victory\r\n 3.times do |col|\r\n if are_equal?(board[0][col], board[1][col], board[2][col], player, opponent)\r\n return player?(board[0][col], player, opponent)\r\n end\r\n end\r\n # Checking frist diagonal for victory\r\n return player?(board[0][0], player, opponent) if are_equal?(board[0][0], board[1][1], board[2][2], player, opponent)\r\n # Checking second diagonal for victory\r\n return player?(board[0][2], player, opponent) if are_equal?(board[0][2], board[1][1], board[2][0], player, opponent)\r\n # If none of them have won\r\n 0\r\n end",
"def play_until_victory \n\tuntil victory == true \n\t\t first_player_plays\n\t\t second_player_plays\n\tend\n end",
"def in_hidden_entrance\r\n\r\n # Determine the tile placement, as integers \r\n tile_x = (@player.get_x/16).to_i\r\n tile_y = (@player.get_y/16).to_i\r\n\r\n # Hidden tile is present, so return true\r\n if @level[1][tile_y-1][tile_x] > 0 then\r\n return true\r\n\r\n # Otherwise the player is no longer hidden\r\n else\r\n return false\r\n end\r\n end",
"def tunnel_victim(id)\n\t\t\t\tbegin\n\t\t\t\t\tdelete(XSSF_WAITING_ATTACKS_DB, XSSF_WAITING_ATTACKS_HASH, {\"VICTIM_ID\" => id.to_i})\n\t\t\t\t\tctx = update_all(XSSF_VICTIM_DB, XSSF_VICTIM_HASH, {\"TUNNELED\" => true}, {\"ID\" => id.to_i, \"ACTIVE\" => true})\n\n\t\t\t\t\tTUNNEL.clear\n\t\t\t\t\t\n\t\t\t\t\tif (ctx == 0)\n\t\t\t\t\t\treturn nil\n\t\t\t\t\telse\n\t\t\t\t\t\treturn victim_tunneled\n\t\t\t\t\tend\n\t\t\t\trescue\n\t\t\t\t\tprint_error(\"Error 15: #{$!}\") if (XSSF_MODE[0] =~ /^Debug$/i)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn nil\n\t\t\tend",
"def game_over\n @lives == 0\n end",
"def winning_shot\n @computer.board.hits == 5\n end",
"def game_over\n print_board\n if victor?\n puts \"#{self.victor?} is the victor!\"\n elsif @turn_count == 10\n puts \"Game is a draw.\"\n end\n end",
"def original_photo(photourl)\n if(current_user.upvotes.find_by(photourl: photourl) || current_user.downvotes.find_by(photourl: photourl)) \n return false\n end\n return true\nend",
"def graphic_changed?\n @tile_id != @character.tile_id ||\n @character_name != @character.character_name ||\n @character_index != @character.character_index ||\n (@character.moving? && @character_bitmap_name != \"\" && @character_bitmap_name.include?(\"_STATIC\") && @character.anime_count > 0) ||\n (!@character.moving? && @character_bitmap_name != \"\" && !@character_bitmap_name.include?(\"_STATIC\") && @character.stop_count > 0)\n end",
"def check_out_of_world # swap size\n # y\n if @y < 0\n die\n elsif @y > WINDOW_SIZE_Y\n die\n end\n # x ( comment me out to add the glitch feature agian )\n if @x < 0\n @x = WINDOW_SIZE_X - TILE_SIZE - 2\n elsif @x > WINDOW_SIZE_X - TILE_SIZE - 1\n @x = 0\n end\n end",
"def handlePossibleAccident\n return false unless rand < @driver.accident\n\n @lastSpeed = @nextSpeed = Velocity::Zero\n @fixTime = World.time + RepairTime\n @bodyEnd = @bodyStart - @length\n @totalAccidents += 1\n\n true\n end",
"def projectile_collide(projectile)\r\r\n return if self.erased\r\r\n return if projectile.erased\r\r\n return if projectile.owner == self.owner\r\r\n return if projectile.projectile.id == self.projectile.id\r\r\n kill_judgement projectile\r\r\n @move_speed -= 0.1\r\r\n #puts self.hp\r\r\n self.hp -= 1\r\r\n if self.hp <= 0\r\r\n die\r\r\n end\r\r\n #@move_speed = ori_speed\r\r\n end",
"def tile_exception(x, y, d)\n # get pixel movement rate\n pix = $BlizzABS.pixel\n # check direction and return map passability depending on direction\n return case d\n when 2\n (($game_map.virtual_passability[x / pix, (y + pix) / pix] & 0x04 == 0x04) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y + pix) / pix] & 0x02 == 0x02))\n when 4\n (($game_map.virtual_passability[(x - pix) / pix, y / pix] & 0x01 == 0x01) &&\n ($game_map.virtual_passability[(x - pix) / pix, (y + pix) / pix] & 0x08 == 0x08))\n when 6\n (($game_map.virtual_passability[(x + pix) / pix, y / pix] & 0x01 == 0x01) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y + pix) / pix] & 0x08 == 0x08))\n when 8\n (($game_map.virtual_passability[x / pix, (y - pix) / pix] & 0x04 == 0x04) &&\n ($game_map.virtual_passability[(x + pix) / pix, (y - pix) / pix] & 0x02 == 0x02))\n end\n end",
"def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n uc = UCIcon.new(container, Rect.new(0, 24, 24, 24), 1)\n uc.active = false\n uc.draw()\n }\n return true\n end",
"def verify_image_not_in_use\r\n if @image.player_characters.size > 0 || @image.creatures.size > 0 || @image.features.size > 0\r\n flash[:notice] = 'Cannot delete \"' + @image.name + '\", it is in use.'\r\n false\r\n else\r\n true\r\n end\r\n end",
"def handle_victory(entity)\n type(\"You defeated the #{entity.name}!\\n\")\n super(entity)\n print \"\\n\"\n end",
"def confirm_attack\n @active_battler.current_action.set_attack\n process_action\n @windows[Win_Status].clear_dmg_preview\n if (@active_battler != nil)\n @active_battler.perf_action = true\n end\n @windows[Menu_Actor].setup(@active_battler)\n actor_menu_open\n clear_tr_sprites\n end",
"def cheats\n win if @gilbert.x > 2995 && @gilbert.y == 846.5\n end",
"def counter_attack\n block_or_win(opponent_token)\n end",
"def hero_attack\n #ensure hero is within attacking range\n distance_x = @mon_x - @cur_x\n distance_y = @mon_y - @cur_y\n clear_message_box\n if distance_x.abs <= 1 && distance_y.abs <= 1\n #does hero hit the monster?\n skill = @stats[:luck]+@stats[:agility]\n if skill >= Random.rand(skill + (@mon_attack * 2))\n damage = (@attack + Random.rand(@stats[:luck])) / 2\n @mon_strength -= damage\n @ui.place_text(MSG_ATTACK.sample.ljust(20),1,2)\n kill_monster if @mon_strength <= 0\n else\n @ui.place_text(MSG_MISS.ljust(20),1,2)\n end\n else\n @ui.place_text(MSG_MISS.ljust(20),1,2)\n end\n end",
"def unmark_captured(id)\n id = GameData::Pokemon.get_id(id) if id.is_a?(Symbol)\n return if id >= GameData::Pokemon.all.size\n\n if @has_captured[id]\n @has_captured[id] = false\n @captured -= 1\n end\n $game_variables[Yuki::Var::Pokedex_Catch] = @captured\n end",
"def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n uc = UCNumericUpDown.new(container, Rect.new(100, 48, 100, 24), 5)\n uc.active = false\n uc.draw()\n }\n return true\n end",
"def obstructed?( board, mypos, vector )\n\n return false if @function==:knight\n\n if @function==:pawn && vector[0] != 0 \n dest_piece = board[ mypos ^ vector ]\n\n #TODO Pawn#allowed_moves(board) should provide this case\n return false if board.en_passant_square && (mypos ^ vector)==board.en_passant_square.to_sym\n\n return true unless dest_piece && dest_piece.side != self.side\n end\n\n vector.walk do |step|\n if dest_piece = board[ mypos ^ step ]\n return step != vector || dest_piece.side == self.side\n end\n end\n \n return false\n end",
"def update\n if !@parent.active?\n @pauseScreen.applyOn(@parent)\n end\n if @game.currentGuess.grid==@game.correction && @tutoEnd\n @victoryScreen.applyOn(@parent,0,true)\n @game.delete_observers\n end\n end",
"def update\n super\n if BattleManager.in_turn?\n process_event\n process_action\n end\n BattleManager.judge_win_loss unless BattleManager.victory_phase?\n if BattleManager.victory_phase?\n if @victory_score.done and @victory_score.active\n sfx = CP::VICTORY::IMAGE_SFX\n vol = CP::VICTORY::SFX_VOL\n pit = CP::VICTORY::SFX_PIT\n RPG::SE.new(sfx, vol, pit).play unless sfx.nil?\n @victory_score.active = false\n @victory_item.active = true\n end\n end\n end",
"def is_unclaimed?(cell)\n\t\terror = \"Tile already claimed. Please choose again.\"\n\n\t\tcheck(cell.to_s, error)\n\tend",
"def game_over?\n @life <= 0\nend",
"def test_inactive\n [@window, @sprite, @bitmap].each{|container|\n uc = UCCharacterGraphic.new(container, Rect.new(0, 40, 40, 40), $data_actors[1])\n uc.active = false\n uc.draw()\n }\n return true\n end",
"def vote\n\t\t@players.keys.select {|x| @players[x][:state] == :alive}.sample\n\tend",
"def promotion_check\n\t\tif @player_play[1][1] == \"8\" && @current_player.color == \"white\"\n\t\t\tpromotion_menu\n\t\telsif @player_play[1][1] == \"1\" && @current_player.color == \"black\"\n\t\t\tpromotion_menu\n end\n\tend",
"def check()\n row = 0\n while row < @board.length\n if @board[row][@column_number] == @target_number\n @board[row][@column_number] = \"X\"\n end\n row += 1\n end\n display()\n victory() \n end",
"def verify_user_for_changes!\n\n unless @item.editable_by_user?(auth_user)\n status_error = @item.errors[:status].present? ? @item.errors[:status].join(' ') : nil\n flash[:error] = status_error || \"You do not have permission to the item.\"\n redirect_back(items_path) && return\n\n else\n if ItemPhoto.over_the_limit?(@item)\n flash[:notice] = \"The images over the limit will be discarded.\"\n end\n end\n\n end",
"def check_encompassed_area\n @set_upper_area_sprite = false\n top_left, bot_right = get_edge_corner_dis\n last_x, last_y, copy_region = nil, nil, 0\n map_xd, map_yd = $game_map.display_x * 32, $game_map.display_y * 32\n ##total_height = (self.height + @character.jump_height).round\n total_height = (self.oy).round\n self.width.times do |x|\n xp = map_xd.to_i + top_left[0] + x\n unless xp / 32 == last_x\n last_x = xp / 32\n last_y, copy_region = nil, 0\n total_height.times do |y|\n yp = map_yd.to_i + bot_right[1] + @character.jump_height - y\n next if yp.to_i / 32 == last_y\n last_y = yp.to_i / 32\n if last_y == (@character.screen_y + map_yd).to_i / 32\n#~ if last_y == (@character.screen_y + @character.jump_height +\n#~ map_yd).to_i / 32\n break if $game_map.terrain_tag(last_x, last_y) == UpperTerrain\n next\n end\n next if $game_map.terrain_tag(last_x, last_y) != UpperTerrain\n copy_region = [self.height, total_height - y + 1].min\n set_upper_sprite\n break\n end\n end\n next if copy_region == 0\n rect = Rect.new(src_rect.x + x, src_rect.y, 1, copy_region)\n @upper_area_sprite.bitmap.blt(x, 0, self.bitmap, rect)\n self.bitmap.clear_rect(rect)\n end\n if !@set_upper_area_sprite && @upper_area_sprite\n @upper_area_sprite.visible = false\n end\n end",
"def check_victory(my_case_to_check)\n result = 0\n my_case_check_id = (@group_of_case.select { |my_case| my_case.id == my_case_to_check})[0].value\n\n # Verification des lignes\n # case 1 / 4 / 7\n comparaison_array = [1, 4, 7]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_positive(my_case_to_check, 1) && my_case_check_id == select_positive(my_case_to_check, 2)\n result += 2\n end\n end\n # Case 2 / 5 / 8\n comparaison_array = [2, 5, 8]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_negative(my_case_to_check, 1) && my_case_check_id == select_positive(my_case_to_check, 1)\n result += 2\n end\n end\n # Case 3 / 6 / 9\n comparaison_array = [3, 6, 9]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_negative(my_case_to_check, 1) && my_case_check_id == select_negative(my_case_to_check, 2)\n result += 2\n end\n end\n return true if result == 2\n result = 0\n\n # Verification des colonnes\n # case 1 / 2 / 3\n comparaison_array = [1, 2, 3]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_positive(my_case_to_check, 3) && my_case_check_id == select_positive(my_case_to_check, 6)\n result += 2\n end\n end\n # Case 4 / 5 / 6\n comparaison_array = [4, 5, 6]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_negative(my_case_to_check, 3) && my_case_check_id == select_positive(my_case_to_check, 3)\n result += 2\n end\n end\n # Case 7 / 8 / 9\n comparaison_array = [7, 8, 9]\n if comparaison_array.include?(my_case_to_check)\n if my_case_check_id == select_negative(my_case_to_check, 3) && my_case_check_id == select_negative(my_case_to_check, 6)\n result += 2\n end\n end\n return true if result == 2\n result = 0\n\n # Verification diagonale 159\n # Case 1\n if my_case_to_check == 1\n if my_case_check_id == select_positive(my_case_to_check, 4) && my_case_check_id == select_positive(my_case_to_check, 8)\n result += 2\n end\n end\n # Case 5\n if my_case_to_check == 5\n if my_case_check_id == select_negative(my_case_to_check, 4) && my_case_check_id == select_positive(my_case_to_check, 4)\n result += 2\n end\n end\n # Case 9\n if my_case_to_check == 9\n if my_case_check_id == select_negative(my_case_to_check, 4) && my_case_check_id == select_negative(my_case_to_check, 8)\n result += 2\n end\n end\n return true if result == 2\n result = 0\n\n # Verification diagonale 357\n # Case 3\n if my_case_to_check == 3\n if my_case_check_id == select_positive(my_case_to_check, 2) && my_case_check_id == select_positive(my_case_to_check, 4)\n result += 2\n end\n end\n # Case 5\n if my_case_to_check == 5\n if my_case_check_id == select_negative(my_case_to_check, 2) && my_case_check_id == select_positive(my_case_to_check, 2)\n result += 2\n end\n end\n # Case 7\n if my_case_to_check == 7\n if my_case_check_id == select_negative(my_case_to_check, 2) && my_case_check_id == select_negative(my_case_to_check, 4)\n result += 2\n end\n end\n\n true if result == 2\n end"
] |
[
"0.70034283",
"0.6528195",
"0.65093035",
"0.6476447",
"0.6463507",
"0.6397735",
"0.6396897",
"0.63521475",
"0.62655485",
"0.6227879",
"0.62061554",
"0.6175699",
"0.6143567",
"0.60508543",
"0.60150105",
"0.6000873",
"0.59747016",
"0.5935448",
"0.59149325",
"0.58963495",
"0.58765036",
"0.5825596",
"0.5775175",
"0.5746112",
"0.56970847",
"0.5667877",
"0.56316006",
"0.56030405",
"0.5524547",
"0.5483541",
"0.5415314",
"0.5412905",
"0.53975916",
"0.53861874",
"0.5347508",
"0.53080595",
"0.53011215",
"0.5254529",
"0.5245737",
"0.5229807",
"0.5171225",
"0.5149109",
"0.51442593",
"0.51363003",
"0.5116956",
"0.51114255",
"0.511091",
"0.5109707",
"0.508265",
"0.5078907",
"0.5069045",
"0.5068216",
"0.50668305",
"0.5052849",
"0.50477195",
"0.50405806",
"0.5039297",
"0.50363755",
"0.5013989",
"0.5001673",
"0.49991533",
"0.49979264",
"0.49950796",
"0.49891254",
"0.4986884",
"0.4986884",
"0.49860373",
"0.49839494",
"0.49793968",
"0.4971466",
"0.49694976",
"0.49671072",
"0.49623805",
"0.4957949",
"0.49574843",
"0.49548423",
"0.49453655",
"0.49413842",
"0.49403754",
"0.49299425",
"0.49273655",
"0.49223346",
"0.49216196",
"0.49200732",
"0.49175704",
"0.4902108",
"0.4897402",
"0.48925498",
"0.48883447",
"0.4887671",
"0.48853752",
"0.48803964",
"0.48671955",
"0.48663932",
"0.48602054",
"0.4853555",
"0.4853289",
"0.48411882",
"0.48340893",
"0.48322776"
] |
0.56569415
|
26
|
Checks for imminent loss and attempts to block
|
def block(board)
opponent_token = find_opponent_token
block_options = []
WIN_COMBINATIONS.each do |combo|
if combo.reject {|i| board.cells[i] == opponent_token}.length == 1
block_options << combo.detect {|i| board.cells[i] == " "}
end
end
block_move = block_options.first
if block_move != nil
(block_move+=1).to_s
end
block_move
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def judge_win_loss\n return if update_processes or @spriteset.effect?\n #-------------------------------------------------------------\n # Check Victory Conditions\n check_victory_conditions\n\n #-------------------------------------------------------------\n # Check Failure conditions\n check_failure_conditions\n \n #If all Actors dead\n if (friends_of(Battler_Actor).select {|mem| !mem.death_state?}).empty?\n add_fail_com\n end\n update_event_queue\n end",
"def double_check\n if any_damage?\n @used = true\n @missed = false\n @evaded = false\n end\n end",
"def check_for_loss\n if @number_incorrect.to_i == 6\n puts \"Unfortuntately you are out of guesses. Please play again!\"\n exit\n end\n end",
"def attempt(x,y) \n if x >@height or y> @height\n abort(\"Invalid coordinates!\")\n end\n\n if not isMine(x,y)\t\t\n #puts \"LOOSE\"\n @status = \"LOOSE\\nYou Loose!\"\t\n else\n #puts \"BOOOOOM\"\n @status = \"BOOOOOM\\nYou Won!\"\t\n end \n end",
"def block!\n self.update_attribute(:status, BLOCKED)\n end",
"def perform_damage_effect\n end",
"def perform_damage_effect\n end",
"def after_loss\n\n end",
"def blocked?\n (status == BLOCKED)\n end",
"def blocked?\n false\n end",
"def block!\n self.update_attribute(:blocked, true)\n end",
"def for_broke(ci)\n begin\n ci.run\n\n rescue HaltState\n # nop\n rescue err\n puts err.message\n puts 'should not have got this'\n end\nend",
"def execute_damage(user)\n fulfill_conditional if hp - @result.hp_damage <= 0\n mrts_conditional_drops_execute_damage(user) \n end",
"def verify_user_for_changes!\n\n unless @item.editable_by_user?(auth_user)\n status_error = @item.errors[:status].present? ? @item.errors[:status].join(' ') : nil\n flash[:error] = status_error || \"You do not have permission to the item.\"\n redirect_back(items_path) && return\n\n else\n if ItemPhoto.over_the_limit?(@item)\n flash[:notice] = \"The images over the limit will be discarded.\"\n end\n end\n\n end",
"def lose\n process_result 0.0\n end",
"def check_busted\n\t\tif @player.player_busted?\n\t\t\tputs \"You busted.\"\n\t\t\treturn\n\t\telsif @dealer.player_busted?\n\t\t\tputs \"The dealer busted.\"\n\t\t\treturn\n\t\tend\n\tend",
"def did_block?(item, is_crit = false,user)\r\r\n return false unless item.for_opponent?\r\r\n return false if @base_attack_roll == 20\r\r\n return false if item.magical?\r\r\n \r\r\n @base_attack_roll += user.attack_roll(item).to_i\r\r\n \r\r\n rate = 0\r\r\n result = false\r\r\n real_ac = self.armor_class\r\r\n \r\r\n @states.each do |state|\r\r\n real_ac += $data_states[state].armor_class\r\r\n end\r\r\n \r\r\n \r\r\n if actor?\r\r\n for equip in equips\r\r\n next if equip.nil?\r\r\n next if is_crit && !equip.does_block_crit\r\r\n next if !does_block?(equip, item)\r\r\n break if result == true\r\r\n \r\r\n result = true if (real_ac + adjusted_block_rate(equip, item)) > @base_attack_roll\r\r\n end\r\r\n end\r\r\n \r\r\n if !result\r\r\n real_ac = self.armor_class + calc_block_rate(item)\r\r\n end\r\r\n \r\r\n #puts \"THAC0:#{@real_thac0} AC:#{real_ac}\"\r\r\n result = @base_attack_roll + @real_thac0 < real_ac\r\r\n \r\r\n if real_ac > 0 && ($game_system.show_roll_result? || $force_show_roll_result)\r\r\n $game_message.battle_log_add(sprintf(\"** Block Result: **\"))\r\r\n $game_message.battle_log_add(sprintf(\"** %s's %20s\",self.name , \"AC:\" + real_ac.to_s))\r\r\n $game_message.battle_log_add(sprintf(\"** %s's %20s\",user.name , \"Attack Roll(adjusted):\" + (@base_attack_roll + @real_thac0).to_s))\r\r\n end\r\r\n \r\r\n return result\r\r\n end",
"def item_effect_no_recovery(item)\r\n # If HP recovery rate and recovery amount are 0\r\n if item.recover_hp_rate == 0 and item.recover_hp == 0\r\n # Set damage to empty string\r\n self.damage = ''\r\n # If SP recovery rate / recovery amount are 0, and parameter increase\r\n # value is ineffective.\r\n if item.recover_sp_rate == 0 and item.recover_sp == 0 and\r\n (item.parameter_type == 0 or item.parameter_points == 0)\r\n # If state is unchanged\r\n unless @state_changed\r\n # Set damage to \"Miss\"\r\n self.damage = 'Miss'\r\n end\r\n end\r\n end\r\n end",
"def announce_loss\n puts 'You lost, better luck next time!'\n end",
"def blocked?\n fail NotImplementedError\n end",
"def hit!\n # state machine implementation\n @type = case @type\n when BlockType::BLACK\n BlockType::GRAY\n when BlockType::GRAY\n BlockType::RED\n when BlockType::RED\n BlockType::ORANGE\n when BlockType::ORANGE\n BlockType::YELLOW\n else\n BlockType::NONE\n end\n res = @type == BlockType::NONE ? true : false\n possible_bonus! if res\n res\n end",
"def stop_if_not_passable\n ## TODO: BUGGED: STOPS IF HITS WATER\n tempx = ($game_map.screen.pictures[@picture_index].x) / 32\n tempy = ($game_map.screen.pictures[@picture_index].y) / 32\n if $game_map.check_passage(tempx.round, tempy.round, 0x0200) || $game_map.check_passage(tempx.round, tempy.round, 0x0400)\n return true\n else\n if $game_map.check_passage(tempx.round, tempy.round, 0x0f) #|| $game_map.check_passage(tempx.round, tempy.round, 0x0800)\n return false\n end\n end\n return true\n end",
"def checkForLoss (who)\n which_ships = (who == \"me\") ? \"my_ships\" : \"enemy_ships\"\n loss = false\n num_sunk = 0\n fleet = self.send(which_ships).find(:all)\n fleet.each do |ship|\n if ship.sunk\n num_sunk += 1 \n end\n end\n if num_sunk == 7\n loss = true\n self.finished = true\n end\n return loss\n end",
"def lost?\n errors_allowed == 0\n end",
"def each_ungraded_attempt(&block)\n ungraded_attempts.each(&block) \n end",
"def villain_lost(villain)\n if villain.hp <= 0\n villain.update(insane_asylum: true)\n end\n end",
"def loss_checker\n new_board = Marshal.load(Marshal.dump(@board))\n option = move_right || move_left || move_up || move_down\n unless option\n @board = Marshal.load(Marshal.dump(new_board))\n return true\n end\n\n @board = Marshal.load(Marshal.dump(new_board))\n false\n end",
"def block!\n self.update_attribute(:status, ConfigCenter::User::BLOCKED)\n end",
"def correct\n self.gain_or_loss_percent = nil if gain_or_loss_percent != nil and prediction == 'fail'\n puts \"T*!*!*!*!*!*\"\n \n end",
"def on_block_break(evt)\n target_block = evt.block\n player = evt.player\n tool = player.inventory.item_in_main_hand\n return if player.sneaking?\n return unless pickaxe?(tool.type) || spade?(tool.type)\n return unless has_job?(player)\n return unless range_breakable?(target_block)\n\n n = case tool.type\n when Material::IRON_PICKAXE then 1\n when Material::DIAMOND_PICKAXE then 1\n else 1\n end\n\n around_blocks = cubic_around_blocks(target_block, n)\n blocks = around_blocks.reject { |block|\n block.y < player.location.y\n }.select { |block|\n breakable_together?(target_block, block)\n }\n\n blocks.each do |block|\n later(0) do\n block.break_naturally(tool)\n end\n end\n\n end",
"def loss()\n\t return false if (self.score.nil? or self.opponent.score.nil?)\n\t self.score() ? self.score() < self.opponent.score() : false\n\tend",
"def check_rate\n if not @intercom.rate_limit_details[:remaining].nil? and @intercom.rate_limit_details[:remaining] < 2\n sleep_time = @intercom.rate_limit_details[:reset_at].to_i - Time.now.to_i\n puts(\"Waiting for #{sleep_time} seconds to allow for rate limit to be reset\")\n sleep sleep_time\n end\n end",
"def check_rate\n if not @intercom.rate_limit_details[:remaining].nil? and @intercom.rate_limit_details[:remaining] < 2\n sleep_time = @intercom.rate_limit_details[:reset_at].to_i - Time.now.to_i\n puts(\"Waiting for #{sleep_time} seconds to allow for rate limit to be reset\")\n sleep sleep_time\n end\n else\n end",
"def detectCollision\n oldX = @x\n oldY = @y\n @x += @velX\n if isBlocked?\n @x = oldX\n @velX = 0\n death\n return\n end\n @y += @velY\n if isBlocked?\n @y = oldY\n @velY = 0\n death\n return\n end\n end",
"def unstable?\n harm > 3\n end",
"def check_if_lost\n\t\tif @guess_count == @number_guess + 1\n\t\t\t@game_over = 2\n\t\tend\n\t\t@game_over\n\tend",
"def overall\n if @megamgw[:status] != REACHABLE #|| @megamceph[:status] != REACHABLE\n @status = NOT_OK\n end\n end",
"def process_ok\n if $game_temp.est_valid_target.size == 0\n process_cancel\n else\n Sound.play_ok\n Input.update\n deactivate\n call_ok_handler\n end\n end",
"def do_hold(last_check)\n if last_check.off?\n # If the status report says the Equipment is offline, try\n # resending the Task. If that doesn't work, fail and punt to the launcher.\n hold_failure! unless send_to_rhizome\n end\n end",
"def attempt(message, &block)\n perform_action(message, false, @passfail, nil, true, false, &block)\nend",
"def mark_as_unresponsive\n self.available = STATUS_NONRESPONSIVE\n save!\n end",
"def update event\n @image.fill :white\n enemy_in_range?\n attack! unless @target.nil?\n end",
"def check_and_set_gold\n @gold = 0 if @gold.negative?\n end",
"def handle_rescan\n EM.defer { @node.store.rescan }\n {:state => \"Rescanning ...\"}\n end",
"def check_lost\n if @guess_count == MAX_GUESS\n puts \"\\tYou lost! You've used up all your guesses!\"\n self.new_round\n end\n end",
"def verify_image_not_in_use\r\n if @image.player_characters.size > 0 || @image.creatures.size > 0 || @image.features.size > 0\r\n flash[:notice] = 'Cannot delete \"' + @image.name + '\", it is in use.'\r\n false\r\n else\r\n true\r\n end\r\n end",
"def busted?\n\t\treturn hand_busted?(@hand)\n\tend",
"def lose!\n\t\t@bet = 0\n\tend",
"def blocking?\n false\n end",
"def handle_rate_limit(&block)\n begin\n block.call\n rescue Twitter::Error::TooManyRequests => error\n wait_time = error.rate_limit.reset_in + 10\n if @verbose\n minutes = wait_time / 60\n puts\n puts \"RATE LIMIT HIT: Wait #{minutes} minutes.\"\n end\n countdown(wait_time)\n retry\n end\n end",
"def run\n\t\t# initialize board with length\n\t\tlength = checker.pick_secret_word # picks a word, returns length\n\t\t@board = Board.new(length)\n\t\tguesser.receive_secret_length(@board)\n\t\t\n\t\tuntil @misses > MAX_MISSES\n\t\t\t\n\t\t\t# return letter \n\t\t\tguess = guesser.make_guess\n\t\t\t\n\t\t\t# rescue human putting in wrong indices\n\t\t\tbegin\n\t\t\t\t# return array of hits given guess\n\t\t\t\thits_arr = checker.check_guess(guess) \n\t\t\t\t# update @board if there was a hit; else, increment misses\n\t\t\t\thits_arr.empty? ? @misses +=1 : update_board(hits_arr, guess) \n\t\t\trescue Exception => e\n\t\t\t\tputs e.message\n\t\t\t\tretry\n\t\t\tend\n\t\t\t\n\t\t\t# break if the board is over\n\t\t\twon if @board.filled?\n\t\n\t\t\t# if not over, pass updated board to guesser \n\t\t\tguesser.handle_guess_response(@board)\n\t\t\t\n\t\t\t# render new board\n\t\t\t@board.render\n\t\tend\n\t\t\n\t\t# Guesser lost\n\t\tputs \"The guesser lost!\"\n\t\tchecker.reveal_secret\n\t\t\n\tend",
"def read_blocked\n end",
"def cpu_attempt\n (0..6).each do |c|\n token_placed = board_place_token(c)\n if game_result != NO_RESULT_YET # full send\n @state[:result] = game_result\n update_game_phase(GAME_OVER)\n return true\n elsif token_placed # make sure token was placed before force delete\n board_remove_token(c)\n end\n end\n false\n end",
"def raise_unless_connected!\n begin \n @connection.stats\n rescue\n raise Workling::StarlingNotFoundError.new\n end\n end",
"def busy( &block )\n self.connection.status( :dnd, \"Working...\" )\n yield\n self.connection.status( :chat, \"JabberListener waiting for instructions\" )\n end",
"def proceed_internal(user, targets)\n usage_message(user)\n return scene.display_message(parse_text(18, 74)) if rand(100) >= accuracy\n\n actual_targets = accuracy_immunity_test(user, targets) # => Will call $scene.dislay_message for each accuracy fail\n play_animation(user, targets) if actual_targets.any? # TODO: check if that works properly, eg. not playing when the move does nothing\n deal_damage(user, actual_targets) && # TODO: finish\n deal_status(user, actual_targets) && # TODO: DO\n deal_stats(user, actual_targets) && # TODO: DO\n deal_effect(user, actual_targets) && # TODO: DO\n deal_terrain_effect(user, actual_targets) && # TODO: DO\n process_hooks(user, actual_targets) # TODO: rocky_helmet, iron_barbs, rough_skin\n end",
"def best_hand\n raise\n end",
"def check_guess(guess)\n @black_pegs, @white_pegs = @secret.check_code(guess)\n broken?\n end",
"def power_off_blocked\n return @power_off_blocked\n end",
"def attack_effect_miss\r\n self.damage = 'Miss'\r\n self.critical = false\r\n end",
"def block!\n self.blocked = Time.now\n self.save\n end",
"def life_lost\n # if we are attacking ourselves, don't give our life back (otherwise it will never end)\n unless current_user == current_user.previous.player\n # Render the status message and push it to all clients\n message = render_to_string :partial => 'messages/gained_a_life', \n :locals => {:user_1 => current_user.previous.player, :user_2 => current_user}\n send_status_message(message) \n \n # Attacker gains the life that their victim lost\n attacker = current_user.previous.player\n life_gained(attacker)\n end\n ensure\n render :nothing => true\n end",
"def victory_loss(victory)\n if victory\n @points += 1\n else\n return @points\n end\n end",
"def user_is_not_blocked\n return errors.add(:user, 'You cannot block yourself')\\\n if user_id == blocked_id\n end",
"def check_for_implication_loops\n # actually this is tricky\n end",
"def error_retry\n\t\t#@media = Media.find(params[:id])\n\t\t\n\t\tif [:error, :invalid].include? @media.workflow_state.to_sym\n\t\t\t@media.workflow_state = 'checking'\n\t\t\t@media.media_type = nil\n\t\t\t@media.save!\n\t\tend\n\t\t\n\t\t@media.check_media\n\tend",
"def pbRoughDamage(move,user,target,skill,baseDmg)\r\n # Fixed damage moves\r\n return baseDmg if move.is_a?(PokeBattle_FixedDamageMove)\r\n # Get the move's type\r\n type = pbRoughType(move,user,skill)\r\n ##### Calculate user's attack stat #####\r\n atk = pbRoughStat(user,:ATTACK,skill)\r\n if move.function==\"121\" # Foul Play\r\n atk = pbRoughStat(target,:ATTACK,skill)\r\n elsif move.specialMove?(type)\r\n if move.function==\"121\" # Foul Play\r\n atk = pbRoughStat(target,:SPECIAL_ATTACK,skill)\r\n else\r\n atk = pbRoughStat(user,:SPECIAL_ATTACK,skill)\r\n end\r\n end\r\n ##### Calculate target's defense stat #####\r\n defense = pbRoughStat(target,:DEFENSE,skill)\r\n if move.specialMove?(type) && move.function!=\"122\" # Psyshock\r\n defense = pbRoughStat(target,:SPECIAL_DEFENSE,skill)\r\n end\r\n ##### Calculate all multiplier effects #####\r\n multipliers = {\r\n :base_damage_multiplier => 1.0,\r\n :attack_multiplier => 1.0,\r\n :defense_multiplier => 1.0,\r\n :final_damage_multiplier => 1.0\r\n }\r\n # Ability effects that alter damage\r\n moldBreaker = false\r\n if skill>=PBTrainerAI.highSkill && target.hasMoldBreaker?\r\n moldBreaker = true\r\n end\r\n if skill>=PBTrainerAI.mediumSkill && user.abilityActive?\r\n # NOTE: These abilities aren't suitable for checking at the start of the\r\n # round.\r\n abilityBlacklist = [:ANALYTIC,:SNIPER,:TINTEDLENS,:AERILATE,:PIXILATE,:REFRIGERATE]\r\n canCheck = true\r\n abilityBlacklist.each do |m|\r\n next if move.id != m\r\n canCheck = false\r\n break\r\n end\r\n if canCheck\r\n BattleHandlers.triggerDamageCalcUserAbility(user.ability,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n if skill>=PBTrainerAI.mediumSkill && !moldBreaker\r\n user.eachAlly do |b|\r\n next if !b.abilityActive?\r\n BattleHandlers.triggerDamageCalcUserAllyAbility(b.ability,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n if skill>=PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive?\r\n # NOTE: These abilities aren't suitable for checking at the start of the\r\n # round.\r\n abilityBlacklist = [:FILTER,:SOLIDROCK]\r\n canCheck = true\r\n abilityBlacklist.each do |m|\r\n next if move.id != m\r\n canCheck = false\r\n break\r\n end\r\n if canCheck\r\n BattleHandlers.triggerDamageCalcTargetAbility(target.ability,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n if skill>=PBTrainerAI.bestSkill && !moldBreaker\r\n target.eachAlly do |b|\r\n next if !b.abilityActive?\r\n BattleHandlers.triggerDamageCalcTargetAllyAbility(b.ability,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n # Item effects that alter damage\r\n # NOTE: Type-boosting gems aren't suitable for checking at the start of the\r\n # round.\r\n if skill>=PBTrainerAI.mediumSkill && user.itemActive?\r\n # NOTE: These items aren't suitable for checking at the start of the\r\n # round.\r\n itemBlacklist = [:EXPERTBELT,:LIFEORB]\r\n if !itemBlacklist.include?(user.item_id)\r\n BattleHandlers.triggerDamageCalcUserItem(user.item,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n if skill>=PBTrainerAI.bestSkill && target.itemActive?\r\n # NOTE: Type-weakening berries aren't suitable for checking at the start\r\n # of the round.\r\n if target.item && !target.item.is_berry?\r\n BattleHandlers.triggerDamageCalcTargetItem(target.item,\r\n user,target,move,multipliers,baseDmg,type)\r\n end\r\n end\r\n # Global abilities\r\n if skill>=PBTrainerAI.mediumSkill\r\n if (@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||\r\n (@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY)\r\n if @battle.pbCheckGlobalAbility(:AURABREAK)\r\n multipliers[:base_damage_multiplier] *= 2 / 3.0\r\n else\r\n multipliers[:base_damage_multiplier] *= 4 / 3.0\r\n end\r\n end\r\n end\r\n # Parental Bond\r\n if skill>=PBTrainerAI.mediumSkill && user.hasActiveAbility?(:PARENTALBOND)\r\n multipliers[:base_damage_multiplier] *= 1.25\r\n end\r\n # Me First\r\n # TODO\r\n # Helping Hand - n/a\r\n # Charge\r\n if skill>=PBTrainerAI.mediumSkill\r\n if user.effects[PBEffects::Charge]>0 && type == :ELECTRIC\r\n multipliers[:base_damage_multiplier] *= 2\r\n end\r\n end\r\n # Mud Sport and Water Sport\r\n if skill>=PBTrainerAI.mediumSkill\r\n if type == :ELECTRIC\r\n @battle.eachBattler do |b|\r\n next if !b.effects[PBEffects::MudSport]\r\n multipliers[:base_damage_multiplier] /= 3\r\n break\r\n end\r\n if @battle.field.effects[PBEffects::MudSportField]>0\r\n multipliers[:base_damage_multiplier] /= 3\r\n end\r\n end\r\n if type == :FIRE\r\n @battle.eachBattler do |b|\r\n next if !b.effects[PBEffects::WaterSport]\r\n multipliers[:base_damage_multiplier] /= 3\r\n break\r\n end\r\n if @battle.field.effects[PBEffects::WaterSportField]>0\r\n multipliers[:base_damage_multiplier] /= 3\r\n end\r\n end\r\n end\r\n # Terrain moves\r\n if skill>=PBTrainerAI.mediumSkill\r\n case @battle.field.terrain\r\n when :Electric\r\n multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC && user.affectedByTerrain?\r\n when :Grassy\r\n multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS && user.affectedByTerrain?\r\n when :Psychic\r\n multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC && user.affectedByTerrain?\r\n when :Misty\r\n multipliers[:base_damage_multiplier] /= 2 if type == :DRAGON && target.affectedByTerrain?\r\n end\r\n end\r\n # Badge multipliers\r\n if skill>=PBTrainerAI.highSkill\r\n if @battle.internalBattle\r\n # Don't need to check the Atk/Sp Atk-boosting badges because the AI\r\n # won't control the player's Pokémon.\r\n if target.pbOwnedByPlayer?\r\n if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE\r\n multipliers[:defense_multiplier] *= 1.1\r\n elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF\r\n multipliers[:defense_multiplier] *= 1.1\r\n end\r\n end\r\n end\r\n end\r\n # Multi-targeting attacks\r\n if skill>=PBTrainerAI.highSkill\r\n if pbTargetsMultiple?(move,user)\r\n multipliers[:final_damage_multiplier] *= 0.75\r\n end\r\n end\r\n # Weather\r\n if skill>=PBTrainerAI.mediumSkill\r\n case @battle.pbWeather\r\n when :Sun, :HarshSun\r\n if type == :FIRE\r\n multipliers[:final_damage_multiplier] *= 1.5\r\n elsif type == :WATER\r\n multipliers[:final_damage_multiplier] /= 2\r\n end\r\n when :Rain, :HeavyRain\r\n if type == :FIRE\r\n multipliers[:final_damage_multiplier] /= 2\r\n elsif type == :WATER\r\n multipliers[:final_damage_multiplier] *= 1.5\r\n end\r\n when :Sandstorm\r\n if target.pbHasType?(:ROCK) && move.specialMove?(type) && move.function != \"122\" # Psyshock\r\n multipliers[:defense_multiplier] *= 1.5\r\n end\r\n end\r\n end\r\n # Critical hits - n/a\r\n # Random variance - n/a\r\n # STAB\r\n if skill>=PBTrainerAI.mediumSkill\r\n if type && user.pbHasType?(type)\r\n if user.hasActiveAbility?(:ADAPTABILITY)\r\n multipliers[:final_damage_multiplier] *= 2\r\n else\r\n multipliers[:final_damage_multiplier] *= 1.5\r\n end\r\n end\r\n end\r\n # Type effectiveness\r\n if skill>=PBTrainerAI.mediumSkill\r\n typemod = pbCalcTypeMod(type,user,target)\r\n multipliers[:final_damage_multiplier] *= typemod.to_f / Effectiveness::NORMAL_EFFECTIVE\r\n end\r\n # Burn\r\n if skill>=PBTrainerAI.highSkill\r\n if user.status == :BURN && move.physicalMove?(type) &&\r\n !user.hasActiveAbility?(:GUTS) &&\r\n !(Settings::MECHANICS_GENERATION >= 6 && move.function == \"07E\") # Facade\r\n multipliers[:final_damage_multiplier] /= 2\r\n end\r\n end\r\n # Aurora Veil, Reflect, Light Screen\r\n if skill>=PBTrainerAI.highSkill\r\n if !move.ignoresReflect? && !user.hasActiveAbility?(:INFILTRATOR)\r\n if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0\r\n if @battle.pbSideBattlerCount(target) > 1\r\n multipliers[:final_damage_multiplier] *= 2 / 3.0\r\n else\r\n multipliers[:final_damage_multiplier] /= 2\r\n end\r\n elsif target.pbOwnSide.effects[PBEffects::Reflect] > 0 && move.physicalMove?(type)\r\n if @battle.pbSideBattlerCount(target) > 1\r\n multipliers[:final_damage_multiplier] *= 2 / 3.0\r\n else\r\n multipliers[:final_damage_multiplier] /= 2\r\n end\r\n elsif target.pbOwnSide.effects[PBEffects::LightScreen] > 0 && move.specialMove?(type)\r\n if @battle.pbSideBattlerCount(target) > 1\r\n multipliers[:final_damage_multiplier] *= 2 / 3.0\r\n else\r\n multipliers[:final_damage_multiplier] /= 2\r\n end\r\n end\r\n end\r\n end\r\n # Minimize\r\n if skill>=PBTrainerAI.highSkill\r\n if target.effects[PBEffects::Minimize] && move.tramplesMinimize?(2)\r\n multipliers[:final_damage_multiplier] *= 2\r\n end\r\n end\r\n # Move-specific base damage modifiers\r\n # TODO\r\n # Move-specific final damage modifiers\r\n # TODO\r\n ##### Main damage calculation #####\r\n baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max\r\n atk = [(atk * multipliers[:attack_multiplier]).round, 1].max\r\n defense = [(defense * multipliers[:defense_multiplier]).round, 1].max\r\n damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2\r\n damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max\r\n # \"AI-specific calculations below\"\r\n # Increased critical hit rates\r\n if skill>=PBTrainerAI.mediumSkill\r\n c = 0\r\n # Ability effects that alter critical hit rate\r\n if c>=0 && user.abilityActive?\r\n c = BattleHandlers.triggerCriticalCalcUserAbility(user.ability,user,target,c)\r\n end\r\n if skill>=PBTrainerAI.bestSkill\r\n if c>=0 && !moldBreaker && target.abilityActive?\r\n c = BattleHandlers.triggerCriticalCalcTargetAbility(target.ability,user,target,c)\r\n end\r\n end\r\n # Item effects that alter critical hit rate\r\n if c>=0 && user.itemActive?\r\n c = BattleHandlers.triggerCriticalCalcUserItem(user.item,user,target,c)\r\n end\r\n if skill>=PBTrainerAI.bestSkill\r\n if c>=0 && target.itemActive?\r\n c = BattleHandlers.triggerCriticalCalcTargetItem(target.item,user,target,c)\r\n end\r\n end\r\n # Other efffects\r\n c = -1 if target.pbOwnSide.effects[PBEffects::LuckyChant]>0\r\n if c>=0\r\n c += 1 if move.highCriticalRate?\r\n c += user.effects[PBEffects::FocusEnergy]\r\n c += 1 if user.inHyperMode? && move.type == :SHADOW\r\n end\r\n if c>=0\r\n c = 4 if c>4\r\n damage += damage*0.1*c\r\n end\r\n end\r\n return damage.floor\r\n end",
"def enemies_attack\n @enemies.each do |enemy|\n if enemy.life_points > 0\n enemy.attacks(@human_player)\n break if @human_player.life_points <= 0\n end\n end\n \n # Show end message\n def _end\n message = \"La partie est finie\"\n if @human_player.life_points > 0 && @enemies.length == 0\n puts message\n puts \"BRAVOOOO! TU AS GAGNE!\"\n elsif @human_player.life_points <= 0\n puts message\n puts \"YOUUU LOOOOSE! Tu as perdu!\"\n end\n end\n \n end",
"def perform\n\n begin\n\n while true\n set_data_for_current_iteration\n\n get_block_transactions\n\n r = validate_response\n return r unless r.success?\n\n if blocks_trail_count >= MIN_BLOCK_DIFFERENCE\n\n process_transactions\n\n update_last_processed_block_number\n\n verify_token_count if blocks_trail_count == MIN_BLOCK_DIFFERENCE\n\n end\n\n return if blocks_trail_count <= MIN_BLOCK_DIFFERENCE\n return if GlobalConstant::SignalHandling.sigint_received?\n end\n\n rescue StandardError => e\n puts e.inspect\n Rails.logger.error(e)\n return\n end\n\n end",
"def busy?; end",
"def can_be_blocked?(new_x, new_y)\n game.pieces.where(is_white: !is_white).where.not(x_position: nil, y_position: nil, type: KING).find_each do |piece|\n straight_obstruction_array(new_x, new_y).each do |coords|\n return true if piece.valid_move?(coords.first, coords.last)\n end\n end\n false\n end",
"def blocked?\n @blocked\n end",
"def rest\n return false if under_attack or @enemies < 1\n if check_for_a_bomb and !under_attack and warrior.health < @min_health/3\n puts \"Resting the minimun since there is a bomb that needs to be deactivated\"\n return warrior.rest!\n elsif !check_for_a_bomb and !under_attack and warrior.health < @min_health \n puts \"Resting a lot since there is no risk\"\n return warrior.rest!\n end\n return false\n end",
"def guts_hp_recovery\n if actor?\n self.hp += (mhp * (self.actor.guts_hp_recovery_rate * 0.01)).to_i\n else\n self.hp += (mhp * (self.enemy.guts_hp_recovery_rate * 0.01)).to_i\n end\n end",
"def try_again(hostname)\n mirror = Mirror.find_by_hostname hostname\n\n if mirror\n mirror.tasks.each do |task|\n task.block = false\n task.save\n end\n\n puts \"done (unblocked)\"\n else\n puts \"hostname not found\"\n end\n\n nil\nend",
"def attempt(message, &block)\n perform_action(message, false, nil, false, &block)\nend",
"def win_or_block(board) \n if reach?(board, self.token)\n reach?(board, self.token).find {|cell| !board.taken?(cell+1)}\n elsif reach?(board, self.opponent_token)\n reach?(board, self.opponent_token).find {|cell| !board.taken?(cell+1)}\n end\n end",
"def unsuccessful\n end",
"def wait_until_not_full; end",
"def update_bitmap\n if @direction != @actor.direction\n @direction = @actor.direction\n self.bitmap.dispose if self.bitmap and !self.bitmap.disposed?\n if !@iso\n self.bitmap = Cache.picture(sprintf(\"GTBS/wait%d\", @direction))\n else\n self.bitmap = Cache.picture(sprintf(\"GTBS/wait_iso%d\", @direction))\n end\n end\n end",
"def item_effect_recovery(item)\r\n recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp\r\n recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp\r\n if recover_hp < 0\r\n recover_hp += self.pdef * item.pdef_f / 20\r\n recover_hp += self.mdef * item.mdef_f / 20\r\n recover_hp = [recover_hp, 0].min\r\n end\r\n return recover_hp, recover_sp\r\n end",
"def ignore_bad_chunking\n @agent.ignore_bad_chunking\n end",
"def player_bust?(player)\n hand_value(player.hand) > BUST\n end",
"def failed!\n blackboard.failed!\n self\n end",
"def check_ratio_at_cap\n return if !@block_mode\n return if !@at_max_code\n\n if @checkpoint.nil?\n @checkpoint = @buf_pos + CHECKPOINT_BITS\n elsif @buf_pos > @checkpoint\n @ratio = @bytes_in / (@buf_pos / 8)\n @last_ratio = @ratio if @last_ratio.nil?\n\n if @ratio >= @last_ratio\n @last_ratio = @ratio\n @checkpoint = @buf_pos + CHECKPOINT_BITS\n elsif @ratio < @last_ratio\n # warn \"writing reset at #{@buf_pos} #{@buf_pos.divmod(8).join(',')}\"\n write_code(RESET_CODE)\n\n code_reset\n\n @checkpoint, @last_ratio = [nil, nil]\n end\n end\n end",
"def counter_attack\n block_or_win(opponent_token)\n end",
"def wait_for_effect\n update_for_wait\n update_for_wait while @spriteset.effect?\n end",
"def not_affective?\n @effectiveness == 0\n end",
"def demand_broken_bikes_from(container)\n while should_collect_broken_bikes?(container) do\n collected_bike = container.offload_broken_bike\n load(collected_bike)\n end\n end",
"def perform(message)\n p message\n arr = message.to_s.split(\" \")\n if arr[0]!=\"-\" and arr[3].match(\"TCP_MISS\") and arr[1] > 1000 and arr[4]/arr[1] < 40 and arr[4] > 40\n Rtx.send_notify(message.to_s)\n end\n end",
"def update_bitmap\n # Check if hiding HP from enemy view is true\n if @unit.army.officer.hide_hp and !@unit.army.playing\n self.bitmap = RPG::Cache.picture(\"hp_hide\")\n else # Display normal HP value\n # If unit has damage on it\n if @unit.unit_hp < 10\n self.bitmap = RPG::Cache.picture(\"hp_\" + @unit.unit_hp.to_s)\n # Otherwise, draw no flag\n else\n self.bitmap = nil\n end\n end\n end",
"def deal_damage(user, actual_targets)\n # Status move does not deal damages\n return true if status?\n\n rng = Random.new\n fibers = actual_targets.map do |target|\n damages = self.damages(user, target, rng) # /!\\ test the substitute pokemon when substitute was used\n critical_hit = @critical\n effectiveness = @effectiveness\n log_debug(\"#{user} inflict #{damages} HP to #{target}\")\n # TODO: Manage clone, abilities like cursed_body & sturdy, then effect, berries\n next Fiber.new do\n Fiber.yield if damages <= 0\n Fiber.yield :wait_for_animation, Visual::HPAnimation.new(scene, target, -damages, effectiveness) if damages > 0\n if critical_hit\n scene.display_message(actual_targets.size == 1 ? parse_text(18, 84) : parse_text_with_pokemon(19, 384, target))\n elsif damages > 0\n efficent_message(effectiveness, target)\n end\n handle_ko(target) if target.hp <= 0\n Fiber.yield :kill\n end\n end\n process_fiber(fibers)\n\n return true\n end",
"def run_warned; end",
"def update_attack\n # continue input update if attack should not be used\n return false if !self.check_attack_condition?\n # if attack not successful\n if !$game_player.use_attack\n # play buzzer, can't use\n $game_system.se_play($data_system.buzzer_se)\n end\n # stop input update\n return true\n end",
"def pbCriticalOverride(attacker,opponent)\n return false\n end",
"def run\n failed_attempts = 0\n failed_white_attempts = 0\n x = 0\n y = 0\n loop do\n # If white just sail through until we hit another color\n if @current_color == 1\n x_next, y_next = move_direction(x, y)\n\n # If in white and hit boundary or black then step through dp\n if restricted?(x_next, y_next)\n toggle_cc\n step_dp\n failed_white_attempts += 1\n else\n x = x_next\n y = y_next\n @current_color = @image.color(x, y)\n failed_attempts = 0\n failed_white_attempts = 0\n end\n\n break if failed_white_attempts == 4\n else\n @size = 0\n temp_x = x\n temp_y = y\n x, y, @size = block_fill(x, y)\n # puts \"CURR: #{temp_x+1}, #{temp_y+1}, NEXT: #{x+1}, #{y+1}\"\n x_next, y_next = move_direction(x, y)\n # If we are hitting the edge or a black codel try another direction\n if restricted?(x_next, y_next)\n update_movement(failed_attempts)\n failed_attempts += 1\n else # here we move into the next color block after processing the action\n next_color = @image.color(x_next, y_next)\n process_action(@current_color, next_color)\n x = x_next\n y = y_next\n @current_color = next_color\n failed_attempts = 0\n failed_white_attempts = 0\n end\n\n break if failed_attempts == 8\n end\n end\n end",
"def process_blocked_ips_commands\n if validate_ip!(params[:add_okay])\n IpStats.add_okay_ips([params[:add_okay]])\n elsif validate_ip!(params[:add_bad])\n IpStats.add_blocked_ips([params[:add_bad]])\n elsif validate_ip!(params[:remove_okay])\n IpStats.remove_okay_ips([params[:remove_okay]])\n elsif validate_ip!(params[:remove_bad])\n IpStats.remove_blocked_ips([params[:remove_bad]])\n elsif params[:clear_okay].present?\n IpStats.clear_okay_ips\n elsif params[:clear_bad].present?\n IpStats.clear_blocked_ips\n end\n end",
"def lose_gold(n)\n gain_gold(-n)\n end",
"def out_of_band(&block); end",
"def cpu_prevent\n current_turn = @state[:turn]\n @state[:turn] = current_turn == PLAYER_1_TURN ? PLAYER_2_TURN : PLAYER_1_TURN # pretend to be other player\n (0..6).each do |c|\n token_placed = board_place_token(c)\n if game_result != NO_RESULT_YET\n board_remove_token(c) # remove the winning move\n @state[:turn] = current_turn # change back\n board_place_token(c) # place token to block\n return true\n elsif token_placed # make sure token was placed before force delete\n board_remove_token(c)\n end\n end\n @state[:turn] = current_turn # remember to switch back\n false\n end",
"def check_for_stop user_id\n p_score, d_score = self.scores\n score = p_score\n if user_id.nil?\n score = d_score\n end\n if Game.bust?(score)\n if user_id.nil?\n self.update_attributes({dealer_score: d_score, status: 'won', win_amount: (self.bet_amount*2)})\n else\n self.update_attributes({player_score: p_score, status: 'lost'})\n end\n elsif Game.max_score?(score)\n self.stop(user_id)\n elsif user_id.nil? and Game.forced_stop?(self.card_numbers(user_id))\n self.stop(user_id)\n elsif user_id.nil? and Game.can_stop?(self.card_numbers(user_id))\n user_game_status, blackjack = self.decision_maker(p_score, d_score, self.card_numbers(self.user_id).length, self.card_numbers(nil).length)\n if user_game_status == \"lost\"\n self.stop(user_id)\n end\n end\n\n end"
] |
[
"0.67481816",
"0.5791086",
"0.5727344",
"0.5541141",
"0.5532687",
"0.5504164",
"0.5504164",
"0.54759717",
"0.53743786",
"0.53168136",
"0.53071684",
"0.5297561",
"0.52974457",
"0.5291614",
"0.5277002",
"0.52673244",
"0.5263291",
"0.524569",
"0.52380276",
"0.520819",
"0.5178174",
"0.5174046",
"0.51398987",
"0.5118501",
"0.5103993",
"0.5090113",
"0.50345737",
"0.5021789",
"0.50217015",
"0.5019997",
"0.50015116",
"0.49957347",
"0.49939176",
"0.4991385",
"0.4990673",
"0.49848253",
"0.49644092",
"0.49595433",
"0.4956783",
"0.49430475",
"0.4939126",
"0.49387622",
"0.4934771",
"0.49175614",
"0.49123645",
"0.491018",
"0.49036244",
"0.48871106",
"0.48800486",
"0.4877801",
"0.48723602",
"0.48719722",
"0.48652253",
"0.4860336",
"0.48600945",
"0.485543",
"0.48519325",
"0.48518607",
"0.48490176",
"0.48467547",
"0.4844265",
"0.48439643",
"0.4821543",
"0.4818224",
"0.48162916",
"0.4800688",
"0.47983608",
"0.47928926",
"0.47877222",
"0.4785079",
"0.47818887",
"0.47800782",
"0.477913",
"0.47775728",
"0.47750345",
"0.47674906",
"0.47670683",
"0.47645748",
"0.47631052",
"0.47623834",
"0.47590205",
"0.47555405",
"0.4749952",
"0.47466448",
"0.47438455",
"0.47434554",
"0.474003",
"0.4738831",
"0.47348365",
"0.47313988",
"0.4728343",
"0.47201723",
"0.4719515",
"0.4719351",
"0.47164097",
"0.47140154",
"0.47139272",
"0.47114694",
"0.47105947",
"0.47101986",
"0.47048235"
] |
0.0
|
-1
|
Returns alert msg css class
|
def alert_msg alert_type
case alert_type
when "success"
"alert alert-success"
when "danger"
"alert alert-danger"
when "error"
"alert alert-error"
else
"alert"
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def alert_class(name)\n if name == :alert\n \"alert-error\"\n else #if name == \"notice\"\n \"alert-success\"\n end\n end",
"def container_class\n string = 'alert '\n string += @context == 'default' ? 'alert-info' : \"alert-#{@context}\"\n string += \" #{@class}\"\n string\n end",
"def alert_classes(flash_type)\n \"alert alert-#{flash_type} alert-dismissible fade show\"\n end",
"def alert_class(type)\n styles = {\n success: 'alert-success',\n error: 'alert-danger',\n alert: 'alert-warning',\n notice: 'alert-info'\n }\n type_sym = type.to_sym\n return styles[type_sym] if styles.key? type_sym\n type.to_s\nend",
"def alert_message\n frm.div(:class=>\"alertMessage\").text\n end",
"def container_class\n \"alert alert-#{@context} #{@class}\"\n end",
"def flash_class(level)\n case level\n when :info then ' alert-info'\n when :notice then ' alert-success'\n when :error then ' alert-error'\n when :alert then ''\n else ''\n end\n end",
"def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-error\"\n when :alert then \"alert alert-alert\"\n end\n end",
"def flash_class(level)\n case level\n when :notice then 'alert alert-info'\n when :success then 'alert alert-success'\n when :error then 'alert alert-error'\n when :alert then 'alert'\n end\n end",
"def msg_alerta\n within('form[id=login]') do\n return find('.alert').text\n end\n end",
"def flash_class(level)\n case level\n when :notice then \"alert alert-info\"\n when :success then \"alert alert-success\"\n when :error then \"alert alert-error\"\n when :alert then \"alert alert-error\"\n end\n end",
"def flash_class(level)\n case level\n when :error\n when :alert\n \"alert alert-error\"\n else\n \"alert alert-success\"\n end\n end",
"def flash_class(level)\n case level\n when 'notice' then \"alert alert-info\"\n when 'success' then \"alert alert-success\"\n when 'error' then \"alert alert-danger\"\n when 'alert' then \"alert alert-warning\"\n end\n end",
"def flash_class(level)\n case level\n when 'notice' then \"alert alert-info\"\n when 'success' then \"alert alert-success\"\n when 'error' then \"alert alert-danger\"\n when 'alert' then \"alert alert-error\"\n end\n end",
"def flash_class(level)\n\t\t case level\n\t\t\twhen :notice then \"alert alert-info\"\n\t\t\twhen :success then \"alert alert-success\"\n\t\t\twhen :error then \"alert alert-danger\"\n\t\t\twhen :warning then \"alert alert-warning\"\n\t\t end\n\t\tend",
"def alert_box\n frm.div(:class=>\"alertMessage\").text\n end",
"def flash_class(level)\n case level\n when :notice then 'alert alert-info'\n when :success then 'alert alert-success'\n when :error then 'alert alert-danger'\n when :alert then 'alert alert-info'\n end\n end",
"def notice_message(cls: 'alert-box')\n flash_messages = []\n _type = 'notice'\n flash.each do |type, message|\n next if message.nil?\n _type = type\n flash_messages << html_msg(message, cls) if message\n end\n \"<div class='#{_type}' id='notice'><div class='layui-container'>#{flash_messages.join(\"\\n\")}</div></div>\".html_safe\n #flash_messages.join(\"\\n\").html_safe\n end",
"def flash_message_class_for(name)\n {\n 'notice' => 'success',\n 'alert' => 'alert',\n 'warning' => 'warning'\n }.fetch(name)\n end",
"def flash_message_class_for(name)\n {\n \"notice\" => \"success\",\n \"alert\" => \"alert\",\n \"warning\" => \"warning\",\n }.fetch(name)\n end",
"def flash_message_class_for(name)\n {\n \"notice\" => \"success\",\n \"alert\" => \"alert\",\n \"warning\" => \"warning\",\n }.fetch(name)\n end",
"def alert_box\n frm.div(:class=>\"alertMessage\")\n end",
"def flash_class(level)\n case level\n when 'notice' then\n 'alert alert-info'\n when 'success' then\n 'alert alert-success'\n when 'error' then\n 'alert alert-danger'\n when 'alert' then\n 'alert alert-warning'\n end\n end",
"def alert\n browser.find_element(class: 'alert-warning')\n end",
"def flash_class(level)\n case level\n when :notice then \"alert-info alert-dismissable\"\n when :success then \"alert-success alert-dismissable\"\n when :error then \"alert-danger\"\n when :alert then \"alert-warning alert-dismissable\"\n end\n end",
"def alert_class_for(flash_type)\n {\n :success => 'alert-success',\n :error => 'alert-danger',\n :alert => 'alert-warning',\n :notice => 'alert-info'\n }[flash_type.to_sym] || flash_type.to_s\n end",
"def flash_class(level)\n level = level.to_s\n case level\n when 'success' then 'alert alert-success'\n when 'notice' then 'alert alert-info'\n when 'alert' then 'alert alert-danger'\n when 'danger' then 'alert alert-danger'\n end\n end",
"def css_class\n case id\n when 0 # Cancelado - yellow\n 'warning'\n when 1 # Enviado - red\n 'danger'\n when 2 # Recibido - blue\n 'active'\n when 3 # Confirmado - gray\n 'info'\n when 4 # Efectuado - green\n 'success'\n end\n end",
"def flash_message(type, message)\n \"<div class=\\\"alert-message #{type}\\\"><p>#{message}</p></div>\".html_safe\n end",
"def flash_class(name)\n if name == :notice\n 'success'\n #elsif name == :notifications\n # 'info'\n else\n 'danger'\n end\n end",
"def bootstrap_class_for(flash_type)\n if flash_type == \"alert\"\n \"alert alert-dismissable alert-danger\"\n\n elsif flash_type == \"notice\"\n \"alert alert-dismissable alert-success\"\n\n elsif flash_type == \"warning\"\n \"alert alert-dismissable alert-warning\"\n\n else\n flash_type.to_s\n\n end\n end",
"def bootstrap_class_for flash_type\n case flash_type\n when \"success\"\n \"alert-success\" # Green\n when \"error\"\n \"alert-danger\" # Red\n when \"alert\"\n \"alert-warning\" # Yellow\n when \"notice\"\n \"alert-info\" # Blue\n else\n flash_type.to_s\n end\n end",
"def color_class\n if waiting_confirmation?\n return \"warning\"\n elsif confirmed?\n return \"success\"\n else\n return \"danger\"\n end\n end",
"def bootstrap_class_for flash_type\n case flash_type\n when \"success\"\n \"alert-success\" # Green\n when \"error\"\n \"alert-danger\" # Red\n when \"alert\"\n \"alert-warning\" # Yellow\n when \"notice\"\n \"alert-info\" # Blue\n else\n flash_type.to_s\n end\n end",
"def bootstrap_class_for flash_type\n case flash_type\n when \"success\"\n \"alert-success\" # Green\n when \"error\"\n \"alert-danger\" # Red\n when \"alert\"\n \"alert-warning\" # Yellow\n when \"notice\"\n \"alert-info\" # Blue\n else\n flash_type.to_s\n end\n end",
"def flash_class(level)\n\t\tcase level\n\t\t\twhen :notice then \"success\"\n\t\t\twhen :error then \"error\"\n\t\t\twhen :alert then \"warning\"\n\t\tend\n\tend",
"def flash_class(level)\n case level\n when 'notice' then \"info\"\n when 'success' then \"success\"\n when 'error' then \"danger\"\n when 'alert' then \"warning\"\n else level.to_s\n end\n end",
"def bootstrap_class_for(flash_type)\n case flash_type\n when \"success\"\n \"alert-success\" # Green\n when \"error\"\n \"alert-danger\" # Red\n when \"alert\"\n \"alert-warning\" # Yellow\n when \"notice\"\n \"alert-info\" # Blue\n else\n flash_type.to_s\n end\n end",
"def bootstrap_class_for flash_type\n case flash_type\n when :success\n \"alert-success\"\n when :error\n \"alert-danger\"\n when :alert\n \"alert-warning\"\n when :notice\n \"alert-info\"\n else\n flash_type.to_s\n end\n end",
"def bootstrap_class_for flash_type\n { success: \"alert-success\", error: \"alert-danger\", alert: \"alert-warning\", notice: \"alert-info\" }[flash_type.to_sym] || flash_type.to_s\n end",
"def bootstrapAlert(flashAlert)\n output = ''\n case flashAlert\n when 'alert' then output = 'danger'\n when 'error' then output = 'danger'\n when 'notice' then output = 'info'\n when 'success' then output = 'success'\n when 'warning' then output = 'warning'\n else output = 'info'\n end\n\n return output\n end",
"def check_alert(name)\n case name\n when :notice\n 'success'\n when :danger\n 'danger'\n when :warning\n 'warning'\n else\n 'info'\n end\n end",
"def show_errors_as_alert_with_class_string(errors, class_string)\n errors_html = \"<div class='alert alert-error alert-center\"\n if !class_string.nil? && !class_string.empty?\n errors_html << \" \" + class_string\n end\n errors_html << \"'><button type='button' class='close' data-dismiss='alert'>×</button>\" +\n \"<strong>Errors occurred: \"\n errors.each {\n errors_html << errors.join(\"; \")\n }\n errors_html << \"</strong></div>\"\n return errors_html.html_safe\n end",
"def bootstrap_class_for flash_type\n case flash_type.to_sym\n when :success\n \"alert-success\"\n when :error\n \"alert-danger\"\n when :alert\n \"alert-warning\"\n when :notice\n \"alert-info\"\n else\n flash_type.to_s\n end\n end",
"def alert msg\n document.get_default_view.alert(msg)\n end",
"def flash_class(level)\n case level\n when :notice then 'flash-notice'\n when :error then 'flash-error'\n when :alert then 'flash-alert'\n end\n end",
"def alert(id, msg, *classes)\n flash[rand(9999).to_s] = {:msg => msg, :classes => classes}\n end",
"def alert_text\n frm.div(:class=>\"portletBody\").div(:class=>\"alertMessage\").text\n end",
"def bootstrap_class_for(flash_type)\n case flash_type\n when \"success\"\n \"alert-success\" # Green\n when \"error\"\n \"alert-danger\" # Red\n when \"alert\"\n \"alert-warning\" # Yellow\n when \"notice\"\n \"alert-info\" # Blue\n else\n flash_type.to_s\n end\n end",
"def retorna_alerta_cupom\n alert_cupom.greenify\n alert_cupom.text\n end",
"def flash_message\n messages = \"\"\n [:notice, :info, :warning, :error].each {|type|\n if flash[type]\n messages += \"<p class=\\\"#{type}\\\">#{flash[type]}</p>\"\n end\n }\n\n messages\n end",
"def types\n {\n alert: 'alert-error',\n notice: 'alert-success',\n warning: 'alert-warning',\n info: 'alert-info',\n }\n end",
"def flash_messages\n bootstrap_class = {\"notice\" => \"alert alert-success\", \"error\" => \"alert alert-error\", \"warning\" => \"alert\"}\n bootstrap_class.keys.map do |msg|\n content_tag(:div, (\"<a class=\\\"close\\\" data-dismiss=\\\"alert\\\">×</a>\".html_safe + flash.delete(msg.to_sym).html_safe), {:class => bootstrap_class[msg]}) unless flash[msg.to_sym].blank?\n end.join(\"\\n\").html_safe\n end",
"def class_type_for_message(key)\n case key\n when :success\n return 'success'\n when :notice\n return 'info'\n when :alert\n return 'warning'\n when :error\n return 'error'\n else\n return 'info'\n end\n end",
"def mensaje_error\n\t\tmensaje_error_element.text\n\tend",
"def to_display_without_style\n \"Admin Alert: #{self.message}\".html_safe\n end",
"def error_msg\n ERROR_MSG[upcase_class_sym]\n end",
"def alert=(message); end",
"def alert=(message); end",
"def notice_message\n flash_messages = []\n\n flash.each do |type, message|\n type = :success if type == :notice\n type = :error if type == :alert\n text = content_tag(:p, message, :class => \"#{type}\")\n flash_messages << text if message\n end\n\n flash_messages.join(\"\\n\").html_safe\n end",
"def check_alert_icon(name)\n case name\n when :danger\n 'fa-exclamation-circle'\n when :warning\n 'fa-question-circle'\n when :notice, :success\n 'fa-check-circle'\n else\n 'fa-info-circle'\n end\n end",
"def getMsgClass(message)\r\n return isMyMessage(message) ? \"userMessage-Me\" : \"userMessage-Them\"\r\n end",
"def error_message_field\n { :tag => 'span', :attributes => { :class => 'fielderror' } }\n end",
"def alert_name_error\n @driver.find_element(xpath: @alert_name_error).text\n end",
"def message\n @errormsg\n end",
"def boostrap_flash_messages\n flash.each do |msg_type, message|\n concat(content_tag(:div, message, role: \"alert\", class: \"alert #{bootstrap_class_for(msg_type)} sticky-top fade show\") do\n concat content_tag(:button, 'x', class: \"close\", data: { dismiss: 'alert' })\n concat message\n end)\n end\n nil\n end",
"def messages(flash_key, msg)\n style = MESSAGES[flash_key.to_sym]\n content_tag :div, class: 'js-slow-time ' + style.css do\n content_tag :div, class: 'layout__w-wrapper' do\n fa_icon(style.icon) + content_tag(:span, msg, class: 'u-padding-left-small')\n end\n end\n end",
"def success_messages\n msg_div.text\n end",
"def alert_flash\n return nil if flash.empty?\n result = \"\"\n flash.each do |msg_type, msg|\n result << content_tag(:div, class: \"alert alert-#{msg_type}\") do\n msg.html_safe <<\n content_tag(:button, \"x\", class: \"close\", \"data-dismiss\" => \"alert\")\n end\n end\n\n result.html_safe\n end",
"def get_alert_text\n $driver.switch_to.alert.text\nend",
"def display_alert(lead: 'Error', body: '', type: 'alert-danger')\n _div.alert class: type, role: 'alert' do\n _p.lead lead\n _markdown body\n end\nend",
"def mensajes_flash\n content_tag :div, flash.collect { |id, mensaje| content_tag :div, (link_to raw(\"×\"),'#', :class => 'close', 'data-dismiss' => \"alert\" ) + mensaje, :class => \"alert alert-#{flash_type(id)} fade in\" }.join.html_safe, :id => :flash\n end",
"def status_color\n if self.success && self.error_text.nil?\n return 'green'\n elsif self.success\n return 'yellow'\n else\n return 'red'\n end\n end",
"def flash_class(flash_type)\n types = {\n success: \"is-success\",\n error: \"is-danger\",\n alert: \"is-warning\",\n info: \"is-info\"\n }\n\n types[flash_type.to_sym] || \"is-info\"\n end",
"def error_color(text)\r\n \"<font color=red>#{text}</font>\"\r\n end",
"def alert(message)\n $stdout.puts(message.green)\nend",
"def find_div_with_fail_message\n return @session.all('div.alert.alert-danger.alert-block ul li')\n # return @session.all('div.form-group.has-error span.help-block')\n end",
"def alert_message(title=\"Alert\", &block)\n render layout: \"/flash_message\", locals: { title: title, css_class: \"alertmessage\" }, &block\n end",
"def proposal_state_css_class(state)\n case state\n when \"accepted\"\n \"text-success\"\n when \"rejected\"\n \"text-alert\"\n when \"evaluating\"\n \"text-info\"\n else\n \"text-warning\"\n end\n end",
"def result_message_severity(xccdf_status)\n case xccdf_status\n when 'fail'\n 'error'\n when 'notapplicable'\n 'warning'\n else\n 'info'\n end\n end",
"def alerts\n check_devise_resource_for_errors\n msgs = flash.keys.collect do |msg_type|\n next unless FLASH_LITERALS.has_key? msg_type.to_sym\n render partial: 'partials/alert', locals: {\n icon: FLASH_LITERALS[msg_type.to_sym][:icon],\n message: flash.discard(msg_type).html_safe,\n bootstrap_class: FLASH_LITERALS[msg_type.to_sym][:bs_class]\n }\n end\n msgs.join.html_safe\n end",
"def alert_name\n @@alert_name\n end",
"def alert_tag(instance)\n return unless instance.is_a?(ApplicationRecord) # this function if for active record child classes only.\n return if instance.errors.empty? # nothing to display\n div_tag(id: \"#{instance.class.name.downcase}_errors\", class: %w(alert alert-danger), role: :alert) do\n ul_tag do\n safe_join(instance.errors.full_messages.map{ |message| li_tag{ message } })\n end\n end\n end",
"def mensajes(lista)\n lista.collect do |tipo, mensaje|\n content_tag :div, class: alerta(tipo) do\n content_tag(:button, '×', class: 'close', data: { dismiss: 'alert' }) +\n mensaje\n end\n end.join.html_safe\n end",
"def page_alert(message, title = '')\n if MuckEngine.configuration.growl_enabled\n \"jQuery.jGrowl.error('\" + message + \"', {header:'\" + title + \"'});\"\n else\n \"alert(#{message});\"\n end\n end",
"def textColor(theColor, target = nil)\n return if theColor.nil?\n views = @alert.window.contentView.subviews # the standard label fields\n case target\n when 'message' then views[4].textColor = MEalert.getColor(theColor, 'textColor')\n when 'informative' then views[5].textColor = MEalert.getColor(theColor, 'textColor')\n else @coloration[:text] = theColor\n end\n end",
"def message(messageText, messageFont = nil)\n messageFont = NSFont.boldSystemFontOfSize(0.25) if messageText.nil?\n @alert.window.contentView.subviews[4].font = messageFont unless messageFont.nil?\n @alert.messageText = messageText.to_s\n end",
"def flash_messages_bs5 _opts = {}\n flash.each do |msg_type, message|\n next if 'unfurl' == msg_type # we don't show unfurl's in the flash notice UI.\n\n concat(\n content_tag(\n :div,\n message,\n class: \"alert #{bootstrap_class_for(msg_type)} alert-dismissible fade show\",\n role: 'alert'\n ) do\n concat(\n content_tag(\n :button,\n class: 'btn-close',\n data: { 'bs-dismiss': 'alert' }\n ) do\n end\n )\n concat message\n end\n )\n end\n\n nil\n end",
"def notice_info_inner\n content_tag(:span, raw(\"#{content_tag(:i, nil, class: 'icon-ok')} #{flash[:notice]}\"), class: 'alert alert-success collapse', id: 'notice_inner', role: 'alert')\n end",
"def popup_msg(msg_msg, msg_type,msg_title,msg_icon)\n\t\tTk.messageBox('message'=>msg_msg, 'type'=>msg_type,'title'=>msg_title, 'icon'=>msg_icon)\n\tend",
"def flash_messages\n messages = []\n %w(notice warning error).each do |msg|\n messages << content_tag(:div, '<a onclick=\"$(\\'flash_box\\').hide();return false\" href=\"#\">X</a>' + html_escape(flash[msg.to_sym]), :id => \"flash_box\", :class=> \"#{msg}\") unless flash[msg.to_sym].blank?\n end\n messages << %(<script type=\"text/javascript\">show_error_message();</script>)\n messages\n end",
"def get_general_error_message\n find('#form-message-general').text\n end",
"def flash_message(type, message)\n content_tag(:div, :class => \"flash-message #{type.to_s}\") do\n content_tag :p, message\n end\n end",
"def flash_message(type, message)\n content_tag(:div, :class => \"flash-message #{type.to_s}\") do\n content_tag :p, message\n end\n end",
"def field_class\n css = (options[:class]||\"\").split(' ')\n css << 'exergue' if exergue\n css << 'warning' if warning\n css.join(' ')\n end",
"def alert( msg ) \n\t\tbegin\n\t \tAas::Application.ShowAlertDialog msg\n\t rescue Exception => e\n\t puts_ex e\n\t end\n\tend",
"def flash_messages(opts = {})\n flash.each do |msg_type, message|\n concat(\n content_tag :div, nil,\n class: \"alert #{bootstrap_class_for(msg_type)} fade in\",\n data: {message: message},\n style: 'display: none;'\n )\n end\n nil\n end",
"def get_alert_text(driver)\n begin\n myWait1 = Selenium::WebDriver::Wait.new(:timeout => 60)\n myWait1.until { \n driver.switch_to.alert \n } \n alert_text = driver.switch_to.alert.text\n driver.switch_to.alert.dismiss \n return alert_text\n rescue Exception => e\n puts e.message\n return null\n end\n end",
"def alert_messages(*alert_message)\n # delete invalid message\n alert_message.reject! { |msg| msg.blank? } unless alert_message.blank?\n alert_message = [] if alert_message.blank?\n # delete invalid system alert message\n if alert.class == Array && !alert.blank?\n system_alert = alert.reject { |msg| msg.blank? }\n elsif !alert.blank?\n system_alert = alert\n end\n # concatinate alerts\n unless system_alert.blank?\n if system_alert.class == Array\n alert_message += system_alert\n else\n alert_message << system_alert\n end\n end\n\n return \"\" if alert_message.blank?\n\n message = alert_message.class == Array ? alert_message.map { |msg| content_tag(:li, msg) }.join : \"<li>#{alert_message.to_s}</li>\"\n\n html = <<-HTML\n <div class=\"alert alert-block\">\n <a class=\"close\" data-dismiss=\"alert\">×</a>\n <h4 class=\"alert-heading\">#{t('alert_title')}</h4>\n <ul>#{message}</ul>\n </div>\n HTML\n html.html_safe\n end",
"def flash_message\n [:error, :warning, :notice].each do |type|\n return flash[type] unless flash[type].blank?\n end\n # if we don't return something here, the above code will return \"error, warning, notice\"\n return ''\n end"
] |
[
"0.7906095",
"0.74643844",
"0.7133367",
"0.70473146",
"0.6903069",
"0.68930435",
"0.6837162",
"0.68316257",
"0.67946744",
"0.6791541",
"0.6789666",
"0.6786162",
"0.67615026",
"0.67579085",
"0.6751432",
"0.67410624",
"0.67409563",
"0.67112356",
"0.6682332",
"0.6679834",
"0.6679834",
"0.6674383",
"0.66284984",
"0.65973115",
"0.65882653",
"0.657791",
"0.65268946",
"0.65160555",
"0.64991164",
"0.6464272",
"0.6430897",
"0.6423924",
"0.6412325",
"0.63948286",
"0.63948286",
"0.63780475",
"0.63110274",
"0.63059944",
"0.6296536",
"0.6287919",
"0.62825257",
"0.6281955",
"0.62810516",
"0.6269887",
"0.62298286",
"0.62083673",
"0.619442",
"0.6153911",
"0.6135742",
"0.600838",
"0.5988521",
"0.59495103",
"0.58863753",
"0.5875492",
"0.5852244",
"0.58436626",
"0.5838373",
"0.5823591",
"0.5823591",
"0.5784658",
"0.5779485",
"0.5778355",
"0.576626",
"0.5749862",
"0.5728968",
"0.57211727",
"0.5720396",
"0.570851",
"0.56978804",
"0.5695729",
"0.5690143",
"0.562742",
"0.56134844",
"0.56097394",
"0.5605961",
"0.56054544",
"0.56033176",
"0.55987144",
"0.5591574",
"0.5589257",
"0.5579177",
"0.557633",
"0.5562932",
"0.5554077",
"0.55505985",
"0.5545479",
"0.5541003",
"0.5537193",
"0.5529881",
"0.5527258",
"0.55223924",
"0.55176044",
"0.55131763",
"0.55131763",
"0.5511379",
"0.55084646",
"0.5503499",
"0.54873645",
"0.5480238",
"0.5476321"
] |
0.7427886
|
2
|
unfollow for email notice type Model id Model id key email encode key
|
def unfollow
return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?
email = Encoder.decode(params[:key])
return render_404 if email.blank?
Unfollower.create(:email => email,
:unfollowerable_type => params[:type].capitalize,
:unfollowerable_id => params[:id].to_i)
render :text => "你已经成功退定."
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def unfollow\n return render_404 if params[:type].blank? or params[:id].blank? or params[:key].blank?\n email = Encoder.decode(params[:key])\n return render_404 if email.blank?\n\n Unfollower.create(:email => email, \n :unfollowerable_type => params[:type].capitalize, \n :unfollowerable_id => params[:id].to_i)\n \n render :text => \"You have successfully set back.\"\n end",
"def unfollowed\n FollowMailer.unfollowed\n end",
"def unfollow! followee\n following_ids.delete(followee.id)\n save\n followee.followers_ids.delete(id)\n followee.save\n end",
"def unfollow\r\n @relationship = Relationship.where(follower_id: current_user.id, followed_id: params[:followed_id]).first\r\n @relationship.create_activity key: 'relationship.unfollow', owner: current_user, recipient: User.find(params[:followed_id]) \r\n @relationship.destroy\r\n render json: { message: \"Relationship destroyed successfully\" }\r\n end",
"def unfollow! followee\n return if !following? followee\n following_ids.delete(followee.id)\n save\n followee.followers_ids.delete(id)\n followee.save\n end",
"def Unfollow\n \n @kite = Kite.find(params[:id])\n \n if current_user\n @following = current_user.follwing.where(:Type => params[:type], :kite_id =>params[:id]).first\n end\n\n respond_to do |format|\n if @following && @following.destroy\n format.html { redirect_to(@kite, :notice => 'Kite has been unfollowed.')}\n format.xml { render :xml => @kite, :status => :created, :location => @kite }\n format.js {}\n format.json { render :json => @following, :status => :success }\n else\n format.html { render :action => \"owner_show\" }\n format.xml { render :status => :failure }\n format.js {}\n format.json { render :status => :unprocessable_entity }\n end\n end\n\n end",
"def unfollow(user_id, followee_id)\n @follows[user_id] = { user_id => 1 } unless @follows.key?(user_id)\n @follows[user_id][followee_id] = nil\n end",
"def unfollow\n current_user.unfollow_user(@user)\n render json: {ok: 1}\n end",
"def unfollow\n \t\n \t\t@fol = Follow.find_by_follower_and_followee(session[:id], params[:aid])\n \t\tif @fol == nil\n \t\t\tflash[:error] = \"wtf????\"\n \t\telse\n \t\t\t@sql = \"DELETE FROM follows WHERE follower = \"+@fol.follower.to_s+\" AND followee = \"+@fol.followee.to_s\n \t\tActiveRecord::Base.connection.execute(@sql)\n \t\t\n \t\t#if request.xhr?\n \t\t\trender 'accounts/unfollow'\n \t\t\t#else\n \t\t\t\t#redirect_to :controller => :main, :action => :searching\n \t\t\t#end\n \t\tend\n \t\t\n \t \t\n end",
"def unfollow\n current_user.unfollow_topic(@topic)\n render json: {ok: 1}\n end",
"def unfollow\n @user = User.friendly.find(params[:user_id])\n\n @follow = Follow.find_by followable_id: @user.id, follower_id: current_user.id\n @follow.status = 2\n \n if @follow.save\n render :json => {:success => true}\n else \n render :json => {:success => false}\n end\n end",
"def unfollow(nick)\n config['following'].delete(nick)\n config.save\nend",
"def unfollow\n @user = User.find(params[:follow_id])\n\n current_user.following.delete(params[:follow_id].to_i)\n @user.followers.delete(current_user.id)\n\n current_user.save\n @user.save\n \n if current_user.save\n flash[:success] = \"You are no longer following #{@user.username}!\"\n redirect_to root_path\n else\n flash[:error] = \"Something went wrong.\"\n end\n #show_followers\n end",
"def unfollow\n user_id = params[:id]\n following_user_id = (params[:following_user_id] || params[:connected_user_id])\n\n if (user_id.present? and following_user_id.present?)\n user = User.find_by_id(user_id)\n following_user = User.find_by_id(following_user_id)\n\n if (!user.nil? and !following_user.nil?)\n if !user.follows.exists?(following_user)\n message = t('user.unfollow.messages.already_not_following', {following_user_name: following_user.name})\n else\n followed_following_obj = user.unfollow(following_user_id)\n if followed_following_obj.nil?\n message = t('user.unfollow.messages.failure', { following_user_name: following_user.name })\n else\n message = t('user.unfollow.messages.success', { following_user_name: following_user.name })\n end\n end\n else\n message = t('user.unfollow.errors.no_user_found', { user_id: user_id, following_user_id: following_user_id })\n end\n else\n message = t('user.unfollow.errors.could_not_process_unfollow')\n end\n\n redirect_to :back, flash: { notice: message }\n end",
"def unfollow\n unfollow = User.where(:username => params[:id]).first\n relationship = @current_user.followers.where( :friend_id => unfollow.id ).first\n relationship.destroy\n redirect_to user_path( unfollow.username )\n end",
"def unfollow\n requested_profile.unfollow!(requested_follow_profile)\n redirect_to :action => 'following', :profile_id => current_user.profile\n end",
"def unfollow(other_user)\n \tactive_relationships.find_by(followed_id: other_user.id).destroy\n \tend",
"def unfollow\n @user = User.find_by_id(params[:id])\n if @user and current_user.unfollow(@user)\n flash[:notice] = \"You are no longer following #{@user.login} :(\"\n redirect_to home_path()\n elsif @user\n flash[:notice] = \"You aren't following #{@user.login}\"\n redirect_to user_path(@user.login)\n else\n redirect_to home_path()\n end\n end",
"def destroy\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to(emails_url) }\n format.mobile { redirect_to profile_kontact_kontact_information_plural_fields_path(@profile, @kontact)}\n format.xml { head :ok }\n end\n end",
"def unfollow\n followable_uid = unsafe_params[\"followable_uid\"]\n fail \"Followable uid needs to be a non-empty string\" unless followable_uid.is_a?(String) && followable_uid != \"\"\n\n followable = item_from_uid(followable_uid)\n follower = @context.user\n if followable.accessible_by?(@context) && [\"discussion\"].include?(followable.klass)\n follower.stop_following(followable)\n render json: {\n followable_uid: followable_uid,\n follower_uid: follower.uid,\n follow_count: followable.followers_by_type_count(follower.class.name),\n }\n else\n fail \"You do not have permission to unfollow this object\"\n end\n end",
"def unfollow!(followed)\n relationships.find_by_followed_id(followed).destroy\n end",
"def unfollow!(followed)\n relationships.find_by_followed_id(followed).destroy\n end",
"def unfollow\n if request.post?\n @unf_ids = params[:unfollow]\n \n #unf_str = \"\"\n #unf_cnt = unf_ids.length - 1\n #for i in 0..unf_cnt\n # unf_str +=unf_ids[i].to_s\n # unf_str += \",\" unless unf_cnt == i\n #end\n if @unf_ids.nil? || @unf_ids.length < 1\n else\n @unf_ids.each do |unfo| \n hydra = Typhoeus::Hydra.new\n uri = \"http://api.twitter.com/1/friendships/destroy.json\"\n req = Typhoeus::Request.new(uri,\n :method =>\"post\",\n :params =>{:user_id=>unfo, :include_entities=>\"true\"})\n \n sign_request(req,uri)\n hydra.queue(req)\n hydra.run\n #puts req.response.inspect\n end\n end\n end\n respond_to do |format|\n format.js\n end\n end",
"def unfollow\n if @user_auth.nil?\n raise ActionController::MethodNotAllowed, 'Vous n\\'êtes pas connecté'\n elsif @user_auth.id != @user_followed.id\n follow = Follow.find_by(follower_user_id: @user_auth.id, followed_user_id:@user_followed.id)\n if follow.destroy\n redirect_back fallback_location: '/', notice: \"Vous ne suivez plus #{@user_followed.name}\"\n else\n redirect_back fallback_location: '/', error: \"Impossible de follow l'utilisateur\"\n end\n else\n redirect_back fallback_location: '/', error: 'Vous ne pouvez pas vous auto unfollow'\n end\n end",
"def unfollow(other_user_id)\n \tuser_to_unfollow = User.find_by(id: other_user_id)\n active_relationships.find_by(followed_id: user_to_unfollow.id).destroy\n end",
"def unfollow\n user_to_unfollow = User.find(params[:id])\n followId = Follow\n .select(:id)\n .where(follower_id: current_user.id, followed_id: user_to_unfollow.id)\n current_user.unfollow(user_to_unfollow)\n render partial: 'api/follows/follow_data',\n locals: {\n follower: current_user,\n followed: user_to_unfollow,\n other: user_to_unfollow.follower_ids,\n followId: followId,\n current: current_user.following_ids\n }\n end",
"def set_email_updates\n get_email = FollowerFollowing.where('follower_id=? and following_id=?', @login_user.id, params[:id]).first\n get_email.update_attributes(:get_email_updates => !get_email.get_email_updates)\n redirect_to \"/users/profile/#{params[:id]}\"\n end",
"def unfollow(model)\n if self.id != model.id && self.followed?(model)\n\n model.reload\n self.reload\n\n model.before_unfollowed_by(self) if model.respond_to?('before_unfollowed_by')\n\n follows.where(:followable_type => model.class.name, :followable_id => model.id).destroy\n model.followers.delete(self)\n\n model.inc(:followers_count, -1)\n model.after_unfollowed_by(self) if model.respond_to?('after_unfollowed_by')\n self.before_unfollow(model) if self.respond_to?('before_unfollow')\n\n self.inc(:follows_count, -1)\n self.after_unfollow(model) if self.respond_to?('after_unfollow')\n\n return true\n else\n return false\n end\n end",
"def unfollow\n @data = {:user_id => params[:follow_user_id] , :follow_user_id => current_user.id}\n status = UserFollower.unfollow(@data)\n render json: {:status => status} \n # render layout: \"homepage\"\n\n end",
"def unfollow!(user)\n relationships.find_by_followed_id(user).destroy\n end",
"def unfollow\n @twitter = Twitter::Client.new(\n :oauth_token => @bot.tw_token,\n :oauth_token_secret => @bot.tw_secret\n )\n\n @tweet = Tweet.find(params[:tweet])\n\n @twitter.unfollow(@tweet.tw_usuario)\n @tweet.estado = 4\n @tweet.save\n\n mensaje = \"Dejo de seguir a \" + @tweet.tw_usuario\n redirect_to(bot_tweets_path(@bot), notice: mensaje)\n end",
"def unfollow\n\t\t@twitter = Twitter::Client.new(\n\t\t\t:oauth_token => @bot.tw_token,\n\t\t\t:oauth_token_secret => @bot.tw_secret\n\t\t)\n\n\t\t@tweet = Tweet.find(params[:tweet])\n\n\t\t@twitter.unfollow(@tweet.tw_usuario)\n\t\t@tweet.estado = 4\n\t\t@tweet.save\n\n\t\tmensaje = \"Dejo de seguir a \" + @tweet.tw_usuario\n\t\tredirect_to(bot_tweets_path(@bot), notice: mensaje)\n\tend",
"def disassociation_email(teammate, pitch)\n @user = teammate.user\n @pitch = pitch\n mail(to: @user.email, subject: \"Você foi desassociado do Time: #{pitch.name}\")\n end",
"def unfollow\n current_profile.unfollow_profile(@profile)\n respond_to do |format|\n format.html { redirect_to profile_home_path(@profile.site_identifier) }\n format.json { head :no_content }\n end\n end",
"def unfollow(other_user)\n active_follows.find_by(followed_id: other_user.id).destroy\n end",
"def unfollow(user)\n user.followers.delete(self)\n end",
"def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end",
"def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end",
"def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end",
"def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end",
"def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end",
"def unfollow_test\n unf_ids = params[:unfollow]\n \n unf_str = \"\"\n unf_cnt = unf_ids.length - 1\n for i in 0..unf_cnt\n unf_str +=unf_ids[i].to_s\n unf_str += \",\" unless unf_cnt == i\n end\n \n params_before_encode = [\n [\"user_id\",unf_str],\n [\"include_entities\",\"true\"]\n ]\n request_before_encode = [\n [\"http_method\",\"POST\"],\n [\"base_url\",\"http://api.twitter.com/1/friendships/destroy.json\"]\n ]\n header_string = buildheader(params_before_encode,request_before_encode)\n #puts header_string\n request = Typhoeus::Request.new(\"http://api.twitter.com/1/friendships/destroy.json\",\n :method =>\"post\",\n :headers =>{\"Authorization\" => header_string},\n :params =>{:user_id=>unf_str, :include_entities=>\"true\"})\n hydra = Typhoeus::Hydra.new\n hydra.queue(request)\n hydra.run \n end",
"def unfollow_user\n\t\tauthenticate_current_user\n\t\t# destroy the current user from that user's followers\n\t\tUser.find(params.user_id).followers.destroy(User.find(current_user.id))\n\t\t# run the following action to return the updated group of followers\n\t\tfollowing\n\tend",
"def unfollow(response)\n user_name = response.user.andand.name\n routing_key = response.match_data[1]\n unsubscribe(nil, user_name, routing_key)\n response.reply \"#{response.user.name}, no longer following '#{routing_key}'\"\n rescue Error => e\n log.error e.inspect\n log.error response.inspect\n response.reply \"#{response.user.name}, #{e} (routing_key: '#{routing_key}')\"\n end",
"def destroy\n user = Relationship.find(params[:id]).followed\n @current_user.unfollow(user)\n redirect_to user\n end",
"def unfollow!(other_user)\n relationships.find_by(followed_id: other_user.id).destroy\n end",
"def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end",
"def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end",
"def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end",
"def del_message # for user it is delte but in db it change status to false\t\n\t\tmid = Base64.decode64(params[:id])\t\t\t \n\t\ttype = params[:type]\t\t\t \n\t\tmessage = Message.find(mid)\t\n\t\tif params[:type]=='self' \n\t\t\tmessage.update_attributes(status: false)\n\t\telse\n\t\t\tmessage.update_attributes(recipient_status: false)\n\t\tend\n\t\t\t\n\t if message \n\t\t render :json => mid and return \n\t else\n\t\t render :json => {errors: \"Please Try Again!\"} and return\n\t end\t\n\tend",
"def destroy\n @email = @user.emails.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def unfollow(other_user)\n following.delete(other_user)\n end",
"def destroy\n @email = Email.destroy(params[:id])\n redirect_to root_path \n end",
"def unfollow_user\n user = User.find(params[:user_id])\n current_user.unfollow(user)\n render_success_message(\"You are not anymore following #{user.full_name(false)}\")\n end",
"def unfollow(unfollowed)\n if unfollowed.is_a? Array\n ids = unfollowed.map(&:id).join(',')\n type = unfollowed.first.type\n else\n ids = unfollowed.id\n type = unfollowed.type\n end\n\n url = if type == 'playlist'\n \"users/#{unfollowed.owner.id}/playlists/#{unfollowed.id}/followers\"\n else\n \"me/following?type=#{type}&ids=#{ids}\"\n end\n\n User.oauth_delete(@id, url)\n unfollowed\n end",
"def destroy\n @emailu = Emailu.find(params[:id])\n @emailu.destroy\n\n respond_to do |format|\n format.html { redirect_to emailus_url }\n format.json { head :no_content }\n end\n end",
"def unfollow!(other_user)\n relationships.find_by(followed_id: other_user.id).destroy!\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_emails_url }\n format.json { head :no_content }\n end\n end",
"def unfollow\n user = User.find(params[:user_id])\n @unfollow = current_user.stop_following(user)\n render json: @unfollow\n end",
"def unfollow(other_user)\n\t\tactive_relationships.find_by(followed_id: other_user.id).destroy\n\tend",
"def unfollow_user\n\t\t# determine who is following who\n\t @follower = current_user\n @following = User.find_by_login(params[:username])\n @user = @following\n\n\t\t# if follower was self, unknown\n if @follower.id == @following.id\n gflash :error => \"Unknown request!\"\n redirect_back_or_default('/')\n end\n\n\t\t# see if user is being followed \t\n exist = Follow.find(:first, :conditions => {:follower_id => @follower.id, :following_id => @following.id})\n if exist\n\t\t\t# if he is, erase from database\n exist.destroy\n\t\t\t# show pop up regarding unfollow success\n gflash :success => \"You are no longer following #{@following.login}!\"\n else\n gflash :error => \"You are already not following #{@following.login}!\"\n end\n redirect_to :action => 'profile', :username => @following.login\n end",
"def destroy\n response = current_user.unfollow_item(params[:id])\n redirect_to items_path\n end",
"def destroy\n @account_email = AccountEmail.where(:account_id => params[:id], :email => params[:email])\n @account_email.destroy\n\n respond_to do |format|\n format.html { redirect_to kaui_engine.account_email_path(params[:id]) }\n format.json { head :no_content }\n end\n end",
"def unfollow!(other_user)\n\t\tself.relationships.find_by_followed_id(other_user.id).destroy\n\tend",
"def destroy\n @email = DirectEmail.find(params[:id])\n @email.destroy\n head :no_content\n end",
"def unfollow!(model, relation = \"follow\")\n if self != model && self.follows?(model, relation)\n self.before_unfollow(model) if self.respond_to?('before_unfollow')\n self.followees.where(:followee_type => model.class.name, :followee_id => model.id, relation: relation).delete_all\n self.after_unfollow(model) if self.respond_to?('after_unfollow')\n return true\n else\n return false\n end\n end",
"def destroy\n result = access_token.delete(\"/api/v1/emails/#{params[:id]}\")\n display_api_response( result )\n respond_with(\"\",:location => :back)\n end",
"def unfollow(other_person)\n active_relationships.find_by(followed_id: other_person.id).destroy\n end",
"def destroy\n current_account.unfollow(@account)\n respond_to do |format|\n format.html { redirect_to account_url }\n format.json { render :status }\n end\n end",
"def unfollow\n userToUnFollow = User.find_by_id(params[:id])\n begin\n if userToUnFollow\n @currentUser.unfollow_user(userToUnFollow)\n flash[:notice] = \"#{userToUnFollow} unfollowed successfully\"\n end\n rescue Exception => e\n flash[:notice] = e.message\n end\n #Do not want to display a blank search page to the user - head to the user index\n if session[:last_page] == search_path\n redirect_to(:action => \"index\")\n else\n redirect_to(session[:last_page])\n end\n end",
"def user_unfollows\n if user_signed_in?\n Rails.logger.debug { \"The user to be unfollowed is #{params[:id]}\" }\n user = User.find(id: params[:id])\n user.follows.delete(current_user)\n end\n \n end",
"def unfollowed(other_user)\n passive_relationships.find_by(follower_id: other_user.id).try(:destroy) \n end",
"def delete()\n\n Email.destroy(self.id)\n end",
"def destroy\n @email = Email.find(params[:id])\n @email.destroy\n head :no_content\n end",
"def unfollow(user)\n self.following.delete(user)\n end",
"def unfollow(other_user)\n following_relationships.find_by(followed_id: other_user.id).destroy\n end",
"def unfollow(keyword_id)\n developer = Developer.find(self.id)\n keyword = Keyword.find(keyword_id)\n developer.keywords.delete(keyword)\n end",
"def destroy\n set_email.destroy\n flash[:notice] = \"Email Deleted!\"\n redirect_to user_emails_path(current_user.id)\n end",
"def unfollow(actor)\n contact = contact_to!(actor)\n contact.update_column(:blocked, true)\n contact\n end",
"def destroy\n @emailId = @email.id;\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url, notice: 'Email supprimé !' }\n format.json { head :no_content }\n format.js{}\n end\n end",
"def unfollow\n fs = Friendship.where(user_id: current_user, friend_id: params[:id]).first\n if fs\n fs.destroy\n redirect_to user_url(params[:id]), notice: \"This user was removed from your list of friends.\"\n else\n flash.alert = \"Something went wrong. You weren't following that user.\"\n redirect_to users_url\n end\n end",
"def unfollow_user(follow_user)\n #before we can destroy the link we must check if the user is already not following the other user\n #or if the user is trying to unfollow themself.\n #if the user can follow the other user then that means no relationship exists\n if can_follow?(follow_user)\n raise \"Can't unfollow yourself or a user that you are not already following!\"\n else\n followRel = Follow.find(:first, :conditions => {:user_id => self.id, :follow_user_id => follow_user.id})\n followRel.destroy\n end\n end",
"def destroy\n @user = User.find(params[:id])\n if @user\n current_user.unfollow(@user)\n flash[:notice] = \"Unfollow #{@user.username}\"\n else\n flash[:notice] = 'Something happens please try again'\n end\n redirect_to request.referer\n end",
"def destroy\n @email = Email.find(params[:id])\n @organizer = Organizer.find(params[:organizer_id])\n @email.destroy\n \n respond_to do |format|\n format.html { flash[:message]=\"email contact successfully deleted !\"\n redirect_to(organizer_emails_path(@organizer)) }\n format.xml { head :ok }\n end\n end",
"def unfollow\n \n # Get the specified user, making sure that it exists\n @user = User.find_by_login(params[:user_login])\n \n # Find the follow relationship between the current user and the specified\n # user\n @follow = Follow.find(:first, :conditions => \"follower_id = #{current_user.id} and followee_id = #{@user.id}\")\n \n # Destroy the follow relationship\n @follow.destroy\n current_user.save!\n \n # Redirect back to the profile of the user that was being followed\n flash[:notice] = \"You are no longer following #{@user.login}.\"\n redirect_to user_profile_url(:user_login => @user.login)\n end",
"def unfollow(user)\n following = out_followings.find_by(to_id: user.id)\n if following\n following.destroy\n true\n else\n false\n end\n end",
"def unfollow_fan_base!(followed)\r\n fan_relationships.find_by_followed_id(followed).destroy\r\n end",
"def unfollow!(user)\n followings.find_by(following_id: user.id)&.destroy!\n end",
"def destroy\n @follow = Follow.where(follower_id: current_user.id, followed_id: params[:id]).first\n @follow.destroy\n redirect_to users_path, notice: 'You successfully unfollowed'\n end",
"def destroy\n @boat_user_email = BoatUserEmail.find(params[:id])\n @boat_user_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_user_emails_url) }\n format.xml { head :ok }\n end\n end",
"def unsubscribe\n user = User.where(email: params[:md_email]).first\n user.unsubscribe!\n\n redirect_to root_path, notice: t(\"unsubscribed\")\n end",
"def ufu\r\n \r\n @follow = FollowUser.where(user_id: @u_id, second_user_id: params[:id])\r\n if @follow[0].destroy\r\n redirect_to follow_path\r\n end\r\n end",
"def followup\n @id = params[:id]\n @original_msg = Message.find @id\n @record = Message.new\n @record.following_up = @id \n @record.subject = \"Following up on message #@id, \\\"#{@original_msg.subject}\\\"\" \n @record.sms_only = \"f/u msg ##@id\"\n @record.body = \"This is SIMon, the SIM Nigeria database gopher. I haven't seen a reply from you \" +\n \"showing that you received message ##{@id}. Could it be in your junk mail folder? We really \" +\n \"do want to be sure that you got this message so please make sure you've read it and then \" +\n \"just reply to this message or the original one.\"\n end",
"def destroy\n delayed_email = @email_account.delayed_emails.find_by(:uid => params[:delayed_email_uid])\n delayed_email.destroy!() if delayed_email\n\n render :json => {}\n end",
"def delete_email\n\t\tcheck_delete_email_params\n\t\tEmail.delete(params[:email_id])\n\t\tredirect_to user_path(id: params[:user_id])\n\tend",
"def unfollow_user(user)\n following.delete(user)\n end",
"def reply_neg\n puts 'AWW BOO'\n # byebug\n friend_deny=Follow.find_by(follower_id: follow_params[:user2], followee_id: decode_jwt(cookies.signed[:jwt])[\"user_id\"])\n if friend_deny.destroy\n render json: {friend_deny: 'success'}\n else\n render json: {friend_deny: 'failure'}\n end\n end"
] |
[
"0.7630782",
"0.6792433",
"0.6586819",
"0.6576068",
"0.6387172",
"0.62111574",
"0.6207159",
"0.61068124",
"0.6105808",
"0.60904616",
"0.6076346",
"0.6070551",
"0.60258234",
"0.5998773",
"0.5945903",
"0.5939272",
"0.5929783",
"0.59136593",
"0.58873963",
"0.5886025",
"0.58742744",
"0.58742744",
"0.5858669",
"0.58570415",
"0.5854424",
"0.58481747",
"0.583397",
"0.58226967",
"0.5810293",
"0.5790971",
"0.5783461",
"0.5773591",
"0.57692176",
"0.57593155",
"0.5756654",
"0.5728604",
"0.57095563",
"0.57095563",
"0.57095563",
"0.57095563",
"0.57095563",
"0.5699546",
"0.56916183",
"0.569159",
"0.5691237",
"0.56835175",
"0.5678999",
"0.5678999",
"0.5678999",
"0.5677371",
"0.5674935",
"0.5671934",
"0.5671934",
"0.5671934",
"0.5671733",
"0.56684476",
"0.5654881",
"0.56523263",
"0.565088",
"0.5646815",
"0.5644394",
"0.5636609",
"0.56320244",
"0.5629596",
"0.5612532",
"0.5607723",
"0.5605688",
"0.5603654",
"0.5601992",
"0.55897117",
"0.5581513",
"0.55795366",
"0.5577657",
"0.55604726",
"0.55599356",
"0.5552032",
"0.5551607",
"0.5537968",
"0.55363685",
"0.553388",
"0.5532736",
"0.5526911",
"0.5525837",
"0.5504987",
"0.55034775",
"0.55000657",
"0.5499126",
"0.5495093",
"0.5494026",
"0.54921204",
"0.54906446",
"0.5490053",
"0.5485628",
"0.5485433",
"0.54839146",
"0.5476288",
"0.54711235",
"0.5468175",
"0.54638195",
"0.5463109"
] |
0.77144367
|
0
|
GET /experiments GET /experiments.json
|
def index
@experiments = policy_scope Experiment.where(user_id: current_user.id).order(created_at: :desc).page(params[:page])
respond_to do |format|
format.html
format.csv {
send_data( @experiments.to_csv,
filename: "CO2_by_experiment_#{Time.zone.now}.csv",
disposition: 'inline', type: "multipart/related")
}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def fetch_experiments(page)\n puts page\n url = @base + \"/api/v1/experiments.json?token=#{@token}&page=#{page}\"\n response = JSON.parse(RestClient.get(url))\nend",
"def list_experiments\n @interface.list_experiments\n end",
"def index\n @experiments = list_public\n begin\n @experiments_by_user = current_user.experiments\n rescue Exception\n # seems we dont have a session\n end\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @experiments }\n end\n end",
"def index\n @experiments = Experiment.all\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def experimentList\n @allExperiments = UteExperiment.where(:is_private => false, :is_active => true).where(\n :$or => [\n {:campaign_end_at.gte => Time.now.getutc.to_f},\n {:campaign_end_at => nil},\n ]\n )#.pluck(:experiment_code, :talias)\n #[ \n # #UteExperiment.where(:owner => session[:user_id], :is_private => true, :is_active => true), #no personalisation yet implemented\n # UteExperiment.where(:is_private => false, :is_active => true).pluck(:experiment_code, :talias)\n #].collect { |aoc| aoc.to_a}.flatten\n #@sessionlist = Session.where(:is_active => true).map{ |x| \n # { \n # :session_number => x.session_number, \n # :id => x.id, \n # :isexposed => true \n # } \n #}\n @experimentlist = []\n @allExperiments.each do |experiment| \n @experimentlist << {\n experiment_id: experiment.experiment_code,\n is_cacheable: experiment.is_cacheable,\n talias: experiment.talias,\n title: experiment.title,\n description: experiment.text\n }\n end\n respond_to do |format|\n format.html { render text: 'Experiment list: <br/>' + { 'experiments' => @experimentlist }.to_json }\n format.json { \n render json: { 'experiments' => @experimentlist }.to_json \n }\n end\n end",
"def index\n set_experiments \n end",
"def index\n @ezii_robot_experiments = EziiRobotExperiment.all\n end",
"def index\n @experiments = Experiment.where(pend_status: [0])\n @experiments_wait = Experiment.where(pend_status: [1])\n end",
"def index\n @experiments = Experiment.all.order(:project_id)\n end",
"def index\n if params[:format].nil? or params[:format] == 'html'\n @iteration = params[:iteration][/\\d+/] rescue 1\n @experiments = Experiment.sorted_order(\"#{sort_column} #{sort_direction}\").search(params[:search]).paginate(\n :page => params[:page], \n :per_page => params[:DataTables_Table_0_length]\n )\n else\n @experiments = Experiment.api_search(params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.xml { render :xml => @experiments }\n format.csv { render :csv => @experiments }\n format.json { render :json => @experiments }\n end\n end",
"def getExperimentDetails\n @experiment = UteExperiment.where(:experiment_code => params[:experiment_id], :is_active => true).first\n if @experiment\n response = { 'title' => @experiment.title, 'description' => @experiment.text }.to_json\n respond_to do |format|\n format.html { render text: 'Experiment details: <br/>' + response }\n format.json { \n render json: response \n }\n end\n else\n response = nil.to_json\n respond_to do |format|\n format.html { render text: 'Experiment details: <br/>' + response }\n format.json { \n render json: response \n }\n end\n end\n end",
"def show\n @projects = @dataset.experiments.collect { |experiment| experiment.project }.uniq\n end",
"def show\n @experiment = Experiment.find(params[:id])\n \n #Determine if the experiment is cloned\n @cloned_experiment = nil\n if(!@experiment.cloned_from.nil?)\n @cloned_experiment = Experiment.find(@experiment.cloned_from)\n end\n \n #Get number of likes\n @likes = @experiment.likes.count\n \n @liked_by_cur_user = false\n if(Like.find_by_user_id_and_experiment_id(@cur_user,@experiment.id)) \n @liked_by_cur_user = true\n end\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @projects = @setting.experiments.collect { |experiment| experiment.project }.uniq\n end",
"def index\n admin_role = Role.find_by_name( 'admin' )\n if params[:search]\t\t\t\n @experiments = Experiment.search( params[:search], params[:page] )\n else\n @experiments = User.find_by_role_id( admin_role.id ).experiments.find_all_by_published( true )\n @experiments = @experiments.paginate( :page => params[:page], :order => 'name' );\n end\n @search = params[:search]\n end",
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end",
"def results_info\n render json: {results: @experiment.results, error_reason: @experiment.error_reason}\n end",
"def index\n @experiments = experiment_type_class.where(phase_id: params[:phase_id])\n end",
"def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end",
"def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def new\n @experiment = Experiment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_control }\n end\n end",
"def show\n @experiment_software = ExperimentSoftware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @experiment_software }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def index\n @experiments = Experiment.where(:user_id => current_user.id)\n page_group(current_user.group)\n page_title(\"Experiments\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end",
"def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n unless current_user_is_admin? or @experiment.visibility == \"public\" or @experiment.user == current_user\n #@experiemnt_alternatives = find_alternatives_for(@experiment)\n render '_notpublic'\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def index\n @solutions = @idea.solutions.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @solutions }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def index\n unless params[:assignment_id]\n render json: format_errors({ base: ['This Endpoint requires a assignment_id in the params'] }),\n status: :bad_request\n return\n end\n\n @iterations = current_user.iterations(includes: includes_array)\n .where(assignment_id: params[:assignment_id])\n serialize_collection @iterations, :ok\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def show\n render json: @laboratory\n end",
"def index\n @contests = Contest.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"def get\n @research_output = @service.get({type: params[:graph], detail: params[:detail], id: params[:id]},\n host: request.env[\"HTTP_HOST\"], limit: params[:num_results], offset: params[:start_offset], :per_project => params[:per_project], format: params[:format])\n\n respond_with @research_output\n end",
"def random_experiment\n @running_experiments = if not current_user.nil?\n current_user.get_running_experiments\n elsif not sm_user.nil?\n sm_user.scalarm_user.get_running_experiments\n else\n []\n end\n\n if (experiment = @running_experiments.sample).nil?\n render inline: '', status: 404\n else\n render inline: experiment.id.to_s\n end\n end",
"def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def index\n #@experiments = Experiment.all\n @experiments = Experiment.paginate :per_page => 5, :page => params[:page], :order => \"id DESC\", :conditions => ['status=1']\n @datasets=[]\n @experiments.each do |exp|\n @datasets << createThumbJSON(Rails.root.join(\"public\",\"SAX_DATA\", exp.data_directory, \"iofq_data_file.dat\")) \n end\n \n respond_to do |format|\n format.html { render :action => \"list\"} # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end",
"def index\n @competition_interaction_observations = CompetitionInteractionObservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competition_interaction_observations }\n end\n end",
"def index\n iterations = policy_scope(Iteration)\n render json: iterations\n end",
"def index\n @api_v1_exercises = Api::V1::Exercise.all\n end",
"def index\n permitted_to! :inspect, Problem.find(params[:problem_id])\n @test_sets = TestSet.where(:problem_id => params[:problem_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @test_sets }\n end\n end",
"def index\n @exercise_sets = ExerciseSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_sets }\n end\n end",
"def get_api_results(_url)\n JSON.parse File.read('spec/inspector/stubbed_example.json')\n end",
"def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end",
"def index\n @problems = Problem.all\n\n render json: @problems\n end",
"def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end",
"def get_experiments(cas)\n \n begin\n # query for all experiments of a chemical then do intersection with instances passed in. \n tmp = @sparql.query(\"#{PREFIX}\n SELECT ?assay\n FROM <genetox>\n WHERE{\n ?assay genetox:hasSubstance ?substance .\n ?substance genetox:hasCASRegistryNumber #{cas} .\n }\")\n return tmp\n rescue SPARQL::Client::MalformedQuery => e \n STDERR.puts \"error finding experimental URIS\" + e.backtrace.join(\"\\n\")\n end\n end",
"def show\n render json: @exercise_template\n end",
"def index\n @my_exams = MyExam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_exams }\n end\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def index\n @programme_exercises = ProgrammeExercise.all\n end",
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"def interesting(options = {})\n response = Typhoeus::Request.get(\"#{DARKSKY_API_URL}/interesting/#{@api_key}\", DEFAULT_OPTIONS.dup.merge(options))\n JSON.parse(response.body) if response.code == 200 \n end",
"def index\n @competitions = Competition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competitions }\n end\n end",
"def experiment_name\n self['experiment']\n end",
"def index\n\n if !signed_in?\n\t flash.now[:notice] = \"No Partner found!! Login with authenticated partner credentials!!!\"\n\t redirect_to samplings_path\n else\n \n\t #@experiments = Experiment.all\n\t @title = \"Microarray experiments\"\n\t \n\t if params[:id].present?\n\n\t\t logger.warn(\"#{Time.now} - experiments filtered by: #{params[:id]}\") \n\t \n\t\t\n\t begin\n\t\tcode_gen = OligoSequence.find_by_id(params[:id]).code\n\t\tol = Oligo.find_all_by_code(code_gen).collect{|p| p.microarraygal_id}\n\n\t @experiments = Experiment.find(:all, :conditions => [ \"microarraygal_id IN (?)\", ol])\n\t\tindex_columns ||= [:id,:act,:exp_code,:gal_code,:exp_date,:edit] \n\t\tcurrent_page = params[:page] ? params[:page].to_i : 1\n\t\trows_per_page = params[:rows] ? params[:rows].to_i : 10\n\n conditions={:page => current_page, :per_page => rows_per_page}\n conditions[:order] = params[\"sidx\"] + \" \" + params[\"sord\"] unless (params[:sidx].blank? || params[:sord].blank?)\n \n\t\t if params[:_search] == \"true\"\n\t\t conditions[:conditions]=filter_by_conditions(index_columns)\n\t\t end\n \n\n rescue \t\t \n @experiments = Experiment.find(:all, :conditions => [ \"filter_sample_id = ?\", params[:id]]) \n end\n\n\t\t @page_experiments=Experiment.paginate(conditions)\n\t\t total_entries=@page_experiments.total_entries\n\t \n\t\t respond_with(@experiments) do |format|\n\t\t format.json { render :json => @experiments.to_jqgrid_json(index_columns, current_page, rows_per_page, total_entries)} \n\t\t end \n\n else\n \n\t\tindex_columns ||= [:id,:act,:exp_code,:filter_name,:gal_code,:partner_name,:gpr_code,:exp_date,:mi_image, :check, :edit]\n\t\tcurrent_page = params[:page] ? params[:page].to_i : 1\n\t\trows_per_page = params[:rows] ? params[:rows].to_i : 10\n\n\t\tconditions={:page => current_page, :per_page => rows_per_page}\n\t\tconditions[:order] = params[\"sidx\"] + \" \" + params[\"sord\"] unless (params[:sidx].blank? || params[:sord].blank?)\n\t\t \n\t\tif params[:_search] == \"true\"\n\t\t conditions[:conditions]=filter_by_conditions(index_columns)\n\t\tend\n\n\t\t@experiments = Experiment.find(:all, :joins=>[:partner, :filter_sample, :microarraygal])\n \n\t\t@page_experiments=Experiment.paginate(conditions)\n\t\ttotal_entries=@page_experiments.total_entries\n\t \n\t\t respond_with(@experiments) do |format|\n\t\t format.json { render :json => @experiments.to_jqgrid_json(index_columns, current_page, rows_per_page, total_entries)} \n\t\t end\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @experiment_groups = ExperimentGroup.all\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"def index\n @teaches = Teach.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teaches }\n end\n end",
"def get_work\n client.make_request('/get-work', 'post', params: {})\n end",
"def index\n @exercises = Exercise.all\n @user = current_user # changed get logged user\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def reload_experiments\n @interface.reload_experiments\n true\n end",
"def index\n @notebooks = Notebook.all\n render json: @notebooks\n end",
"def show\n if Experiment.exists?(params[:id])\n # featurelimit = 250\n # @types = Feature.where(experiment_id: params[:id]).limit(featurelimit).pluck(:feature).uniq\n logger.error \"looking up exp: #{params[:id]}\"\n @experiment = Experiment.find(params[:id])\n @seqs = @experiment.features.pluck(:seqid).uniq\n @firstseq = params[:segment]\n if @firstseq.nil?\n @firstseq = @seqs.first\n end\n #@experiment.meta = JSON::parse @experiment.meta if @experiment.meta\n respond @experiment\n else\n respond :false\n end\n end",
"def index\n @exhibits = Exhibit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exhibits }\n end\n end",
"def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end",
"def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end",
"def index\n @cohorts = current_user.accessible_cohorts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cohorts }\n end\n end",
"def update\n @experiment = @project.experiments.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n sanitized_params = parse_params(simulation_where_params)\n simulations = Simulation.find_all(sanitized_params)\n\n render json: simulations\n end",
"def index\n @s = Script.find(params[:script_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def set_experiment\n @experiment = Experiment.includes( :goals, :hypotheses ).find(params[:id])\n end",
"def show\n @solution = @idea.solutions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solution }\n end\n end",
"def show\n @experiment_biomechanical = ExperimentBiomechanical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_biomechanical }\n end\n end",
"def show\n @experiment = Experiment.obfuscated_query(params[:id]).includes(:slots).first\n page_group(@experiment.user.group)\n \n if @experiment.nil? or !@experiment.can_modify?(current_user)\n access_denied\n return\n end\n page_title(@experiment.name)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def index\n @challenges = Challenge.order(:id)\n .includes(:user)\n .page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"def index\n @ideas = Idea.all\n\n render json: @ideas\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @examples }\n end\n end",
"def test\n get(\"/help/test.json\")\n end",
"def test\n get(\"/help/test.json\")\n end",
"def index\n @studies = Study.all\n #render json: @studies\n end",
"def index\n puts \"Index method called...\"\n @studies = Study.all\n\n # render json: @studies\n end",
"def show\n @samples = current_power.project_samples(@project)\n # all exisiting project are null, we ensure private projects are explicitly set to 0\n respond_to do |format|\n format.html\n format.json do\n render json: {\n id: @project.id,\n name: @project.name,\n public_access: @project.public_access.to_i,\n created_at: @project.created_at,\n total_sample_count: @samples.count\n }\n end\n end\n end",
"def index\n @do_exercises = DoExercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @do_exercises }\n end\n end"
] |
[
"0.7667902",
"0.7530987",
"0.7359154",
"0.7343492",
"0.7326762",
"0.71903574",
"0.6902807",
"0.6902807",
"0.66268927",
"0.6429425",
"0.6400744",
"0.639056",
"0.6327911",
"0.6229816",
"0.6228492",
"0.620189",
"0.6152306",
"0.6130331",
"0.6111056",
"0.61105174",
"0.6051929",
"0.5990705",
"0.5965295",
"0.59645706",
"0.59528285",
"0.5945747",
"0.5945257",
"0.5916658",
"0.5916658",
"0.585456",
"0.5854188",
"0.5830506",
"0.5827807",
"0.581297",
"0.581297",
"0.5795045",
"0.5770025",
"0.57690126",
"0.57474244",
"0.57428056",
"0.5632031",
"0.5614937",
"0.5592628",
"0.5582614",
"0.5573461",
"0.5573461",
"0.5573461",
"0.5566232",
"0.5558164",
"0.55375683",
"0.55326766",
"0.55318534",
"0.5523217",
"0.5517785",
"0.5510939",
"0.55069363",
"0.55058765",
"0.5500592",
"0.54874337",
"0.548554",
"0.547592",
"0.54720795",
"0.5428268",
"0.5428268",
"0.5426875",
"0.5422578",
"0.5421214",
"0.54210275",
"0.5420479",
"0.5420479",
"0.5409447",
"0.54077005",
"0.5406206",
"0.5406206",
"0.5404692",
"0.54040664",
"0.5394294",
"0.5393629",
"0.53890365",
"0.538524",
"0.53847784",
"0.53835404",
"0.5374697",
"0.5365799",
"0.53634566",
"0.53612334",
"0.53528047",
"0.5350734",
"0.5349071",
"0.5346474",
"0.5343241",
"0.5343222",
"0.533597",
"0.5332523",
"0.5330258",
"0.53281116",
"0.53281116",
"0.5320773",
"0.5311927",
"0.5309759",
"0.53042406"
] |
0.0
|
-1
|
GET /experiments/1 GET /experiments/1.json
|
def show
respond_to do |format|
format.html
format.csv {
send_data @experiment.to_csv,
filename: "#{@experiment.id}-#{@experiment.name}.csv",
disposition: 'inline', type: "multipart/related"
}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def fetch_experiments(page)\n puts page\n url = @base + \"/api/v1/experiments.json?token=#{@token}&page=#{page}\"\n response = JSON.parse(RestClient.get(url))\nend",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def index\n @experiments = Experiment.all\n end",
"def index\n @experiments = list_public\n begin\n @experiments_by_user = current_user.experiments\n rescue Exception\n # seems we dont have a session\n end\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @experiments }\n end\n end",
"def list_experiments\n @interface.list_experiments\n end",
"def index\n @experiments = Experiment.where(pend_status: [0])\n @experiments_wait = Experiment.where(pend_status: [1])\n end",
"def show\n @experiment = Experiment.find(params[:id])\n \n #Determine if the experiment is cloned\n @cloned_experiment = nil\n if(!@experiment.cloned_from.nil?)\n @cloned_experiment = Experiment.find(@experiment.cloned_from)\n end\n \n #Get number of likes\n @likes = @experiment.likes.count\n \n @liked_by_cur_user = false\n if(Like.find_by_user_id_and_experiment_id(@cur_user,@experiment.id)) \n @liked_by_cur_user = true\n end\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @experiment = Experiment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def getExperimentDetails\n @experiment = UteExperiment.where(:experiment_code => params[:experiment_id], :is_active => true).first\n if @experiment\n response = { 'title' => @experiment.title, 'description' => @experiment.text }.to_json\n respond_to do |format|\n format.html { render text: 'Experiment details: <br/>' + response }\n format.json { \n render json: response \n }\n end\n else\n response = nil.to_json\n respond_to do |format|\n format.html { render text: 'Experiment details: <br/>' + response }\n format.json { \n render json: response \n }\n end\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def index\n @experiments = Experiment.all.order(:project_id)\n end",
"def index\n set_experiments \n end",
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end",
"def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_control }\n end\n end",
"def show\n @projects = @dataset.experiments.collect { |experiment| experiment.project }.uniq\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def show\n @experiment_software = ExperimentSoftware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @experiment_software }\n end\n end",
"def index\n if params[:format].nil? or params[:format] == 'html'\n @iteration = params[:iteration][/\\d+/] rescue 1\n @experiments = Experiment.sorted_order(\"#{sort_column} #{sort_direction}\").search(params[:search]).paginate(\n :page => params[:page], \n :per_page => params[:DataTables_Table_0_length]\n )\n else\n @experiments = Experiment.api_search(params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.xml { render :xml => @experiments }\n format.csv { render :csv => @experiments }\n format.json { render :json => @experiments }\n end\n end",
"def show\n @projects = @setting.experiments.collect { |experiment| experiment.project }.uniq\n end",
"def experimentList\n @allExperiments = UteExperiment.where(:is_private => false, :is_active => true).where(\n :$or => [\n {:campaign_end_at.gte => Time.now.getutc.to_f},\n {:campaign_end_at => nil},\n ]\n )#.pluck(:experiment_code, :talias)\n #[ \n # #UteExperiment.where(:owner => session[:user_id], :is_private => true, :is_active => true), #no personalisation yet implemented\n # UteExperiment.where(:is_private => false, :is_active => true).pluck(:experiment_code, :talias)\n #].collect { |aoc| aoc.to_a}.flatten\n #@sessionlist = Session.where(:is_active => true).map{ |x| \n # { \n # :session_number => x.session_number, \n # :id => x.id, \n # :isexposed => true \n # } \n #}\n @experimentlist = []\n @allExperiments.each do |experiment| \n @experimentlist << {\n experiment_id: experiment.experiment_code,\n is_cacheable: experiment.is_cacheable,\n talias: experiment.talias,\n title: experiment.title,\n description: experiment.text\n }\n end\n respond_to do |format|\n format.html { render text: 'Experiment list: <br/>' + { 'experiments' => @experimentlist }.to_json }\n format.json { \n render json: { 'experiments' => @experimentlist }.to_json \n }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end",
"def results_info\n render json: {results: @experiment.results, error_reason: @experiment.error_reason}\n end",
"def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def show\n render json: @laboratory\n end",
"def index\n @ezii_robot_experiments = EziiRobotExperiment.all\n end",
"def index\n @experiments = experiment_type_class.where(phase_id: params[:phase_id])\n end",
"def show\n if Experiment.exists?(params[:id])\n # featurelimit = 250\n # @types = Feature.where(experiment_id: params[:id]).limit(featurelimit).pluck(:feature).uniq\n logger.error \"looking up exp: #{params[:id]}\"\n @experiment = Experiment.find(params[:id])\n @seqs = @experiment.features.pluck(:seqid).uniq\n @firstseq = params[:segment]\n if @firstseq.nil?\n @firstseq = @seqs.first\n end\n #@experiment.meta = JSON::parse @experiment.meta if @experiment.meta\n respond @experiment\n else\n respond :false\n end\n end",
"def get\n @research_output = @service.get({type: params[:graph], detail: params[:detail], id: params[:id]},\n host: request.env[\"HTTP_HOST\"], limit: params[:num_results], offset: params[:start_offset], :per_project => params[:per_project], format: params[:format])\n\n respond_with @research_output\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n unless current_user_is_admin? or @experiment.visibility == \"public\" or @experiment.user == current_user\n #@experiemnt_alternatives = find_alternatives_for(@experiment)\n render '_notpublic'\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def show\n @experiment_biomechanical = ExperimentBiomechanical.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_biomechanical }\n end\n end",
"def index\n @api_v1_exercises = Api::V1::Exercise.all\n end",
"def show\n render json: @exercise_template\n end",
"def index\n @problems = Problem.all\n\n render json: @problems\n end",
"def index\n #@experiments = Experiment.all\n @experiments = Experiment.paginate :per_page => 5, :page => params[:page], :order => \"id DESC\", :conditions => ['status=1']\n @datasets=[]\n @experiments.each do |exp|\n @datasets << createThumbJSON(Rails.root.join(\"public\",\"SAX_DATA\", exp.data_directory, \"iofq_data_file.dat\")) \n end\n \n respond_to do |format|\n format.html { render :action => \"list\"} # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end",
"def index\n permitted_to! :inspect, Problem.find(params[:problem_id])\n @test_sets = TestSet.where(:problem_id => params[:problem_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @test_sets }\n end\n end",
"def get_api_results(_url)\n JSON.parse File.read('spec/inspector/stubbed_example.json')\n end",
"def update\n @experiment = @project.experiments.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @experiments = Experiment.where(:user_id => current_user.id)\n page_group(current_user.group)\n page_title(\"Experiments\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @experiments }\n end\n end",
"def show\n @notebook = Notebook.find(params[:id])\n render json: @notebook\n end",
"def index\n @contests = Contest.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"def index\n @solutions = @idea.solutions.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @solutions }\n end\n end",
"def show\n @solution = @idea.solutions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solution }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"def show\n @samples = current_power.project_samples(@project)\n # all exisiting project are null, we ensure private projects are explicitly set to 0\n respond_to do |format|\n format.html\n format.json do\n render json: {\n id: @project.id,\n name: @project.name,\n public_access: @project.public_access.to_i,\n created_at: @project.created_at,\n total_sample_count: @samples.count\n }\n end\n end\n end",
"def show\n @laboratory = Laboratory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laboratory }\n end\n end",
"def show\n @research = Research.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @research }\n end\n end",
"def show\n @exercise = Exercise.find_by_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def index\n @exercise_sets = ExerciseSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_sets }\n end\n end",
"def show\n @programme = Programme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programme }\n end\n end",
"def index\n admin_role = Role.find_by_name( 'admin' )\n if params[:search]\t\t\t\n @experiments = Experiment.search( params[:search], params[:page] )\n else\n @experiments = User.find_by_role_id( admin_role.id ).experiments.find_all_by_published( true )\n @experiments = @experiments.paginate( :page => params[:page], :order => 'name' );\n end\n @search = params[:search]\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n begin\n @example = Example.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n # last URL parameter is not example ID, but the example's number\n @example = @language.examples.where(number: params[:id].to_i).first\n end\n @examples = [@example]\n respond_to do |format|\n format.html { render 'examples/index' } # also show index.html.erb\n format.json { render json: @example }\n end\n end",
"def index\n @competition_interaction_observations = CompetitionInteractionObservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competition_interaction_observations }\n end\n end",
"def show\n @study = Study.find(params[:id])\n render json: @study\n end",
"def show\n @contest = Contest.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contest }\n end\n end",
"def show\n @exercise_set = ExerciseSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_set }\n end\n end",
"def show\n @scratcher = Scratcher.find(params[:id])\n\n render json: @scratcher\n end",
"def index\n unless params[:assignment_id]\n render json: format_errors({ base: ['This Endpoint requires a assignment_id in the params'] }),\n status: :bad_request\n return\n end\n\n @iterations = current_user.iterations(includes: includes_array)\n .where(assignment_id: params[:assignment_id])\n serialize_collection @iterations, :ok\n end",
"def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end",
"def show\n @exercise_log = ExerciseLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_log }\n end\n end",
"def show\n simulation = Simulation.retrieve_by_id(params[:id])\n\n render json: simulation\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exercise }\n end\n end",
"def random_experiment\n @running_experiments = if not current_user.nil?\n current_user.get_running_experiments\n elsif not sm_user.nil?\n sm_user.scalarm_user.get_running_experiments\n else\n []\n end\n\n if (experiment = @running_experiments.sample).nil?\n render inline: '', status: 404\n else\n render inline: experiment.id.to_s\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @s = Script.find(params[:script_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"def show\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contest }\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @lab = Lab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab }\n end\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n \n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @part_three_predict = PartThreePredict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_three_predict }\n end\n end",
"def index\n @answers = Answer.where(url_params)\n if @answers.size == 1\n @answers.first!\n end\n render json: @answers\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def show\n @routine_interview = RoutineInterview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @routine_interview }\n end\n end",
"def show\n @testing_algorithm = TestingAlgorithm.find(params[:id])\n\n render json : @testing_algorithm\n end",
"def show\n @experiment = Experiment.obfuscated_query(params[:id]).includes(:slots).first\n page_group(@experiment.user.group)\n \n if @experiment.nil? or !@experiment.can_modify?(current_user)\n access_denied\n return\n end\n page_title(@experiment.name)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def index\n @notebooks = Notebook.all\n render json: @notebooks\n end",
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"def show\n @competition_interaction_observation = CompetitionInteractionObservation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competition_interaction_observation }\n end\n end",
"def index\n @my_exams = MyExam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_exams }\n end\n end"
] |
[
"0.79396844",
"0.7346767",
"0.7245662",
"0.7141944",
"0.7141944",
"0.6896397",
"0.6868181",
"0.64089096",
"0.63052094",
"0.6292195",
"0.62845546",
"0.6263365",
"0.6244442",
"0.6244442",
"0.6235063",
"0.6218515",
"0.62050456",
"0.6160553",
"0.61324143",
"0.61285055",
"0.61171454",
"0.60732627",
"0.60707223",
"0.6057947",
"0.60561085",
"0.6043646",
"0.60351765",
"0.5952947",
"0.5952941",
"0.5940001",
"0.59283835",
"0.5888532",
"0.5870725",
"0.583072",
"0.583072",
"0.583072",
"0.58178204",
"0.58102155",
"0.58102155",
"0.58097637",
"0.5749599",
"0.5723697",
"0.5701582",
"0.5687054",
"0.56795156",
"0.5676908",
"0.5675764",
"0.5673863",
"0.56614655",
"0.5652124",
"0.5637405",
"0.5635288",
"0.56263334",
"0.5606187",
"0.56059134",
"0.56059134",
"0.55996174",
"0.5591378",
"0.5591131",
"0.5588715",
"0.55860776",
"0.55818224",
"0.55763364",
"0.55646306",
"0.55625015",
"0.5562255",
"0.55611026",
"0.5556782",
"0.55489445",
"0.55452067",
"0.5539414",
"0.5535898",
"0.55339426",
"0.55316085",
"0.55302215",
"0.55217534",
"0.55187875",
"0.5516148",
"0.5516148",
"0.5506215",
"0.5504908",
"0.55036986",
"0.55036986",
"0.5501457",
"0.5497783",
"0.54966027",
"0.54966027",
"0.54936904",
"0.5492625",
"0.5487321",
"0.54853886",
"0.54853886",
"0.54853886",
"0.54833776",
"0.5481497",
"0.5471139",
"0.54490024",
"0.5444484",
"0.5444484",
"0.54370415",
"0.5435972"
] |
0.0
|
-1
|
POST /experiments POST /experiments.json
|
def create
@experiment = Experiment.new(experiment_params)
authorize @experiment
success = @experiment.save
edit_helper()
success &= @experiment.save
respond_to do |format|
if success
format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }
format.json { render :show, status: :created, location: @experiment }
else
format.html { @devices = policy_scope(Device.where(user_id: current_user.id)); render :new }
format.json { render json: @experiment.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @experiment = Experiment.new(params[:experiment])\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n \n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n\n if @experiment.save\n redirect_to @experiment, notice: 'Experiment was successfully created.'\n else\n redirect_to experiments_path, notice: 'Experiment could not be created.'\n end\n end",
"def create\n @experiment = @project.experiments.new(params[:experiment].merge({ :user_id => current_user.id }))\n respond_to do |format|\n if current_user.save_object(@experiment)\n flash[:notice] = 'Experiment was successfully created.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def experiment_params\n params.require(:experiment).permit(:title, :description, :project_id, :algorithm_id, :setting_id, :dataset_id)\n end",
"def create\n #@experiment = Experiment.new(params[:experiment])\n \n if(params[:experiment_id])\n @tmp_exp = Experiment.find(params[:experiment_id])\n @experiment = Experiment.new({user_id: @cur_user.id, title:\"#{@tmp_exp.title} (clone)\", content: @tmp_exp.content, filter: @tmp_exp.filter, cloned_from:@tmp_exp.id})\n success = @experiment.save\n @tmp_exp.fields.all.each do |f|\n Field.create({experiment_id:@experiment.id, field_type: f.field_type, name: f.name, unit: f.unit})\n end\n else\n @experiment = Experiment.new({user_id: @cur_user.id, title:\"#{@cur_user.firstname} #{@cur_user.lastname[0].pluralize} Experiment\"})\n success = @experiment.save\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render json: @experiment, status: :created, location: @experiment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n @experiment.user = current_user\n @experiment.visibility = params[:experiment][:visibility] == 1 ? :public : :private\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to @experiment, notice: 'Experiments was successfully created.' }\n #format.json { render json: @experiment, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @experiment = Experiment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def experiment_params\n params.require(:experiment).permit(:name, :metric, :estimated_result_date, :bet_by_date, :result)\n end",
"def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def experiment_params\n params.require(:experiment).permit(:variety, :tissue, :age, :stress, :accession)\n end",
"def create\n @experiment = experiment_type_class.new(experiment_params)\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to sti_experiment_path(@project.id, @phase.id, @experiment.type, @experiment), notice: 'Experiment was successfully created.' }\n format.json { render :show, status: :created, location: @experiment }\n else\n format.html { render :new }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # must pass user_id information since session id is not available \n # in the model\n @experiment = Experiment.new( params[:experiment] )\n @experiment.user = current_user\n\n respond_to do |format|\n if @experiment.save\n format.html { \tflash[:notice] = 'Experiment was successfully created.'\n\t\t\tredirect_to(@experiment) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def experiment_params\n params[:experiment].permit( Experiment.new.attributes.keys )\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def index\n @experiments = Experiment.all\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def index\n set_experiments \n end",
"def experiment_params\n case experiment_type\n when 'ProblemExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n \n :today_solution\n )\n when 'SolutionExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :price_proposed,\n :price_acceptance,\n :price_revised\n )\n when 'ProductExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :sean_ellis_test\n )\n when 'CustomerExperiment'\n params.require(experiment_type.underscore.to_sym).permit(\n :project_id,\n :phase_id,\n :type,\n :name, :description, :completed, :status,\n {hypothesis_ids: []},\n {results_attributes: [:id, :validation_level, :pain_level, :priority, :comment]},\n :interviews_planned,\n :interviews_done,\n\n :early_adopters_planned,\n :early_adopters_converted\n )\n end\n\n end",
"def create_custom_points_experiment\n validate(\n simulation_id: :security_default\n )\n\n experiment = ExperimentFactory.create_custom_points_experiment(current_user.id, @simulation)\n experiment.save\n\n {\n status: :ok,\n json: {status: 'ok', experiment_id: experiment.id.to_s},\n experiment: experiment\n }\n end",
"def create\n @ci_experiment = CiExperiment.new(ci_experiment_params)\n\n respond_to do |format|\n if @ci_experiment.save\n format.html { redirect_to @ci_experiment, notice: 'Ci experiment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ci_experiment }\n else\n format.html { render action: 'new' }\n format.json { render json: @ci_experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ci_experiment_params\n params.require(:ci_experiment).permit(:game, :alpha, :delta, :step_size, :aggregate_level, :wait_length, :max_step, :data)\n end",
"def create\n @ezii_robot_experiment = EziiRobotExperiment.new(ezii_robot_experiment_params)\n\n respond_to do |format|\n if @ezii_robot_experiment.save\n format.html { redirect_to @ezii_robot_experiment, notice: 'Ezii robot experiment was successfully created.' }\n format.json { render :show, status: :created, location: @ezii_robot_experiment }\n else\n format.html { render :new }\n format.json { render json: @ezii_robot_experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def fetch_experiments(page)\n puts page\n url = @base + \"/api/v1/experiments.json?token=#{@token}&page=#{page}\"\n response = JSON.parse(RestClient.get(url))\nend",
"def create\n logger.debug \"::::::::::::::::::::microarray experiments create action (\" + current_user.name + \"):::::::::::::::::::: \"\n \n @experiment = Experiment.new(params[:experiment])\n @title = \"Microarray experiments\"\n \n \n \n @valid = false\n if @experiment.partner.nil?\n flash.now[:error] = \"No partner found for this microarray experiments\"\n @valid = true\n end\n\n if @valid\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n return \n end\n\n @pt = get_partner\n @experiment.ecode = get_code(@pt, @experiment.experiment_date, nil)\n\n @title = \"Experiment\"\n\n respond_to do |format|\n if @experiment.save\n \n\n format.html { \n flash[:notice] = 'New experiment is successfully created (You can check the oligos, used in this experiment, by clicking on the \"+\" sign on individual experiments row!!!)'\n redirect_to :action => \"index\" }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n\n #@partners = Partner.find(:all)\n @codegen = @experiment.code\n @attr_index = 1\n @pt = get_partner\n\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(experiment_params)\n set_experiments\n respond_to do |format| \n if @experiment.save\n @show_modal = 'hide'\n format.html { redirect_to @experiment, notice: 'Experiment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @experiment }\n format.js\n else\n @show_modal = 'show'\n format.html { render action: 'new' }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def permitted_params\n params.permit(:id, experiment: [:image, :name, :description, :contact, :home_url, :issues_url, :source_url, :download_url, :documentation_url, :meta_keywords, :meta_description])\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def create\n exercise = Exercise.create(exercise_params)\n if exercise\n render json: exercise\n else\n render json: {error: 'Workout was not created.'}\n end\n end",
"def create\n\n @experiment = Experiment.new(params[:experiment])\n @experiment.user_id = current_user.id\n\n respond_to do |format|\n if @experiment.save\n format.html { redirect_to(@experiment, :notice => 'Experiment was successfully created.') }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n format.csv { render :csv => @experiment, :status => :created, :location => @experiment }\n format.json { render :json => @experiment, :status => :created, :location => @experiment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n format.csv { render :csv => @experiment.errors, :status => :unprocessable_entity }\n format.json { render :json => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @experiments = list_public\n begin\n @experiments_by_user = current_user.experiments\n rescue Exception\n # seems we dont have a session\n end\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @experiments }\n end\n end",
"def experiment_params\n params.require(:experiment).permit(:name, :user_id,:custom_field_1_name,:custom_field_2_name,:custom_field_3_name)\n end",
"def demographics\n @t = Task.find(params[:id])\n #need to make sure to indicate a certain worker has seen the experiment before\n if SawExperiment.find_by_task_id_and_mturk_worker_id(@t.id, params[:workerId]).nil?\n SawExperiment.create(:task_id => @t.id, :mturk_worker_id => params[:workerId])\n end\n if request.post? \n Demographic.create(params[:demographic].merge(:mturk_worker_id => params[:workerId]))\n redirect_to :action => :index, :id => @t.id, :assignmentId => params[:assignmentId], :workerId => params[:workerId]\n end\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url, notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url, notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @experiment_software = ExperimentSoftware.new(params[:experiment_software])\n\n respond_to do |format|\n if @experiment_software.save\n format.html { redirect_to @experiment_software, :notice => 'Experiment software was successfully created.' }\n format.json { render :json => @experiment_software, :status => :created, :location => @experiment_software }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @experiment_software.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_experiments\n @interface.list_experiments\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n authorize! :manage, @experiments\n data_file = \"#{Rails.root.to_s}/public/SAX_DATA/#{@experiment.data_directory}/summary.txt\" \n @experiment.id = nil\n\n #\n if !@experiment.structural_model.nil?\n @experiment.structural_model.data_directory = @experiment.data_directory \n @experiment.structural_model.force_create = true \n end\n\n if !@experiment.ensemble.nil?\n submission = Submission.find_by_data_directory(@experiment.data_directory)\n ensemble_directory = Rails.root.join(\"public\",\"SAX_DATA\", @experiment.data_directory, \"ensemble\") \n @experiment.ensemble.data_directory = ensemble_directory\n #\n # open ensemble directory and grab all *.pdb files\n #\n @experiment.ensemble.diagnostic_file_name = submission.diagnostic_file_name\n @experiment.ensemble.diagnostic_file_size = submission.diagnostic_file_size\n @experiment.ensemble.diagnostic_content_type = submission.diagnostic_content_type \n# @diag_extension = @submission.diagnostic_content_type.split(/\\//)[1]\n\n @extension = !(@experiment.ensemble.diagnostic_content_type.nil?) ? @experiment.ensemble.diagnostic_content_type.split(/\\//)[1] : nil \n\n @pdbs = Array.new\n @pdbs = Dir.glob(\"#{ensemble_directory}/*.pdb\") \n end \n if !@experiment.no_model.nil?\n @experiment.no_model.data_directory = @experiment.data_directory \n end\n if !@experiment.dammin_result.nil?\n @experiment.dammin_result.data_directory = @experiment.data_directory \n end \n if !@experiment.gasbor_results.empty?\n @experiment.gasbor_results[0].data_directory = @experiment.data_directory \n end \n \n respond_to do |format|\n if @experiment.save\n write_experiment(@experiment, @experiment.data_directory)\n # remove from submissions\n format.html { redirect_to :action=> 'admin_list', :notice => 'Experiment was successfully created.' }\n else \n \n flash[:notice] = @experiment.errors.inspect\n #@experiment.id = Experiment.find(:first, :order => \"id DESC\").id + 1 \n format.html { redirect_to approve_experiments_path(:id => @experiment.data_directory) } \n end\n end\n \n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def show\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment }\n end\n end",
"def experiment_params\n params.require(:experiment).permit(:name, :location, :start, :end, :details,\n :co2_cutoff).merge(user_id: current_user.id)\n #{:device_ids => []}, # If this is included, ActiveRecord deletes the devices that don't have data submitted for them on update.\n end",
"def update\n @experiment = @project.experiments.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def exercise_params\n params.require(:exercise).permit(:workout_id, :title, :sets, :reps)\n end",
"def new\n logger.debug \"::::::::::::::::::::microarray experiment create new (\" + current_user.name + \"):::::::::::::::::::: \"\n \n @experiment = Experiment.new\n @title = \"Microarray experiments\"\n\n @mg_c = Microarraygal.count()\n if @mg_c.nil? or @mg_c == 0\n flash[:error] = \"No microarraygal found! create first someone...\"\n redirect_to :action => \"index\"\n return\n end\n \n @partners = Partner.find(:all)\n @pt = get_partner\n if @pt.nil?\n @mg = Microarraygal.all()\n @gp = Microarraygpr.all()\n @img = MicroArrayImage.all() \n else\n @mg = Microarraygal.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @gp = Microarraygpr.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @img = MicroArrayImage.all(:conditions => [ \"partner_id = ?\", @pt.id])\n @experiment.partner_id = @pt.id\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def experimentList\n @allExperiments = UteExperiment.where(:is_private => false, :is_active => true).where(\n :$or => [\n {:campaign_end_at.gte => Time.now.getutc.to_f},\n {:campaign_end_at => nil},\n ]\n )#.pluck(:experiment_code, :talias)\n #[ \n # #UteExperiment.where(:owner => session[:user_id], :is_private => true, :is_active => true), #no personalisation yet implemented\n # UteExperiment.where(:is_private => false, :is_active => true).pluck(:experiment_code, :talias)\n #].collect { |aoc| aoc.to_a}.flatten\n #@sessionlist = Session.where(:is_active => true).map{ |x| \n # { \n # :session_number => x.session_number, \n # :id => x.id, \n # :isexposed => true \n # } \n #}\n @experimentlist = []\n @allExperiments.each do |experiment| \n @experimentlist << {\n experiment_id: experiment.experiment_code,\n is_cacheable: experiment.is_cacheable,\n talias: experiment.talias,\n title: experiment.title,\n description: experiment.text\n }\n end\n respond_to do |format|\n format.html { render text: 'Experiment list: <br/>' + { 'experiments' => @experimentlist }.to_json }\n format.json { \n render json: { 'experiments' => @experimentlist }.to_json \n }\n end\n end",
"def index\n @experiments = Experiment.where(pend_status: [0])\n @experiments_wait = Experiment.where(pend_status: [1])\n end",
"def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end",
"def destroy\n @ci_experiment.destroy\n respond_to do |format|\n format.html { redirect_to ci_experiments_url }\n format.json { head :no_content }\n end\n end",
"def index\n @experiments = Experiment.all.order(:project_id)\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def set_experiment\n @experiment = Experiment.find(params[:id])\n end",
"def create\n @experience = Experience.new(experience_params)\n byebug\n respond_to do |format|\n if @experience.save\n create_occurences\n format.html { redirect_to @experience, notice: 'Experience was successfully created.' }\n format.json { render :show, status: :created, location: @experience }\n else\n format.html { render :new }\n format.json { render json: @experience.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @experiment = Experiment.new(params[:experiment])\n \n @experiment.user = current_user\n page_group(@experiment.user.group)\n \n location = Location.obfuscated(params[:location_id])\n @experiment.location = location\n calendar = GoogleCalendar.obfuscated(params[:calendar_id])\n @experiment.google_calendar = calendar\n respond_to do |format|\n if @experiment.save\n flash[:notice] = 'Experiment was successfully created.'\n format.html { redirect_to(:controller => :experiments, :action => :show, :id => @experiment.hashed_id) }\n format.xml { render :xml => @experiment, :status => :created, :location => @experiment }\n else\n @calendars = self.calendars_select_array()\n @locations = self.locations_select_array()\n self.use_markdown_editor = true\n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to project_phase_path(@project.id, @phase.id), notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @experiment = Experiment.new\n @experiment.user_id = current_user.id\n @instruction = Instruction.new(instruction_params)\n @instruction.experiment_id = @experiment.id\n if @instruction.save\n redirect_to @instruction, notice: 'Instruction was successfully created.'\n else\n render :new\n end\n end",
"def create\n @experiment_group = ExperimentGroup.new(experiment_group_params)\n\n respond_to do |format|\n if @experiment_group.save\n format.html { redirect_to @experiment_group, notice: 'Experiment group was successfully created.' }\n format.json { render :show, status: :created, location: @experiment_group }\n else\n format.html { render :new }\n format.json { render json: @experiment_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def conduct_experiment\n @simulation = Simulation.find_by_id(params[:simulation_id].to_s)\n @simulation_input = @simulation.input_specification\n end",
"def conjoint_experiment_params\n params.require(:conjoint_experiment).permit!\n end",
"def create\n @exercise = @workout.exercises.new(exercise_params)\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: I18n.t('exercises.created') }\n format.json { render :show, status: :created, location: @exercise }\n else\n format.html { render :new }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @experiment_control = ExperimentControl.new(params[:experiment_control])\n\n respond_to do |format|\n if @experiment_control.save\n format.html { redirect_to @experiment_control, notice: 'Experiment control was successfully created.' }\n format.json { render json: @experiment_control, status: :created, location: @experiment_control }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment_control.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prediction_params\n params.require(:prediction).permit(:body, :expires_at, :resolution_date, :tags, :group_id, :contest_id, :contest_stage_id)\n end",
"def create\n if @test.done.blank?\n redirect_to root_path, warning: \"This test have not finished yet\"\n return\n end\n params[:submission] = {}\n params[:submission][:user_id] = current_user.id\n @submission = @test.submissions.create(submission_params)\n respond_to do |format|\n if @submission.save\n @test.questions.each do |question|\n question.answers.each do |answer|\n answer.answers_of_questions.create({choice: false, question_id: question.id, submission_id: @submission.id})\n end\n end\n format.html { redirect_to edit_test_submission_path(@test, @submission) }\n else\n format.html { render :new }\n end\n end\n end",
"def new\n @testcase = Testcase.new\n 3.times { @testcase.scripts.build }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @testcase }\n end\n end",
"def new\n @experiment_software = ExperimentSoftware.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @experiment_software }\n end\n end",
"def create\n workout = Workout.find params[:workout_id]\n result = Question.create(workout, { \n :body => params[:body], \n :answer_type => params[:answer_type] }, \n params[:answers].values\n )\n\n @question = result[:question]\n\n respond_to do |format|\n unless @question.persisted?\n format.json { render :json => @question.errors.full_messages, :status => :unprocessable_entity }\n else\n format.json { render :json => @question.as_json({:include => :answers}) }\n end\n \n end\n\n end",
"def create\n\n reviews = []\n params[:scores].keys.each{ |name|\n score = params[:scores][name]\n peer_review = PeerReview.new(name:name, score:score, miniproject_id:params[:project][:id])\n peer_review.save\n reviews << peer_review\n }\n\n render json: reviews\n\n end",
"def create\n @programme_exercise = ProgrammeExercise.new(programme_exercise_params)\n\n respond_to do |format|\n if @programme_exercise.save\n format.html { redirect_to @programme_exercise, notice: 'Programme exercise was successfully created.' }\n format.json { render action: 'show', status: :created, location: @programme_exercise }\n else\n format.html { render action: 'new' }\n format.json { render json: @programme_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n validate(\n experiment_id: [:optional, :security_default]\n )\n\n render 'infrastructure/index', locals: { experiment_id: params[:experiment_id].to_s }\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_mod\n if params[:title] != nil && params[:content] != nil && params[:subId] != nil && params[:userId] != nil && params[:groupId] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n @question.subId = params[:subId].to_i\n @question.userId = params[:userId].to_i\n @question.groupId = params[:groupId].to_i\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/createQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully created\"\n redirect_to questions_path\n\n end\n end",
"def exercise_params\n params.require(:exercise).permit(:name, :question, :feedback,\n :experience, :id, :is_public, :priority, :question_type,\n :exercise_version, :exercise_version_id, :commit,\n :mcq_allow_multiple, :mcq_is_scrambled, :languages, :styles,\n :tag_ids)\n end",
"def new\n page_title(\"New Experiment\")\n \n @experiment = Experiment.new\n page_group(current_user.group)\n \n @calendars = self.calendars_select_array()\n @locations = self.locations_select_array()\n self.use_markdown_editor = true\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experiment }\n end\n end",
"def create\n @testing_algorithm = TestingAlgorithm.new(params[:testing_algorithm])\n\n if @testing_algorithm.save\n render json : @testing_algorithm, status : :created, location : @testing_algorithm\n else\n render json : @testing_algorithm.errors, status : :unprocessable_entity\n end\n end",
"def new\n @experiment_control = ExperimentControl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment_control }\n end\n end",
"def results_info\n render json: {results: @experiment.results, error_reason: @experiment.error_reason}\n end",
"def create\n @solution = @idea.solutions.new(feature: params[:toSent]) #@idea.solutions.new(params[:solution])\n\n if @solution.save\n render json: { text: \"success\", id: \"#{@solution.id}\" }\n else\n render json: { text: \"fail\"}\n end\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @experiments = experiment_type_class.where(phase_id: params[:phase_id])\n end",
"def create\n @workout = Workout.new(workout_params)\n if user_signed_in?\n @workout.owner = current_user\n @workout.users << current_user\n else\n @workout.owner = temp_user\n session[:workout_id] = @workout.id\n end \n @workout.save\n ex_params = exercise_params[:exercise].map do |e|\n e[:dur] = e[:dur][:minutes].to_i*60 + e[:dur][:seconds].to_i\n e[:workout_id] = @workout.id\n e\n end\n @exercises = @workout.exercises.create(ex_params)\n\n respond_to do |format|\n if @workout.save\n format.html { redirect_to @workout, notice: \"Workout was successfully created\" }\n format.json { render json: {workoutId: @workout.id}, status: 200 }\n else\n format.html { render :new }\n format.json { render json: @workout.errors, status: 500 }\n end\n end\n end",
"def index\n @ezii_robot_experiments = EziiRobotExperiment.all\n end",
"def create\n if has_missing_params?([:test_output, :test_run_id])\n # incomplete/invalid HTTP params\n render 'shared/http_status', locals: {code: '422', message:\n HttpStatusHelper::ERROR_CODE['message']['422']}, status: 422\n return\n end\n test_run = TestRun.find(params[:test_run_id])\n begin\n test_run.create_test_script_results_from_json(params[:test_output])\n render 'shared/http_status', locals: {code: '201', message:\n HttpStatusHelper::ERROR_CODE['message']['201']}, status: 201\n rescue\n # Some other error occurred\n render 'shared/http_status', locals: { code: '500', message:\n HttpStatusHelper::ERROR_CODE['message']['500'] }, status: 500\n end\n rescue ActiveRecord::RecordNotFound => e\n # Could not find submission\n render 'shared/http_status', locals: {code: '404', message:\n e}, status: 404\n end",
"def create\n unless current_user.assignments.find_by(id: params[:assignment_id])\n render json: format_errors({ assignment_id: [\"is not one of current user's assignments\"] }),\n status: :forbidden\n return\n end\n\n @iteration = Iteration.create(iteration_params)\n\n if @iteration.save\n render json: @iteration, status: :created\n else\n render json: format_errors(@iteration.errors),\n status: :unprocessable_entity\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n raise SecurityError unless (@experiment.user == current_user) or current_user_is_admin?\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n #format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to sti_experiment_path(@project.id, @phase.id, @experiment.type, @experiment), notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @contest = Contest.new\n @problem_count = 4\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contest }\n end\n end"
] |
[
"0.6731312",
"0.67238855",
"0.6701503",
"0.6701503",
"0.6330069",
"0.6288955",
"0.62831366",
"0.6231525",
"0.62300014",
"0.61524117",
"0.6121359",
"0.6111961",
"0.60304946",
"0.6018281",
"0.6018281",
"0.5988996",
"0.5973845",
"0.5968556",
"0.5965805",
"0.5955416",
"0.59215045",
"0.5918436",
"0.5913806",
"0.5863456",
"0.5822298",
"0.57738525",
"0.57627845",
"0.57411325",
"0.5735151",
"0.56619114",
"0.5653711",
"0.5586134",
"0.558508",
"0.558508",
"0.558508",
"0.55811703",
"0.54981494",
"0.5496097",
"0.54771185",
"0.5462036",
"0.5449894",
"0.5449894",
"0.544708",
"0.54047835",
"0.540136",
"0.5393215",
"0.5393215",
"0.53700304",
"0.53230155",
"0.5316927",
"0.53108656",
"0.53098565",
"0.5244713",
"0.5237373",
"0.52241004",
"0.5223937",
"0.5209353",
"0.5209353",
"0.5209353",
"0.52032846",
"0.5198093",
"0.5193249",
"0.51888674",
"0.5187598",
"0.5180261",
"0.51794565",
"0.5172468",
"0.5164567",
"0.51604956",
"0.51604956",
"0.51560473",
"0.5154359",
"0.51520616",
"0.51492214",
"0.5148875",
"0.5145883",
"0.51437193",
"0.51429504",
"0.5142922",
"0.5142922",
"0.5134855",
"0.5132741",
"0.5126741",
"0.5124647",
"0.5121609",
"0.5116174",
"0.5113505",
"0.5111711",
"0.5111086",
"0.51086444",
"0.5108225",
"0.5108225",
"0.5100769",
"0.5097214",
"0.5095624",
"0.50949436",
"0.5090028",
"0.5087623",
"0.5081136",
"0.50749564"
] |
0.5511675
|
36
|
PATCH/PUT /experiments/1 PATCH/PUT /experiments/1.json
|
def update
respond_to do |format|
edit_helper()
updated = @experiment.update(experiment_params)
if updated
format.html { redirect_to @experiment, notice: flash[:notice] || 'Experiment was successfully updated.' }
format.json { render :show, status: :ok, location: @experiment }
else
format.html { render :edit, notice: 'Unable to update experiment.' }
format.json { render json: @experiment.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = @project.experiments.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to([@project,@experiment]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = Experiment.find(params[:id])\n @title = \"Microarray experiments\"\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to(@experiment, :notice => 'Microarray experiment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n respond_to do |format|\n if @experiment.update(experiment_params)\n format.html { redirect_to sti_experiment_path(@project.id, @phase.id, @experiment.type, @experiment), notice: 'Experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @experiment }\n else\n format.html { render :edit }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_exercise.update(api_v1_exercise_params)\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_exercise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def patch!\n request! :patch\n end",
"def update\n @experiment = Experiment.find(@datapoint.experiment_id)\n respond_to do |format|\n if @datapoint.update(datapoint_params)\n format.html { redirect_to @experiment, notice: 'Datapoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datapoint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @programme_exercise.update(programme_exercise_params)\n format.html { redirect_to @programme_exercise, notice: 'Programme exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n\tformat.html {\tflash[:notice] = 'Experiment was successfully updated.'\n \t\t\tredirect_to(@experiment) }\n\tformat.xml { head :ok }\n\tformat.js { head :ok }\n else\n\tformat.html { render :action => \"edit\" }\n\tformat.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n\t\n end\n \n\n end\n end",
"def update\n respond_to do |format|\n if @ci_experiment.update(ci_experiment_params)\n format.html { redirect_to @ci_experiment, notice: 'Ci experiment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ci_experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n set_experiments\n respond_to do |format|\n if @experiment.update(experiment_params)\n @show_modal = 'hide'\n format.js \n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n format.json { head :no_content }\n else\n @show_modal = 'show'\n format.js\n format.html { render action: 'edit' }\n format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n if @experiment.update(experiment_params)\n redirect_to @experiment, notice: 'Experiment was successfully updated.'\n else\n redirect_to experiments_path, notice: 'Experiment could not be updated.'\n end\n end",
"def update\n\n @laboratory = Laboratory.find(params[:id])\n\n if @laboratory.update!(laboratory_params)\n render json: @laboratory\n else \n render json: @laboratory.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @experiment_id = args[:experiment_id] if args.key?(:experiment_id)\n @partial_cdoc = args[:partial_cdoc] if args.key?(:partial_cdoc)\n end",
"def update\n @experiment = Experiment.find(params[:id])\n raise SecurityError unless (@experiment.user == current_user) or current_user_is_admin?\n\n # updates the visibility from checkbox to \"public\" or \"private\"\n params[:experiment][:visibility]= params[:experiment][:visibility] == \"1\" ? \"public\" : \"private\"\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, :notice => 'exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update!(**args)\n @experiment_id_list = args[:experiment_id_list] if args.key?(:experiment_id_list)\n @mode = args[:mode] if args.key?(:mode)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def update!(**args)\n @experiment_id_list = args[:experiment_id_list] if args.key?(:experiment_id_list)\n @mode = args[:mode] if args.key?(:mode)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def update\n @experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n format.html { redirect_to(@experiment, :notice => 'Experiment was successfully updated.') }\n format.xml { head :ok }\n format.csv { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n format.csv { render :csv => @experiment.errors, :status => :unprocessable_entity }\n format.json { render :json => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @interesting = Interesting.find(params[:id])\n\n respond_to do |format|\n if @interesting.update_attributes(params[:interesting])\n format.html { redirect_to @interesting, notice: 'Interesting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interesting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @solution = @idea.solutions.find(params[:id])\n\n if @solution.update_attributes(params[:solution])\n render json: { text: \"success\" }\n else\n render json: { text: \"fail\"}\n end\n end",
"def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"def update\n @scratcher = Scratcher.find(params[:id])\n\n if @scratcher.update(permitted_params)\n head :no_content\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end",
"def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end",
"def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"def update\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to @specie, notice: 'Specie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise_set = ExerciseSet.find(params[:id])\n\n respond_to do |format|\n if @exercise_set.update_attributes(params[:exercise_set])\n format.html { redirect_to @exercise_set.workout, notice: 'Exercise set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @notebook = Notebook.find(params[:id])\n\n if @notebook.update_attributes(params[:notebook])\n head :no_content\n else\n render json: @notebook.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: I18n.t('exercises.updated') }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n end",
"def update\n respond_to do |format|\n if @ezii_robot_experiment.update(ezii_robot_experiment_params)\n format.html { redirect_to @ezii_robot_experiment, notice: 'Ezii robot experiment was successfully updated.' }\n format.json { render :show, status: :ok, location: @ezii_robot_experiment }\n else\n format.html { render :edit }\n format.json { render json: @ezii_robot_experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:class] = \"alert alert-success\"\n format.html { redirect_to @exercise, :notice => 'exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n p = trial_params.clone\n if p[\"question_ids\"].nil?\n p[\"question_ids\"] = []\n end\n\n respond_to do |format|\n if @trial.update(p)\n format.html { redirect_to @trial, notice: 'Trial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end",
"def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to exams_path, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @experiment_id = args[:experiment_id] if args.key?(:experiment_id)\n @name = args[:name] if args.key?(:name)\n end",
"def patch(path, **args); end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update(path)\n output { patch(path, params) }\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update!(**args)\n @double_indexing_experiment_id = args[:double_indexing_experiment_id] if args.key?(:double_indexing_experiment_id)\n @dup_experiment_id = args[:dup_experiment_id] if args.key?(:dup_experiment_id)\n @key = args[:key] if args.key?(:key)\n end",
"def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n if @experiment_control.update_attributes(params[:experiment_control])\n format.html { redirect_to @experiment_control, notice: 'Experiment control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment_control.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: \"Exercise was successfully updated.\" }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to [@clclass,@exercise], notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: [@clclass,@exercise].errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @expertise = Expertise.find(params[:id])\n\n if @expertise.update(expertise_params)\n head :no_content\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def update\n @problem = Problem.find(params[:id])\n\n if @problem.update(problem_params)\n head :no_content\n else\n render json: @problem.errors, status: :unprocessable_entity\n end\n end",
"def edit\n respond_with(@exercise)\n end",
"def update\n @notebook = Notebook.find(params[:id])\n\n respond_to do |format|\n if @notebook.update_attributes(params[:notebook])\n format.html { redirect_to @notebook, notice: 'Notebook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @notebook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @notebook = Notebook.find(params[:id])\n\n respond_to do |format|\n if @notebook.update_attributes(params[:notebook])\n format.html { redirect_to @notebook, notice: 'Notebook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @notebook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def updated\n @gameName = params[:gameName]\n @experimentName = params[:oldExperimentName]\n ob = store_experiment params\n \n t = Experiment.where(gameName:@gameName,experimentName:@experimentName).update_all(ob)\n if t==0\n return false\n end\n render 'updated' \n end",
"def update\n respond_to do |format|\n if @exercise_program.update(exercise_program_params)\n format.html { redirect_to @exercise_program, notice: 'Exercise program was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise_program }\n else\n format.html { render :edit }\n format.json { render json: @exercise_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @judge.update(permitted_attributes(Judge))\n format.html { redirect_to @judge, notice: I18n.t('controllers.updated', model: Judge.model_name.human) }\n format.json { render :show, status: :ok, location: @judge }\n else\n format.html { render :edit }\n format.json { render json: @judge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exam.update(exam_params)\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @predict = Predict.find(params[:id])\n\n respond_to do |format|\n if @predict.update_attributes(params[:predict])\n format.html { redirect_to @predict, notice: 'Predict was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @predict.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to @dataset, notice: 'Dataset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment_software = ExperimentSoftware.find(params[:id])\n\n respond_to do |format|\n if @experiment_software.update_attributes(params[:experiment_software])\n format.html { redirect_to @experiment_software, :notice => 'Experiment software was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @experiment_software.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @gotcha = Gotcha.find(params[:id])\n\n respond_to do |format|\n if @gotcha.update_attributes(params[:gotcha])\n format.html { redirect_to @gotcha, notice: 'Gotcha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gotcha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @performed_exercise.update(performed_exercise_params)\n format.html { redirect_to @performed_exercise, notice: 'Performed exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @performed_exercise }\n else\n format.html { render :edit }\n format.json { render json: @performed_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @patient_exercise = PatientExercise.find(params[:id])\n\n respond_to do |format|\n if @patient_exercise.update_attributes(params[:patient_exercise])\n format.html { redirect_to @patient_exercise, notice: 'Patient exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n respond_with(@idea) do |format|\n if @idea.update_attributes(params[:idea])\n format.json { render json: @idea, status: :created, location: @idea }\n else\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n errors = Work.update(current_user, params[:id], work_params)\n if !errors\n format.json { render json: {}, status: :ok }\n else\n format.json { render json: { error: errors }, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lab = Lab.find(params[:id])\n\n respond_to do |format|\n if @lab.update_attributes(params[:lab])\n format.html { redirect_to @lab, notice: 'Lab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @testing_.update(testing__params)\n format.html { redirect_to @testing_, notice: 'Testing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @testing_.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @event, :notices => ['Hack was successfully updated.'] }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hack.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bench.update(bench_params.permit!)\n format.html { redirect_to @bench, notice: 'Benchmark was successfully updated.' }\n format.json { render :show, status: :ok, location: @bench }\n else\n format.html { render :edit }\n format.json { render json: @bench.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n authorize! :manage, @vspec\n\n respond_to do |format|\n if @vspec.update(vspec_params)\n format.html { redirect_to [@vspec.metric, @vspec], notice: 'Vspec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vspec.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @interested = Interested.find(params[:id])\n\n respond_to do |format|\n if @interested.update_attributes(params[:interested])\n format.html { redirect_to @interested, notice: 'Interested was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interested.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @specification = Specification.find(params[:id])\n\n respond_to do |format|\n if @specification.update_attributes(params[:specification])\n format.html { redirect_to @specification, notice: 'Specification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specification.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contest = Contest.find_by(path: params[:id])\n\n respond_to do |format|\n if @contest.update_attributes(params[:contest])\n format.html { redirect_to contest_path(@contest.path)+'/upload' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @contest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @reqdifficulty.update(reqdifficulty_params)\n format.html { redirect_to @reqdifficulty, notice: 'Reqdifficulty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reqdifficulty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end",
"def update\n params[:workout][:workout_date] = \"#{params[:workout][:workout_date]} #{params[:workout][:time]}\"\n params[:workout] = params[:workout].slice(:workout_date, :exercises_attributes)\n @lift_name = params[:workout][:exercises_attributes][\"0\"][:lift_id]\n params[:workout][:exercises_attributes][\"0\"][:lift_id] = Lift.find_by_lift_name(@lift_name).id\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n if @workout.update_attributes(params[:workout])\n format.html { redirect_to @workout, notice: 'Workout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n if @employ.update_attributes(params[:employ])\n format.html { redirect_to @employ, notice: 'Employ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lab = lab.find(params[:id])\n\n respond_to do |format|\n if @lab.update_attributes(params[:lab])\n format.html { redirect_to @lab, notice: 'lab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lab.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @my_exam = MyExam.find(params[:id])\n\n respond_to do |format|\n if @my_exam.update_attributes(params[:my_exam])\n format.html { redirect_to @my_exam, notice: 'My exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_exam.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6868849",
"0.6868849",
"0.68662554",
"0.6679155",
"0.6560851",
"0.6560851",
"0.6515518",
"0.6459844",
"0.6414508",
"0.6181979",
"0.6180029",
"0.6167458",
"0.6083707",
"0.6066918",
"0.60620916",
"0.60528105",
"0.6039418",
"0.60135585",
"0.5989134",
"0.59858453",
"0.5982551",
"0.5971181",
"0.5969701",
"0.59496444",
"0.5941259",
"0.5941259",
"0.5934521",
"0.5917495",
"0.5917495",
"0.5917495",
"0.5889124",
"0.5880993",
"0.5879864",
"0.58773434",
"0.58773434",
"0.58770746",
"0.5860811",
"0.585007",
"0.5843332",
"0.5823127",
"0.5808507",
"0.5783943",
"0.5763914",
"0.5756732",
"0.5754357",
"0.5747147",
"0.5744508",
"0.574321",
"0.5737554",
"0.5726388",
"0.57162315",
"0.57119405",
"0.57111543",
"0.57020193",
"0.5701481",
"0.5700598",
"0.5699779",
"0.5681937",
"0.5678109",
"0.5668002",
"0.5667139",
"0.5657165",
"0.56534314",
"0.56534314",
"0.56445175",
"0.56378436",
"0.5629508",
"0.56283414",
"0.56225646",
"0.56225646",
"0.5621457",
"0.5606398",
"0.5583497",
"0.55828065",
"0.55816096",
"0.5579692",
"0.5578947",
"0.5570842",
"0.5568537",
"0.5567471",
"0.5566301",
"0.55662525",
"0.5561407",
"0.55582416",
"0.5556747",
"0.55524904",
"0.55517215",
"0.5547916",
"0.55461466",
"0.55461466",
"0.5544137",
"0.5543393",
"0.55404484",
"0.55370253",
"0.5536334",
"0.55288243",
"0.5528135",
"0.5527569",
"0.5521371",
"0.5516226"
] |
0.6272914
|
9
|
DELETE /experiments/1 DELETE /experiments/1.json
|
def destroy
@experiment.destroy
respond_to do |format|
format.html {
begin
redirect_to :back, notice: 'Experiment was successfully destroyed.'
rescue ActionController::RedirectBackError
redirect_to experiments_url, notice: 'Experiment was successfully destroyed.'
end
}
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n set_experiments\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url, notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to experiments_url, notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ci_experiment.destroy\n respond_to do |format|\n format.html { redirect_to ci_experiments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.find(params[:id])\n raise SecurityError unless (@experiment.user == current_user) or current_user_is_admin?\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to experiments_url }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @experiment.destroy\n respond_to do |format|\n format.html { redirect_to project_phase_path(@project.id, @phase.id), notice: 'Experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment_raw_dataset.destroy\n respond_to do |format|\n format.html { redirect_to experiment_raw_datasets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n format.js\t { head :ok }\n end\n\n end",
"def destroy\n @ezii_robot_experiment.destroy\n respond_to do |format|\n format.html { redirect_to ezii_robot_experiments_url, notice: 'Ezii robot experiment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment.destroy\n redirect_to experiments_url, notice: 'Experiment was successfully destroyed.'\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @programme_exercise.destroy\n respond_to do |format|\n format.html { redirect_to programme_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_exercise.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n if !signed_in_and_master?\n flash[:notice] = \"Sorry. Only technical manager can delete data. Please, contact Roberto SPURIO to do it.\"\n redirect_to water_types_path\n else\n\n @experiment = Experiment.find(params[:id])\n @experiment.destroy\n @title = \"Microarray experiments\"\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_execution.destroy\n respond_to do |format|\n format.html { redirect_to exercise_executions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @experiment_control = ExperimentControl.find(params[:id])\n @experiment_control.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_controls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ai_contest = AiContest.find(params[:id])\n @ai_contest.destroy\n\n respond_to do |format|\n format.html { redirect_to ai_contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest = Contest.find_by(path: params[:id])\n\n destroy_directory(@contest.path)\n destroy_problems(@contest)#with submits\n destroy_participants(@contest)\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = Experiment.obfuscated(params[:id])\n page_group(@experiment.user.group)\n \n if @experiment.nil? or !@experiment.can_modify?(current_user)\n access_denied\n return\n end\n @experiment.destroy\n\n respond_to do |format|\n format.html { redirect_to(experiments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @experiment_biomechanical = ExperimentBiomechanical.find(params[:id])\n @experiment_biomechanical.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_biomechanicals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @dataset.destroy\n respond_to do |format|\n format.html { redirect_to study_path(@dataset.study), notice: 'Dataset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_log = ExerciseLog.find(params[:id])\n @exercise_log.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_logs_url }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @backend_tutorial_stat = Backend::TutorialStat.find(params[:id])\n @backend_tutorial_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_tutorial_stats_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @bench.destroy\n respond_to do |format|\n format.html { redirect_to benches_url, notice: 'Benchmark was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @contest.destroy\n respond_to do |format|\n format.html { redirect_to contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to clclass_exercises_path(@clclass) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_set = ExerciseSet.find(params[:id])\n @exercise_set.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_sets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = @subject.experiment\n @subject.destroy\n set_subjects\n respond_to do |format|\n format.html { redirect_to experiment_subjects_path(@experiment) }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @test_run.destroy\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n contest = @data_set.contest\n @data_set.destroy\n respond_to do |format|\n format.html { redirect_to admin_contest_url(contest), notice: 'Data set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_run = TestRun.accessible_by(current_ability).find(params[:id])\n @test_run.destroy\n\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dataset = Dataset.find(Dataset.decrypt(params[:id]))\n @dataset.works.each do |w|\n Work.check_n_destroy_locations(w)\n w.destroy\n end\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @patient_exercise = PatientExercise.find(params[:id])\n @patient_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @part_three_predict = PartThreePredict.find(params[:id])\n @part_three_predict.destroy\n\n respond_to do |format|\n format.html { redirect_to part_three_predicts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @judge_activity.destroy\n respond_to do |format|\n format.html { redirect_to judge_activities_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @do_exercise = DoExercise.find(params[:id])\n @do_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to do_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expectation = Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to expectations_url }\n format.json { head :no_content }\n end\n end",
"def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend",
"def destroy\n @test_run = TestRun.find(params[:id])\n @test_run.destroy\n\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_exam = MyExam.find(params[:id])\n @my_exam.destroy\n\n respond_to do |format|\n format.html { redirect_to my_exams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n @tutorial_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_quests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @exercise_program.destroy\n respond_to do |format|\n format.html { redirect_to exercise_programs_url, notice: 'Exercise program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solution = Solution.find(params[:id])\n @solution.destroy\n\n render json: { text: \"success\" }\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @contest = Contest.find(params[:id])\n @contest.destroy\n\n respond_to do |format|\n format.html { redirect_to contests_url, :notice => 'Contest was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #FIXME: Double check auth is working for deletion. Also, maybe should only delete if not associated with any experiments.\n @data_file.destroy\n \n respond_to do |format|\n format.html { redirect_to(data_files_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n laboratory_id = params[:id]\n\n begin\n @laboratory = Laboratory.find(laboratory_id)\n\n @laboratory.delete if @laboratory.status == true\n render json: \"#{@laboratory.nome} deletado com sucesso!\"\n\n rescue ActiveRecord::RecordNotFound\n render json: 'esse dado já foi deletado!'\n end\n end",
"def destroy\n @experiment_group.destroy\n respond_to do |format|\n format.html { redirect_to experiment_groups_url, notice: 'Experiment group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oncourse_exercise.destroy\n respond_to do |format|\n format.html { redirect_to oncourse_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n connection.destroy_experiment @id\n @created_at = @completed_at = nil\n end",
"def destroy\n @experiment_software = ExperimentSoftware.find(params[:id])\n @experiment_software.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_softwares_url }\n format.json { head :no_content }\n end\n end",
"def destroyit\n @judgement = Judgement.find(params[:id])\n @judgement.destroy\n\n respond_to do |format|\n format.html { redirect_to judgements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: \"Exercise was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @performance_test = PerformanceTest.find(params[:id])\n @performance_test.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_tests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @testing_.destroy\n respond_to do |format|\n format.html { redirect_to testing_s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cohort_program.destroy\n respond_to do |format|\n format.html { redirect_to cohort_programs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n contest = @problem.contest\n @problem.destroy\n respond_to do |format|\n format.html { redirect_to admin_contest_url(contest), notice: 'Problem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @playground = Playground.find(params[:id])\n @playground.destroy\n\n respond_to do |format|\n format.html { redirect_to playgrounds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @playground = Playground.find(params[:id])\n @playground.destroy\n\n respond_to do |format|\n format.html { redirect_to playgrounds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_plan = ExercisePlan.find(params[:id])\n @exercise_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_plans_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @file_example.destroy\n respond_to do |format|\n format.html { redirect_to file_examples_url, notice: 'File example was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example.update_attributes(:deleted => 1)\n respond_to do |format|\n format.html { redirect_to examples_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @performed_exercise.destroy\n respond_to do |format|\n format.html { redirect_to performed_exercises_url, notice: 'Performed exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab = lab.find(params[:id])\n @lab.destroy\n\n respond_to do |format|\n format.html { redirect_to labs_url }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { redirect_to reqdifficulties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jedi = Jedi.find(params[:id])\n @jedi.destroy\n\n respond_to do |format|\n format.html { redirect_to jedis_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @benchmark_test.destroy\n respond_to do |format|\n format.html { redirect_to benchmark_tests_url, notice: 'Benchmark test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab = Lab.find(params[:id])\n @lab.destroy\n\n respond_to do |format|\n format.html { redirect_to labs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercice = Exercice.find(params[:id])\n @exercice.destroy\n\n respond_to do |format|\n format.html { redirect_to exercices_url }\n format.json { head :no_content }\n end\n end",
"def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"def destroy\n @criterion = Criterion.find(params[:id])\n @criterion.destroy\n\n head :no_content\n end",
"def destroy\n @judge.destroy\n respond_to do |format|\n format.html { redirect_to judges_url, notice: 'Judge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contest.destroy\n respond_to do |format|\n format.html { redirect_to contests_url, notice: 'Contest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_exercise = DailyExercise.find(params[:id])\n @daily_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test = Test.find(params[:id])\n @test.destroy\n\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7767225",
"0.7686779",
"0.7686779",
"0.7686779",
"0.739096",
"0.739096",
"0.7304609",
"0.7304609",
"0.72437507",
"0.72247416",
"0.7127406",
"0.70632076",
"0.7017892",
"0.6855902",
"0.6814481",
"0.6706449",
"0.6654096",
"0.6626306",
"0.6596983",
"0.65348023",
"0.65348023",
"0.65348023",
"0.65348023",
"0.65345967",
"0.65227765",
"0.65052664",
"0.65052664",
"0.6494275",
"0.6475474",
"0.6460593",
"0.64515716",
"0.64486915",
"0.6448002",
"0.6425758",
"0.6424604",
"0.64146733",
"0.64133716",
"0.6405937",
"0.6402938",
"0.6402938",
"0.6402938",
"0.6402938",
"0.6398217",
"0.6397463",
"0.63864756",
"0.63732195",
"0.6368042",
"0.63644046",
"0.6355674",
"0.63538384",
"0.6349773",
"0.6349025",
"0.6347963",
"0.6332358",
"0.6317423",
"0.6316463",
"0.6315195",
"0.63052875",
"0.6302728",
"0.62869596",
"0.625752",
"0.6253862",
"0.62525773",
"0.6249113",
"0.6245513",
"0.62409043",
"0.6240095",
"0.6233108",
"0.622917",
"0.62268287",
"0.62258595",
"0.6225644",
"0.6225099",
"0.6221959",
"0.6221959",
"0.62216544",
"0.6221404",
"0.62191564",
"0.6207401",
"0.6204416",
"0.61954594",
"0.6192288",
"0.6192288",
"0.61909103",
"0.61879414",
"0.61848307",
"0.6180916",
"0.6179281",
"0.6174235",
"0.6173661",
"0.61733603",
"0.61724347",
"0.6170485",
"0.61673504",
"0.6165889",
"0.616286",
"0.6162172",
"0.6161878",
"0.6161366",
"0.61591196"
] |
0.6596383
|
19
|
Use callbacks to share common setup or constraints between actions.
|
def set_experiment
@experiment = Experiment.find(params[:id])
authorize @experiment
@devices = policy_scope Device.where(user_id: current_user.id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def experiment_params
params.require(:experiment).permit(:name, :location, :start, :end, :details,
:co2_cutoff).merge(user_id: current_user.id)
#{:device_ids => []}, # If this is included, ActiveRecord deletes the devices that don't have data submitted for them on update.
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def valid_params_request?; end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def url_whitelist; end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69802505",
"0.6781974",
"0.67470175",
"0.67430073",
"0.67350477",
"0.6593221",
"0.6504263",
"0.64988977",
"0.6481794",
"0.64800006",
"0.64568025",
"0.64411247",
"0.6379476",
"0.63765615",
"0.6368045",
"0.6320141",
"0.6300363",
"0.6300057",
"0.62952244",
"0.6294712",
"0.6293856",
"0.6290323",
"0.62816143",
"0.6241851",
"0.6241208",
"0.622036",
"0.62128764",
"0.62110275",
"0.61966056",
"0.61776453",
"0.617547",
"0.6174961",
"0.61654735",
"0.6153256",
"0.61516005",
"0.6149498",
"0.6123234",
"0.6118653",
"0.61077267",
"0.61061186",
"0.6093616",
"0.608318",
"0.6074428",
"0.60650206",
"0.60244286",
"0.6020295",
"0.60155797",
"0.6012826",
"0.6010141",
"0.6010141",
"0.60037106",
"0.600298",
"0.59979576",
"0.5994806",
"0.5994283",
"0.5993927",
"0.5980616",
"0.59667075",
"0.59614897",
"0.59610957",
"0.596071",
"0.5959614",
"0.59554",
"0.59542966",
"0.5946781",
"0.5940262",
"0.5940262",
"0.59401053",
"0.5937168",
"0.5932135",
"0.59293395",
"0.592659",
"0.59202623",
"0.59112674",
"0.59088206",
"0.590716",
"0.59056735",
"0.589997",
"0.5899655",
"0.5898926",
"0.5896042",
"0.589589",
"0.5895867",
"0.58894163",
"0.5884936",
"0.5879227",
"0.58740723",
"0.5871364",
"0.5870148",
"0.5869228",
"0.5868196",
"0.5867967",
"0.5865532",
"0.58653617",
"0.58644646",
"0.58631665",
"0.5862611",
"0.5857609",
"0.58558804",
"0.5853729",
"0.5853025"
] |
0.0
|
-1
|
returns true if this element is hydrogen
|
def h?
return element == "H"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def heptagonal?\n fcache[:heptagonal] ||= (Math.sqrt(40*self +9)+3)%10 == 0\n end",
"def homme?\n !identified? || sexe == 'H'\n end",
"def superShiny?\n return self.superHue.is_a?(Numeric) ? true : false\n end",
"def superShiny?\n return self.superHue.is_a?(Numeric) ? true : false\n end",
"def hydrogens_added?\n @ob.has_hydrogens_added\n end",
"def qcks_can_dash?\n Quicksands[terrain_tag][:dash]\n end",
"def is_hr(row) # :nodoc:\n return ((row.kind_of?(String)) && (row == '__hr__'))\n end",
"def has_halt?\n @tokens.any? { |t| t.is_halt? }\n end",
"def hier?\n !NON_HIER_SCHEMES.include?(scheme)\n end",
"def symbols?\n sort == ::SYMBOLS\n end",
"def hydrogen_count\n @ob.implicit_hydrogen_count + @ob.explicit_hydrogen_count\n end",
"def instruction?\n not elements.select { |e| e.respond_to?(:to_bin) }.empty?\n end",
"def is_terminal(element)\n !(@cfg.sigma.index(element) == nil)\n end",
"def healer\n return (@attributes & 0x02 == 0x02)\n end",
"def in_wt?\n !!@y.match(/[ MD]/)\n end",
"def hound?\n hound != false\n end",
"def byebye?\n sub_type == 'ssdp:byebye'\n end",
"def elementdecl?\n @contents[0] == :elementdecl\n end",
"def is_helo?\n @type == PacketData::HELO and @payload == \"\"\n end",
"def has_id_element?\n each_node do |n|\n next unless n.kind_of?(Element)\n next unless n.hid\n return true\n end\n false\n end",
"def element_header?\n\t\t\n\tend",
"def elv_tygnon\n atk < dfe\n end",
"def is_diamond?\n return false\n end",
"def hours?\n @name == :hourly\n end",
"def has_hour?\n self.starts_at.strftime('%H%M') != \"0000\"\n end",
"def vpiH?\n get_value(VpiScalarVal) == VpiH\n end",
"def element_decl?\n node_type == ELEMENT_DECL\n end",
"def daytime_hours?\n @test_time = @time if @test_time.nil?\n @test_time.daytime_hours?\n end",
"def element_is_text?\n !self[:is_tag]\n end",
"def dashed?\n current_dash_state != undashed_setting\n end",
"def ascii?\n ! self.unicode?\n end",
"def generated_by_zephir?\n !!name.match(/.\\.zep\\.(?:c|h|php)$/)\n end",
"def hydrogen\n render_serializer ReconciliationCSVSerializer.new(\n @scenario.gql.future_graph, :hydrogen\n )\n end",
"def has_hours?\n return ( total() > 0.0 )\n end",
"def element?\n node_type == ELEMENT_NODE\n end",
"def valid?\n self =~ /[a-h][1-8]/\n end",
"def element?\n type == ELEMENT_NODE\n end",
"def hertz? = unit == 'hertz'",
"def include?(sym)\n `c$Element.prototype.m$has_class_bool.call(#{@element},sym)`\n end",
"def dot? = unit == 'dot'",
"def node_heading?(node)\n %w(h1 h2 h3 h4 h5 h6).include?(node.name)\n end",
"def consonant?\n self != 'ㅇ' && kor.chosung?(self)\n end",
"def special?\n return data.atk_class == 2\n end",
"def first_includes_eps?\n @first && @first.include?(:_eps)\n end",
"def hex_surrounding_hex?(hex)\n distance(hex)==1\n end",
"def hex_surrounding_hex?(hex)\n distance(hex)==1\n end",
"def unitless?\n numerators.empty? && denominators.empty?\n end",
"def instruction?\n @contents[0] == :processing_instruction\n end",
"def energized?\n @cur_energy > 0\n end",
"def helligdag?\n not helligdag.nil?\n end",
"def suppressed? heading\n return false unless @omit_headings_below\n\n heading.level > @omit_headings_below\n end",
"def is_huaweios?\n return !!@name.match(/^huaweios-.*$/)\n end",
"def end_element?\n @contents[0] == :end_element\n end",
"def dash?\n return false if in_quicksand? && !qcks_can_dash?\n mrts_qcksnd_dash?\n end",
"def magnitude?\n self.units.reject{|d,(u,m)| m==0}.empty?\n end",
"def any_hebrew?\n case self.encoding\n when Encoding::UTF_8\n self.each_codepoint {|cp| return true if is_hebrew_codepoint_utf8(cp) }\n return false\n when Encoding::WINDOWS_1255 || Encoding::CP1255\n self.each_codepoint {|cp| return true if is_hebrew_codepoint_cp1255(cp) }\n return false\n else\n return false\n end\n end",
"def schematic?\n self.eco_types.detect { |et| et.name == \"Schematic\" } != nil\n end",
"def unangenehm?(in_temp)\n\tcheck_pre((in_temp.int?))\n\tnot angenehm?(in_temp)\nend",
"def pinky?(letter)\n index = @layout.index(letter)\n [6, 7, 8, 15, 16, 17, 20, 23, 26].include?(index)\n end",
"def pond? # Etang / Rivière etc...\n return $game_player.system_tag == TPond\n end",
"def closing_element?\n\t\t\n\tend",
"def h?\n @side == :right || @side == :left\n end",
"def megahertz? = unit == 'megahertz'",
"def halfdim\n return nil unless @property_hash.has_key? 'halfdim'\n return nil unless @property_hash['halfdim'] == '0' || @property_hash['halfdim'] == '1'\n\n @property_hash['halfdim'] == '1' ? :true : :false\n end",
"def hierarchical?()\n return self.id =~ /\\Ahl_/i\n end",
"def forced?\n arc.source_arrow.eql?('dash')\n end",
"def ordinary?\n\t\t\t@weight == 1\n\t\tend",
"def element_is_closing_tag?\n self[:is_tag] && self[:closing_tag]\n end",
"def content_for?(symbol)\n !content_blocks[symbol].empty?\n end",
"def has_bomb?\n\t\t\t@content == :BOMB\n\t\tend",
"def start_element?\n @contents[0] == :start_element\n end",
"def hexagonal?\n fcache[:hexagonal] ||= (Math.sqrt(8*self +1)+1)%4 == 0\n end",
"def upper_hessenberg?\n return false unless square?\n iter = iterator\n while iter.has_next?\n r, c, v = iter.next\n return false if r > (c + 1) && v != 0\n end\n true\n end",
"def earth_mass? = unit == 'earth-mass'",
"def heading?\n self.is_heading?\n end",
"def day_sym_elem?(day)\n return DAY_SYM_SEQ.include?(day)\nend",
"def terminal?\n @elements.nil?\n end",
"def halted?\n !!@halt\n end",
"def kexy_corebel?(sheikdom_sanguinarily)\n unsyringed?(swotter_uncoherentness, tetartoid)\n end",
"def is_ham(message)\n tell(message, 'ham')\n end",
"def node_header?(node)\n %w[h1 h2 h3 h4 h5 h6].include?(node.name.downcase)\n end",
"def eoi?\n @eoi\n end",
"def eoi?\n @eoi\n end",
"def normal?\n\t !self.significant?\n\t end",
"def colour?\n self.size == 1 && ('A'..'Z').include?(self)\n end",
"def element_is_tag?\n self[:is_tag]\n end",
"def shine?\n label.name == \"shine\" if label\n end",
"def hemogenous?\n return true if empty?\n\n klass = nodes_by_id[selected_node_ids.first].class\n selected_nodes.all? { |n| n.class == klass }\n end",
"def export_heading_number?\n \"t\" == @options[\"num\"]\n end",
"def bigger_text?\n @style.anybits?(0x04)\n end",
"def is?(behavior_sym)\n !@behaviors[behavior_sym].nil?\n end",
"def is_hh_show_time?\n # Monday through Friday\n if (1..5).to_a.include?(DateTime.now().wday)\n # 05:00-08:59 (Central Time)\n if (5..8).to_a.include?(DateTime.now().hour)\n return true\n end\n end\n false\n end",
"def one_h1?\n xpath(\"//h1\").count.between?(0, 1)\n end",
"def hasHerald?\n !herald.nil?\n end",
"def expands?\r\n\t\treturn PeriodicTable.atomic_number(element) > 13\r\n\tend",
"def equilateral?\n type == :equilateral\n end",
"def experimental?\n (@name.first == \"X\")\n end",
"def has_elements?\n self.each_element{ |e| return true }\n return false\n end",
"def halve?(value) (value.symbol? and value.in?([:PM, :AM])) end",
"def is_hardfence?(); @type == GRT_HARDFENCE; end"
] |
[
"0.6151223",
"0.6149595",
"0.5937283",
"0.5937283",
"0.58571696",
"0.5825834",
"0.5710036",
"0.55765086",
"0.556458",
"0.55576277",
"0.5531311",
"0.55295855",
"0.54882056",
"0.5483861",
"0.5454947",
"0.5440434",
"0.5414432",
"0.54050237",
"0.53893125",
"0.5378633",
"0.5378187",
"0.53645957",
"0.5356378",
"0.53480613",
"0.533774",
"0.5337052",
"0.5324031",
"0.5299557",
"0.5278037",
"0.52632165",
"0.5262981",
"0.5255032",
"0.5251172",
"0.525104",
"0.5238521",
"0.52341497",
"0.5215217",
"0.5201206",
"0.51929575",
"0.51657623",
"0.51649415",
"0.51580054",
"0.51452327",
"0.5144961",
"0.51444256",
"0.51444256",
"0.5138659",
"0.51344633",
"0.5130414",
"0.5126226",
"0.51212287",
"0.51176816",
"0.5116899",
"0.51100475",
"0.51094705",
"0.51031476",
"0.50903505",
"0.5070436",
"0.507027",
"0.50687647",
"0.5064253",
"0.5064057",
"0.505606",
"0.50526726",
"0.50513536",
"0.50457036",
"0.5045506",
"0.50409836",
"0.5037647",
"0.5035701",
"0.50300205",
"0.50292015",
"0.50233316",
"0.5016986",
"0.50139505",
"0.5007783",
"0.49946538",
"0.4986712",
"0.49861068",
"0.49784955",
"0.49759722",
"0.49686",
"0.49686",
"0.4968426",
"0.4961613",
"0.49601677",
"0.4955575",
"0.49355105",
"0.49300537",
"0.49261594",
"0.49237797",
"0.49223748",
"0.49213657",
"0.49149847",
"0.491186",
"0.4911616",
"0.49108285",
"0.4910224",
"0.4909122",
"0.49036953"
] |
0.7430685
|
0
|
returns true if it is the root node
|
def root?
return parent == nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def _is_root_node?\n @nodes.size == 1\n end",
"def root?\n @type == ROOT\n end",
"def root?\n root\n end",
"def root?\n root == self\n end",
"def root?\n parent.on_node { |p| p }.nil?\n end",
"def root?\n !has_parent?\n end",
"def root?\n true\n end",
"def has_root?\n @root != nil\n end",
"def root?\n self.parent ? false : true\n end",
"def is_root?\n return call_ancestry_method(:is_root?) if use_ancestry?\n\n rel = relationship # TODO: Handle a node that is a root and a node at the same time\n rel.nil? ? true : rel.is_root?\n end",
"def root?\n ROOT == self\n end",
"def root?\n depth == 1\n end",
"def is_root?()\n return (name.nil? and parent.nil?) \n end",
"def root?\n false\n end",
"def root?\n true\n end",
"def root?\n true\n end",
"def root?\n !parent\n end",
"def root?\n parent.nil?\n end",
"def is_root?\n \troot == id\n end",
"def root?\n false\n end",
"def root?\n parent.nil?\n end",
"def root?\n parent.nil?\n end",
"def root?\n parent.nil?\n end",
"def root?\n parent.nil?\n end",
"def root?\n @parent.nil?\n end",
"def is_root?\n @parent.nil?\n end",
"def is_root?\n self.parent_id.nil?\n end",
"def root?\n id == Id::ROOT\n end",
"def root?\n root_id.nil?\n end",
"def root?\n parent_id.nil?\n end",
"def root?\n _parent_id.nil?\n end",
"def root?\n parent_id.nil?\n end",
"def root?\n parent_id.nil?\n end",
"def root?\n @parent.nil?\n end",
"def empty?\n @root.empty? && @root.leaf?\n end",
"def root?(node)\n in_degree(node) == 0 && out_degree(node) > 0\n end",
"def root?\n parent_id.nil?\n end",
"def root?\n self.depth.zero?\n end",
"def root?\n self.depth.zero?\n end",
"def empty?\n root.nil?\n end",
"def root?\n self[tree_parent_id_field].nil?\n end",
"def root?\n prev.nil? && self.next.nil?\n end",
"def is_root?\n parent_id.nil?\n end",
"def is_root?\n parent_id.nil?\n end",
"def is_empty\n @root == nil\n end",
"def root?\n self.class.roots.exists?(self.id)\n end",
"def empty?\n @root.nil?\n end",
"def empty?\n @root.nil?\n end",
"def root?\n self.parent.nil?\n end",
"def root?\n !self.hier? || self.path == '/' || self.path.to_s.empty?\n end",
"def is_root?\n false\n end",
"def root?\n parent_id = self[nested_set_parent]\n (parent_id == 0 || parent_id.nil?) && (self[nested_set_left] == 1) && (self[nested_set_right] > self[nested_set_left])\n end",
"def root_object?\n root_object == self\n end",
"def include_root?\n min_depth == 0\n end",
"def root?\n self.path == '/'\n end",
"def root? # :nodoc:\n not (id =~ ROOT_ID_REGEXP).nil?\n end",
"def root?\n parent.terminal?\n end",
"def empty?()\n return @root.children.empty? ? true : false\n end",
"def has_parent?\n !root?\n end",
"def child?\n !root?\n end",
"def child?\n !root?\n end",
"def root?\n self[parent_column].nil?\n end",
"def is_root?()\n @rootpath == @path\n end",
"def root?\n is_root?(@path)\n end",
"def root?\n context.root_component == self\n end",
"def root?\n #%r{\\A/+\\z} =~ @path ? true : false\n @absolute and @path.empty?\n end",
"def test_is_root_eh\n setup_test_tree\n assert(@root.is_root?, \"The ROOT node must respond as the root node\")\n end",
"def child?\n !root?\n end",
"def root?\n (@nv === 0) and (@dv === 1) and (@snv === 1) and (@sdv === 0)\n end",
"def child?\n !root?\n end",
"def leaf?\n children.empty?\n end",
"def root?\n return @active_context.empty?\n end",
"def root?\n full_name.empty?\n end",
"def node?\n node.present?\n end",
"def leaf?\n @children.empty?\n end",
"def parent?\n !root?\n end",
"def is_leaf?\n self.children_count.zero?\n end",
"def is_leaf\n return @left == nil\n end",
"def starts_with_root_ui_entry?\n @data[16,4] == \"root\" or @data[32,4] == \"root\"\n end",
"def is_root?\n @path == '/' || @path == ''\n end",
"def leaf?(r)\n r.children.empty?\n end",
"def root?\n parent_id = self[acts_as_nested_set_options[:parent_column]]\n (parent_id == 0 || parent_id.nil?) && (self[acts_as_nested_set_options[:left_column]] == 1) && (self[acts_as_nested_set_options[:right_column]] > self[acts_as_nested_set_options[:left_column]])\n end",
"def nested?\n @nodes.any?\n end",
"def root?\n subject == :_ && predicate == :_ && object == :_\n end",
"def leaf?\n !node?\n end",
"def nodes?\r\n\t\treturn !h? || (h? && root?)\r\n\tend",
"def root?\n \tfolder_id.nil?\n end",
"def leaf?\n self.children.size == 0\n end",
"def fetch_root(key)\n return true if key == root.hash\n\n root = fetch_node_nt(key)\n return false unless root\n\n @root = root\n return true\n end",
"def node?\n any?(&:node?)\n end",
"def start_node?\n @traversal_position.isStartNode\n end",
"def has_child_nodes()\n if @child_nodes.first_child.nil? then\n return false\n else\n return true\n end\n end",
"def is_root?( inventory )\n\t\tinventory.template_root?( @id )\n\tend",
"def leaf?\n @children.length.zero?\n end",
"def leaf?\n leaves.count == 0\n end",
"def lowest_level?\n !children.any? {|child| child.kind_of?(NonLeafNode)}\n end",
"def root?\n (selected.length == 1) && (selected.first == @context)\n end",
"def is_root?() @name === '__root__'; end",
"def isLeftChild?\r\n return nil if isRoot?\r\n self == parent.leftChild\r\n end",
"def root?\n !!@root || app_file?\n end"
] |
[
"0.8833755",
"0.85975087",
"0.8588558",
"0.85880333",
"0.85146934",
"0.8410705",
"0.8359802",
"0.8358722",
"0.8337335",
"0.8323176",
"0.8318085",
"0.8305588",
"0.8262602",
"0.8237677",
"0.82167304",
"0.82167304",
"0.8202742",
"0.81744325",
"0.8173839",
"0.8136797",
"0.81062466",
"0.81062466",
"0.81062466",
"0.81062466",
"0.8097219",
"0.80627584",
"0.8038515",
"0.7968905",
"0.79423577",
"0.7913675",
"0.7912483",
"0.79080266",
"0.79080266",
"0.7900488",
"0.78492165",
"0.78200144",
"0.7819053",
"0.77978104",
"0.77978104",
"0.7797017",
"0.77852714",
"0.7777857",
"0.7729624",
"0.7729624",
"0.7728315",
"0.7725795",
"0.771005",
"0.7708313",
"0.76776236",
"0.76696366",
"0.76344734",
"0.761386",
"0.7522272",
"0.749621",
"0.7484617",
"0.7480021",
"0.74780995",
"0.74387306",
"0.74329627",
"0.7424311",
"0.7424311",
"0.73974293",
"0.73900515",
"0.7379623",
"0.73720086",
"0.7362904",
"0.73379266",
"0.7289657",
"0.72732466",
"0.72604597",
"0.7258366",
"0.72481185",
"0.7247253",
"0.7244594",
"0.722274",
"0.7215318",
"0.71876603",
"0.7166508",
"0.7141039",
"0.71362364",
"0.7132696",
"0.71302676",
"0.7125329",
"0.7108951",
"0.7090309",
"0.7089918",
"0.70832956",
"0.7072921",
"0.7004451",
"0.70017177",
"0.69966865",
"0.69952965",
"0.6978327",
"0.69627994",
"0.6930063",
"0.69085294",
"0.6900778",
"0.68992865",
"0.68867",
"0.6878172"
] |
0.8286686
|
12
|
returns true if element has nodes
|
def nodes?
return !h? || (h? && root?)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def empty?\n nodes.empty?\n end",
"def element?\n node_type == ELEMENT_NODE\n end",
"def node?\n node.present?\n end",
"def has_elements?\n self.each_element{ |e| return true }\n return false\n end",
"def empty?\n node.all('*').length.zero?\n end",
"def has_child_nodes()\n if @child_nodes.first_child.nil? then\n return false\n else\n return true\n end\n end",
"def node?\n any?(&:node?)\n end",
"def element?\n type == ELEMENT_NODE\n end",
"def nested?\n @nodes.any?\n end",
"def empty?\n return @node == nil\n end",
"def empty?\n @node == nil\n end",
"def has_elements?; end",
"def has_children?\n @nodes && !@nodes.empty?\n end",
"def empty?()\n return @root.children.empty? ? true : false\n end",
"def contains_node?(path)\n begin\n node(path)\n return true\n rescue ElementDoesntExist => e\n return false\n end\n end",
"def has_children?\n @nokogiri.children.any? {|child| child.kind_of? Nokogiri::XML::Element }\n end",
"def full?\r\n\t\tif nodes?\r\n\t\t\tnodes.each { |node|\r\n\t\t\t\tif node == nil\r\n\t\t\t\t\treturn false\r\n\t\t\t\tend\r\n\t\t\t}\r\n\t\tend\r\n\t\t\r\n\t\treturn true\r\n\tend",
"def is_a_node?\n element_type == 'node'\n end",
"def empty?\n @elements.empty?\n end",
"def start_of_element? node\n node.node_type==Nokogiri::XML::Reader::TYPE_ELEMENT\n end",
"def has_elements?(xpath_str)\n if NOKOGIRI\n element = @xml.xpath(xpath_str.to_s.upcase)\n return element != nil && element.children.size > 0\n else\n element = @xml.elements[xpath_str.to_s]\n return element != nil && element.has_elements?\n end\n end",
"def has_node?(node)\n has_node_with_name?(node.name)\n end",
"def scanned_node?(node); end",
"def exist? ; ! @element.nil? ; end",
"def text_node?(element)\n !element.text? && element.all? {|c| c.text?}\n end",
"def has_id_element?\n each_node do |n|\n next unless n.kind_of?(Element)\n next unless n.hid\n return true\n end\n false\n end",
"def list_empty?\n return (@first_node == nil) ? true : false\n end",
"def __empty?\n return false unless super\n __elements.values.all?(&:__empty?)\n end",
"def is_empty\n @root == nil\n end",
"def has_failed_nodes?\n failed_nodes.any?\n end",
"def has_failed_nodes?\n failed_nodes.any?\n end",
"def _is_root_node?\n @nodes.size == 1\n end",
"def node_exists?(name)\n exists?(\"node\", name)\n end",
"def has_node_with_name?(name)\n !find_node_by_name(name).nil?\n end",
"def text_element?(node)\n node.element? && node.attributes.empty? && node.children.size == 1 && node.children.first.text?\n end",
"def contains(node)\n return !(@nodes[node] == nil)\n end",
"def has_elements? desired_elements \n return which_elements_missing?(desired_elements).empty?\n end",
"def plain_document?\n document.elements.empty?\n end",
"def node?\n @subject.node?\n end",
"def empty?\n return @tree_iterator.empty?\n end",
"def hemogenous?\n return true if empty?\n\n klass = nodes_by_id[selected_node_ids.first].class\n selected_nodes.all? { |n| n.class == klass }\n end",
"def empty?\n selected_node_ids.empty?\n end",
"def valid?\n @elements.size > 0\n end",
"def empty?\n @element_repository.all.empty?\n end",
"def empty?\n !node_next(@head, 0)\n end",
"def empty?\n @root.empty? && @root.leaf?\n end",
"def xml_element?(xml)\n xml.kind_of? Nokogiri::XML::Element\n end",
"def useless?\n content.nil? and children.empty?\n end",
"def empty?\n return true if @elements.empty?\n return true if @elements == Set.new([Feature.empty])\n return false unless @elements.size == 1\n return @elements.first.empty?\n end",
"def text_content?\n @node.children.all?(&:text?)\n end",
"def has_elements?\n return !( self.factures.size.eql?(0) && \n self.ventes.size.eql?(0) && \n self.produits.size.eql?(0) &&\n self.labours.size.eql?(0) &&\n self.pulves.size.eql?(0))\n end",
"def element_start?\n @reader.node_type == XML::Reader::TYPE_ELEMENT\n end",
"def is_here?(element)\n element.exists?\n rescue\n false\n end",
"def xml?\n type == DOCUMENT_NODE\n end",
"def has_children?\n @children.length > 0\n end",
"def hasChildren?\n children = getChildren\n return false if children.empty? or children.nil?\n return true\n end",
"def empty?\n @children.empty?\n end",
"def has_node?(node)\n @node_map[node]\n end",
"def start_element?\n @contents[0] == :start_element\n end",
"def has_children?\n self.children.size > 0\n end",
"def has_children?\n self.children.size > 0\n end",
"def has_children?\n self.children.size > 0\n end",
"def has_children?\n self.children.size > 0\n end",
"def has_children?\n self.children.size > 0 \n end",
"def has_children?\n self.children.size > 0 \n end",
"def has_children?\n self.children.size > 0 \n end",
"def has_children?\n self.children.size > 0 \n end",
"def all_nodes_ready?\n if current_platform_spec.nodes.nil?\n false\n else\n true\n end\n end",
"def dom_loaded?\n !@dom_loaded.empty?\n end",
"def empty?\n root.nil?\n end",
"def has_children?\n !children.empty?\n end",
"def all_inline?\n (xml.children.map(&:node_name) - inline_tags).empty?\n end",
"def contains?(element)\n self.each do |node| \n return true if node.value == element\n end\n return false\n end",
"def empty?\n `#@native.children.length === 0`\n end",
"def inside_ignorable_element(n)\n while not n.kind_of? Nokogiri::HTML::Document and n.kind_of? Nokogiri::XML::Node and n.parent() != nil\n if ignorable_element(n)\n return true\n else\n n = n.parent\n end\n end\n false\n end",
"def emptied?(xpath)\n node = @document.at_xpath(xpath)\n node.children.all? { |ch|\n @component_xpaths.include?(ch.path) ||\n (ch.text? && ch.content.strip.empty?)\n }\n end",
"def has_child?\n !@children.empty?\n end",
"def is_empty?(node)\n node.name != 'img' && node.name != 'br' &&\n (node.text? && node.text.strip.empty? || !node.text? && node.children.empty?)\n end",
"def has_next\n return !(self.next_node.nil?)\n end",
"def has_children?\n children.size > 0\n end",
"def has_children?\n children.size > 0\n end",
"def has_next?()\n if @next_node\n return true\n else\n return false\n end\n end",
"def is_node?(obj)\n obj.respond_to?(:children) && obj.location.expression\n end",
"def has_content(*elements)\n data_exists = false\n\n i = 0\n until data_exists || i >= elements.size do\n xpath = \"//#{elements[i]}\"\n i += 1\n xml_doc.xpath(xpath).each do |node|\n data_exists = true if node.content =~ /\\w/ &&\n node.content.gsub(/(\\r|\\n)/, ' ') !~ /^-\\d{1,2}$/\n end\n end\n\n data_exists\n end",
"def completely_probed?\n !(@probe_nodes.find{|node| node.nil?})\n end",
"def can_contain?(element)\n false\n end",
"def text_content?\n @node.children.all? {|c| c.text?}\n end",
"def has_children?\n !self.children.empty?\n end",
"def has_children?\n children.size > 0\n end",
"def has_children?\n children.size > 0\n end",
"def supported?(node)\n !find_parser(node.inner_text).nil?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end",
"def has_children?\n self.children.any?\n end"
] |
[
"0.7739309",
"0.7715326",
"0.77041614",
"0.77016664",
"0.7646879",
"0.7642867",
"0.75942385",
"0.75785494",
"0.75670695",
"0.75414246",
"0.746269",
"0.74490905",
"0.74302304",
"0.7334931",
"0.73187244",
"0.73130906",
"0.7282652",
"0.7248604",
"0.71509576",
"0.71038675",
"0.69997317",
"0.69751513",
"0.69578743",
"0.694682",
"0.6915083",
"0.6883679",
"0.6868329",
"0.6850216",
"0.6814894",
"0.6798002",
"0.6798002",
"0.6762112",
"0.67513597",
"0.6735109",
"0.6727113",
"0.67077523",
"0.6672418",
"0.66718775",
"0.66644347",
"0.6649478",
"0.664743",
"0.662411",
"0.66182554",
"0.66152805",
"0.6612271",
"0.66115767",
"0.6611271",
"0.660624",
"0.6599387",
"0.6596476",
"0.65861505",
"0.6580346",
"0.6578711",
"0.6568686",
"0.65594834",
"0.6552739",
"0.65519476",
"0.6544405",
"0.6541859",
"0.6516506",
"0.6516506",
"0.6516506",
"0.6516506",
"0.6509483",
"0.6509483",
"0.6509483",
"0.6509483",
"0.64910436",
"0.6487169",
"0.64848685",
"0.6483183",
"0.6481733",
"0.6473769",
"0.64650893",
"0.64646816",
"0.6457585",
"0.64435714",
"0.64258415",
"0.6425075",
"0.64194584",
"0.64194584",
"0.64162326",
"0.64081466",
"0.6382564",
"0.6376018",
"0.6362355",
"0.6361008",
"0.6356516",
"0.6352702",
"0.6352702",
"0.63490033",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001",
"0.6346001"
] |
0.7309013
|
16
|
calculates formal charge (method used to determine structure generation)
|
def formal_charge
if root?
lewis_electrons = 0
else #if an element is not the root, it is bonded to another element, thus increase the formal charge count by 1
lewis_electrons = 1
end
# if the element has nodes, look at each one
if nodes?
nodes.each { |node|
if node == nil # if the node is unbonded, add 2
lewis_electrons += 2
else # if it is bonded, add 1
lewis_electrons += 1
end
}
end
# return the valence count - the lewis count (definition of formal charge)
return PeriodicTable.valence(element) - lewis_electrons
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def charge\n subtotal * 0\n end",
"def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end",
"def calMass(mass, charge)\n (mass + (charge.to_f * 1.00727646677)) / charge\n end",
"def fixed_charges\n 20.0\n end",
"def calculate_charge\n # XXX Need to select correct locations record once we support > 1 location\n # XXX Need to select the correct seat_rate for the location\n (total_time / 60.0) * Location.first.seat_rates.first.dollars_per_minute\n end",
"def charge\n ((sprintf(\"%.1f\", (\n $ioreg_return.split(' = ')[15].strip.split(\"\\n\")[0].to_f / $ioreg_return.split(' = ')[9].strip.split(\"\\n\")[0].to_f )\n )).to_f*100).to_i\n end",
"def new_charge\n end",
"def recalc_materials_charges\n\t\tbase_plus_flat = @base_price + @flat_charge\n\t\t@materials_charged_hash.keys.each do |key|\n\t\t\t@materials_charged_hash[key] = MarkupManager.instance.calculate_material_cost(base_plus_flat, key)\n\t\tend\n\tend",
"def charge_customer()\n array = find_films()\n # charge = ticket_cost\n for film in array\n result = @funds - film.price\n @funds = result\n end\n update\n end",
"def charge_proc positive, pK, num\n if positive\n lambda {|ph|\n num.to_f / (1.0 + 10.0 ** (ph - pK))\n }\n else\n lambda {|ph|\n (-1.0 * num.to_f) / (1.0 + 10.0 ** (pK - ph))\n }\n end\n end",
"def generateConcreteCharges\r\n\t #For each charge factories asscociated with retail plans, generate concrete charge and total them\r\n\t self.retail_plan.charge_factories.each do |charge_factory| \r\n\t generated_concrete_charges = charge_factory.specific.concreteCharge(self)\r\n\t #Put each generated_concrete_charge to GeneratedInvoice\r\n\t generated_concrete_charges.each do |generated_concrete_charge|\t \t\r\n\t\t self.concrete_charges << generated_concrete_charge\r\n\t\t self.total += generated_concrete_charge.amount\r\n\t end\r\n\t end\r\n\tend",
"def next_charge\n ( pre_finalised_quote * relative_progress / 100 ) - charged_so_far\n end",
"def experiMass(mass, charge, diff)\n ((mass + diff) + (charge.to_f * 1.00727646677)) / charge\n end",
"def experiMass(mass, charge, diff)\n ((mass + diff) + (charge.to_f * 1.00727646677)) / charge\n end",
"def fuel_needed(mass)\n return (mass / 3) - 2\nend",
"def required_fuel_rec(mass)\n return 0 if mass <= 0\n\n fuel = (mass / 3).floor - 2\n fuel + required_fuel_rec(fuel)\nend",
"def fuel_cost\n ((amount * 100) / (mileage - predecessor.mileage)).round(1) if predecessor\n end",
"def get_charge\n @charge\n end",
"def calculate_with_fuel\n s = 0\n res = calculate\n until res.zero?\n s += res\n @mass = res\n res = calculate\n end\n s\n end",
"def cost\n deductible * RATE\n end",
"def charge_fee\r\n\t\tif_member = Participant.find_by(participantID: participantID)\r\n\t\tif_course = Course.find_by(courseID: courseID)\r\n\t\t\r\n\t\tif if_course != nil && if_member != nil\r\n\t\t\tearlyBirdTime = if_course.startDate.months_ago(1)\r\n\t\t\tif if_member.expirydate > Date.today\r\n\t\t\t\tif Date.today >= earlyBirdTime && Date.today < if_course.startDate\r\n\t\t\t\t\treturn if_course.earlybirdPrice\r\n\t\t\t\telse\r\n\t\t\t\t\treturn if_course.memberPrice\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\treturn if_course.nonmemberPrice\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"def cost\n 0.89\n end",
"def parent_ion_mass(charge=1)\r\n (mass(nterm) + ladder.last + mass(cterm) + charge * proton_mass)/charge\r\n end",
"def cf_mortgage_basic\n sum_cash_flows(self.cf_down_payment, self.cf_repayment, self.cf_settlement, self.cf_selling_price)\n end",
"def calculate_shipping_charge\n return unless shipping_method = adjustment_source.shipping_method\n shipping_method.calculate_cost(adjustment_source)\n end",
"def calculate_shipping_charge\n return unless shipping_method = adjustment_source.shipping_method\n shipping_method.calculate_cost(adjustment_source)\n end",
"def simplificar (fraccion)\n mcd = gcd(fraccion.numerador, fraccion.denominador)\n Fraccion.new( fraccion.numerador/mcd , fraccion.denominador/mcd)\n \n \n end",
"def charge_at_pH(pep_charges, pH)\n\tcharge = 0\n\tcharge += -1/(1+10**(pep_charges.c_term-pH))\n\tcharge += -pep_charges.d_num/(1+10**(ResidueTable[:D][2]-pH))\n\tcharge += -pep_charges.e_num/(1+10**(ResidueTable[:E][2]-pH))\n\tcharge += -pep_charges.c_num/(1+10**(ResidueTable[:C][2]-pH))\n\tcharge += -pep_charges.y_num/(1+10**(ResidueTable[:Y][2]-pH))\n\tcharge += 1/(1+10**(pH - pep_charges.n_term))\n\tcharge += pep_charges.h_num/(1+10**(pH-ResidueTable[:H][2]))\n\tcharge += pep_charges.k_num/(1+10**(pH-ResidueTable[:K][2]))\n\tcharge += pep_charges.r_num/(1+10**(pH-ResidueTable[:R][2]))\n\tcharge\nend",
"def calculate_commissions\n # We take 30% of the final price\n commission = (self.price * 0.3).round\n\n # We split this commission into fees\n # Half goes to the insurance\n self.insurance_fee = (commission * 0.5).round\n # 1€/day goes to the roadside assistance.\n self.assistance_fee = self.duration * 100\n # The rest goes to us\n self.drivy_fee = commission - self.insurance_fee - self.assistance_fee\n end",
"def deduction(price, copoun_obj) \n if copoun_obj.deduction_type == \"percentage\"\n total_price = price * (copoun_obj.deduction_percentage / 100)\n else\n total_price = price - copoun_obj.deduction_amount\n end\n end",
"def cost\n 0.99\n end",
"def get_charges\n #fill in the remaining claim info\n # box 28\n text_box sprintf(\"%.2f\", @charges_for_service.to_s), :at => [370, 82]\n # box 29\n text_box sprintf(\"%.2f\", @copay_amount.to_s), :at => [450, 82]\n # box 30\n text_box sprintf(\"%.2f\", @balance_owed.to_s), :at => [520, 82]\n end",
"def formal_derivative\n GCMPoly.new (0...@a.size-1).map { |i| i.odd? ? GCMField.zero : @a[i+1] }\n end",
"def cost\n 1.99\n end",
"def cost\r\n 0\r\n end",
"def manufacturing_cost\n\tcost = 0.0\n\tself.item.materials.each do |mat|\n\t\tcost += ( (mat.quantity * waste_factor).round * mat.item.market_data.value )\n\tend\n\tself.manufacturing_requirements.each do |ram|\n\t\tnext if ram.item.skill?\n\t\tcost += ( ram.quantity * ram.damagePerJob * ram.item.market_data.value )\n\tend\n\tif self.tech_level == 2\n\t\tcost += self.invention_cost\n\tend\n\tcost /= self.item.portionSize\nend",
"def total_cost(distance, mpg, cpg)\n\tprice = (distance / mpg) * cpg \nend",
"def fuel_required(mass)\n fuel = mass.fdiv(3).floor - 2\n fuel.positive? ? fuel + fuel_required(fuel) : 0\nend",
"def total\n charges.map { |x| x.total_cost.to_f }.inject(:+)\n end",
"def calculateFuelCost( distance, distancePerGallon, pricePerGallon )\n # Cost = ( Distance * Price per gallon ) / Efficiency\n cost = ( distance * pricePerGallon ) / distancePerGallon\n\n return cost.round( 2 )\nend",
"def mass\n @ob.get_exact_mass - (@ob.get_total_charge * Rubabel::MASS_E)\n end",
"def univ_fee_amount_to_charge()\n raise \"not a university\" if ! university\n payments.select(&:good?).empty? ? payments.first.amount : university.subscription_charge_for_n(univ_dvd_rate)\n end",
"def calculate_fuel(mass)\n (mass.to_i / 3).floor - 2\nend",
"def calculate(t, fraud, type)\r\n#\t\tpp \"1\"\r\n\t\treturn 0.0 if type == 'billable' && self.bid_fee #if this fee is a bid fee and we are not looking at the bid fees then return 0, else continue on\r\n\t#\tpp \"2\"\r\n \t\r\n \tfee = self.fixed if self.price_type == 'F'\r\n \r\n fee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) if self.price_type == 'V' #calculate the fee\r\n \r\n return fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\r\n\t\t#if we get here we know we are dealing with a variable fee\r\n\t\t#puts (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min)\r\n\t#\tfee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) #calculate the fee\r\n\t#\tpp fee\r\n\t#\tpp \"3\"\r\n\t#\treturn fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\t\r\n\t\t#otherwise we need to determine the sign and threshold before we can return\r\n\t\tcase self.sign\r\n\t\t\twhen '>'\r\n\t\t\t #pp \">\"\r\n\t\t\t\treturn fee if t.amount > self.threshold\r\n\t\t\twhen '>='\r\n\t\t\t #pp \">=\"\r\n\t\t\t\treturn fee if t.amount >= self.threshold\r\n\t\t\twhen '<'\r\n\t\t\t #pp \"<\"\r\n\t\t\t\treturn fee if t.amount < self.threshold\r\n\t\t\twhen '<='\r\n\t\t\t #pp \"<=\"\r\n\t\t\t\treturn fee if t.amount <= self.threshold\r\n\t\t\telse\r\n\t\t\t #pp \"4\"\r\n\t\t\t\treturn 0.0\r\n\t\tend\r\n\t\t\r\n\t\t#if we get here then we have no idea what to do so just return 0\r\n\t\treturn 0.0\r\n\tend",
"def charge(attrs = {})\n post :charges, {}, attrs.to_xml(:root => :charge)\n end",
"def cost\n @cost = 0.89\n end",
"def cf\n\t\tself.buy ? (-self.amount-self.fee) : (self.amount - self.fee)\n\tend",
"def actual_cost\n self.cost/1000.to_f\n end",
"def direct_costs_for_one_time_fee\n # TODO: It's a little strange that per_unit_cost divides by\n # quantity, then here we multiply by quantity. It would arguably be\n # better to calculate total cost here in its own method, then\n # implement per_unit_cost to call that method.\n num = self.quantity || 0.0\n num * self.per_unit_cost\n end",
"def cost\n @cost ||= calibrate_cost\n end",
"def calculate_fare\n self.balance += journey_log.single_journey.fare\n end",
"def cost\n\t\treturn @extra_cost + @real_donation.cost\n\tend",
"def calculate_fcost(p)\n\t\t@hcosts[p] + @gcosts[p]\n\tend",
"def cost\r\n\t\treturn @extra_cost + @real_need.cost\r\n\tend",
"def cost \n return @extra_cost + @basic_prescription.cost\n end",
"def charged_so_far\n charges = stages.collect{ |pr| pr.charged_so_far }.sum\n invoices.collect{ |inv| inv.total }.sum + charges\n end",
"def calculate\n=begin\n self.net_amount = nil\n self.tax_amount = nil\n self.gross_amount = nil\n=end\n self.total\n end",
"def proton_mass\r\n mass(HYDROGEN) - mass(ELECTRON)\r\n end",
"def get_fuel_for_mass(mass)\n fuel_needed = (mass / 3) - 2\n fuel_needed = fuel_needed + get_fuel_for_mass(fuel_needed) if fuel_needed >= MINIMUM_MASS_FOR_FUEL\n fuel_needed\nend",
"def fuel_costs\n fetch(:fuel_costs) do\n if typical_input && typical_input < 0\n raise IllegalNegativeError.new(self, :typical_input, typical_input)\n end\n\n typical_input * weighted_carrier_cost_per_mj\n end\n end",
"def calc\n\n # get the amount (hrs or days)\n if self.rateType == 'Hour'\n\n std = self.hours.nil? ? 0 : TimeUtil.hours_to_numeric(self.hours)\n\n else\n\n std = dayValue.nil? ? 0 : dayValue\n \n end\n\n amt = 0\n \n amt = std * self.chargeRate unless self.chargeRate.nil? || self.chargeRate == 0\n self.netAmount = amt\n\n return amt\n \n end",
"def fuel_efficiency\n ((mileage - predecessor.mileage) / liter).round(1) if predecessor\n end",
"def cost\n sales_fee\n end",
"def fees\n total_input - total_output\n end",
"def cost\n start_value\n end",
"def describe_price\r\n\t\ta = []\r\n\t\ta << sprintf('$%.2f per item', per_item) unless per_item.zero?\r\n\t\ta << sprintf('$%.2f per kg', per_kg) unless per_kg.zero?\r\n\t\ta << sprintf('$%.2f', flat_rate) unless flat_rate.zero?\r\n\t\tif formula and !formula.empty?\r\n\t\t\tif formula_description and !formula_description.empty?\r\n\t\t\t\ta << formula_description\r\n\t\t\telse\r\n\t\t\t\ta << formula.gsub('I', \"'number of items'\").gsub('W', \"'total weight'\").gsub('V', \"'total value'\")\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\ta.empty? ? ((name == '[ to be advised ]') ? nil : 'no charge') : a.join(' + ')\r\n\tend",
"def detail_cost\n detail_material +\n detail_cutting * (cut.consumable_cost + cut_material.consumption) +\n (detail[:holes_count] + 1) * cut_material.pierce_price\n # Added: +1 to detail[:holes_count] for initial cut\n end",
"def domestic(size = 120, to_state)\n area = area_of_prefecture(to_state)\n rate = 0\n rate += domestic_rate(size, area) if size > 0\n rate + domestic_extra_charges\n end",
"def charge amount=0.0, method=\"pcc\", note=''\n\n invoice_item_category = InvoiceItemCategory.where(code:method).first\n\n #check the invoice category\n if invoice_item_category.nil? then\n raise \"Category not found\"\n return\n end\n\n #create a new invoice_item w/ the appropiate category\n Invoice.transaction do\n invoice_item = self.invoice_items.new({\n invoice_item_category_id:invoice_item_category.id,\n charges:amount,\n note:note\n })\n\n if invoice_item.save! then\n #update the total billing\n self.update_attribute(:total_billing, self.generate_total_billing)\n if self.total_billing.zero? then\n self.settled!\n end\n else\n raise \"failed to save transaction\"\n return\n end\n\n end\n end",
"def total_cost\n ingredients_cost + components_cost\n end",
"def full_recalc\r\n # # # # # # # # # \r\n print \"(FULL RECALC)\\n\"\r\n @hub_diam = bearing_outside_diam + (wall_thick * 0.8)\r\n \r\n @amount_lopside = wheel_diam * lopside_percent\r\n @floor_thick = @wall_thick * 1 \r\n @mount_bolt_thread_diam = @mount_bolts_diam * 0.85\r\n @mount_bolt_length = @stock_z_len + 0.05\r\n @cut_off_allowance = @mill.bit_diam\r\n print \"(hub_diam=\", @hub_diam, \")\\n\"\r\n recalc()\r\n end",
"def complex_fuel_for_mass(mass)\n return 0 unless mass && mass > NEGLIGIBLE_MASS_CUTOFF\n\n fm = simple_fuel_for_mass(mass)\n fm + complex_fuel_for_mass(fm)\n end",
"def charge!\n # get the credit card details submitted by the form\n # create the charge on Stripe's servers - this will charge the user's card\n currency = Selfstarter::Application::CURRENCY\n\n charge = Stripe::Charge.create({\n :amount => @campaign_level.price_to_cents, # amount in cents\n :currency => currency,\n :card => @card_id,\n :description => @campaign_level.title,\n :application_fee => @campaign_level.application_fee_cents # amount in cents\n },\n @campaign_level.campaign.user.stripe_token # user's access token from the Stripe Connect flow\n )\n\n charge['id']\n end",
"def cost\n @cost = 0.99\n end",
"def car\n\t\tsuma = 0\n\t\tx = 0\n\t\tcantidad = 0\n\n\t\t@alimentos.each do |i|\n\t\t\tcantidad = @gramos[x].valor / (i.proteinas + i.lipidos + i.carbohidratos)\n\t\t\tsuma += i.carbohidratos * cantidad\n\t\t\tx += 1\n\t\tend\t\n\n\t\treturn ((suma * 100) / gramos_total).round(2)\n\tend",
"def rule1\n (center_mass - self.position) * PCT_DAMPENER\n end",
"def charge(opts)\n\n amount = opts[:amount]\n currency = opts[:currency]\n\n end",
"def get_formula_base_cost\n price = 0.0\n self.ingredients.each do |ingredient|\n price += ingredient.getPrice * ingredient.quantity\n end\n return price\n end",
"def total_fuel_for(mass)\n next_mass = mass\n total_fuel = 0\n loop do\n fuel_needed = fuel_needed_for(next_mass)\n break unless fuel_needed > 0\n next_mass = fuel_needed\n total_fuel += fuel_needed\n end\n return total_fuel\nend",
"def total_bill(s)\n big_plates = s.scan(/r/).count\n free_plates = big_plates / 5\n charge = (big_plates - free_plates) * 2\nend",
"def estimated_charges\n @os_cloudwatch.estimated_charges\n end",
"def calculate_fee\n cost = (shooter.current_member? or join_psac) ? 15 : 20\n has_shooter = persisted? ? match.has_more_than_one_shooter?(shooter) : match.has_shooter?(shooter)\n if has_shooter\n cost = 3\n self.squad = 5\n end\n if join_psac\n cost += 30\n end\n self.fee = cost\n end",
"def gc\n s = codons.map { |c| c.nuc_codon[2] }.join\n ((s.count('G')+s.count('C')).to_f/codons.count).round(4)\n end",
"def total_cost\n \tingredients_cost + components_cost\n end",
"def calculate_amount_to_charge\n # First calculate how much this server is going to cost for the rest of the month\n @invoice = Invoice.generate_prepaid_invoice([self], user.account)\n\n # Then we need to know if the user has any spare credit notes that will reduced the amount of the\n # billing card charge we're about to make.\n credit_notes = user.account.credit_notes.with_remaining_cost\n # Deduct any unused value from the user's credit notes\n @notes_used = CreditNote.charge_account(credit_notes, @invoice.total_cost)\n # Make a note of this for posterity\n unless @notes_used.empty?\n user.account.create_activity(\n :charge_credit_account,\n owner: user,\n params: { notes: @notes_used }\n )\n end\n # Now, we finally have an amount to charge the billing card\n calculate_remaining_cost(@invoice.total_cost, @notes_used)\n end",
"def shipping_charge\n if empty? || subtotal >= 100\n return 0\n else\n return 10\n end\n end",
"def cost \n return @extra_cost + @basic_tran.cost\n end",
"def demand\n direction = @config.direction\n base_amount = @source.query.public_send(@config.attribute)\n\n if direction.nil?\n base_amount * @config.conversion_of(nil)\n else\n @config.conversion.sum do |carrier, conv_config|\n slot = conversion_slot(direction, carrier)\n factor = conversion_factor(slot)\n\n if factor.nil?\n raise 'Expected a numeric conversion but got nil when calculating a molecule ' \\\n \"connection with #{carrier} #{conv_config.inspect} using #{@source.key}\"\n end\n\n base_amount * slot.conversion * factor\n end\n end\n end",
"def charge!(cents, idempotency_key)\n # we are not charging anything - customer pays via bank transfer\n { paymentmethod: payment_info }\n end",
"def calculate_liability\n calculate_gross\n end",
"def cost\n @cost = 1.99\n end",
"def calculate_payment\n x = @periodic_rate * @principal * ((1 + @periodic_rate)**@periods)\n y = ((1 + @periodic_rate)**@periods) - 1\n (x / y).round(2)\n end",
"def ctof (degres)\n return ((degres * 1.8) + 32)\nend",
"def unit_cost\n @unit_cost ||= component ? component.cost : 0\n end",
"def generation_charges\n [ [{ :content => \"Current Supplier: THE FLYING BLINKY LIGHTS COMPANY\", :colspan => 4 }],\n [\"Generation Service Charge\", \"491 kWh X $.090041\", \"$\", \"44.21\"],\n [{ :content => \"Total Generation Services Charges\", :colspan => 2 }, \"$\", \"44.21\"]]\n end",
"def energy_pcf\n energy_from_protein +\n energy_from_carbs +\n energy_from_fat\n end",
"def cost \n return @extra_cost + @basic_transfer.cost\n end",
"def get_fuel(mass)\n mass = mass / 3 - 2\n @sum += mass\n get_fuel(mass) if mass >= 9\n end",
"def cost_of_cable(length)\n\t\tmeter = length * 0.01\n\t\tdollar = [meter * 0.4079 + 0.5771, meter * 0.0919 + 7.2745].min * BANDWIDTH\n\t\t(dollar * 100).round.to_f / 100\n\tend",
"def calculated; end"
] |
[
"0.69689447",
"0.67561746",
"0.67561746",
"0.6714563",
"0.6531566",
"0.63693446",
"0.63424987",
"0.62151253",
"0.61811197",
"0.61771446",
"0.6170233",
"0.6156192",
"0.6137016",
"0.6137016",
"0.611131",
"0.6045495",
"0.60120213",
"0.59990895",
"0.5981662",
"0.59777033",
"0.5971292",
"0.59409577",
"0.589573",
"0.5879944",
"0.58795923",
"0.58795923",
"0.5852876",
"0.58243835",
"0.58229226",
"0.582138",
"0.57726735",
"0.5771518",
"0.5770483",
"0.57678604",
"0.57463014",
"0.5740768",
"0.57289034",
"0.57264113",
"0.5715548",
"0.570233",
"0.5696945",
"0.56946945",
"0.5668959",
"0.5656118",
"0.56454456",
"0.56249505",
"0.5611979",
"0.5604438",
"0.5602736",
"0.5601404",
"0.55939066",
"0.55915225",
"0.5585002",
"0.5581681",
"0.557507",
"0.55629027",
"0.5560517",
"0.5555897",
"0.554359",
"0.5542698",
"0.55418193",
"0.5540346",
"0.55340904",
"0.5526543",
"0.5525083",
"0.5522754",
"0.55225956",
"0.5514089",
"0.54980695",
"0.5496825",
"0.54966223",
"0.5492208",
"0.54842275",
"0.54827565",
"0.54800147",
"0.5474133",
"0.5473438",
"0.54719347",
"0.54682535",
"0.546366",
"0.5463417",
"0.54633594",
"0.5462325",
"0.54606634",
"0.54601526",
"0.5459401",
"0.5451819",
"0.54468167",
"0.5446702",
"0.544612",
"0.54393685",
"0.54381555",
"0.54315174",
"0.5431023",
"0.54307795",
"0.54266745",
"0.5420264",
"0.5419838",
"0.54172134",
"0.5416943"
] |
0.7276857
|
0
|
return true if the element has a full octet, or more, or if it has 2 valence electrons if its a hydrogen
|
def full?
if nodes?
nodes.each { |node|
if node == nil
return false
end
}
end
return true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def instruction?\n not elements.select { |e| e.respond_to?(:to_bin) }.empty?\n end",
"def h?\r\n\t\treturn element == \"H\"\r\n\tend",
"def isFull\n\t@bo.each do |i| \n\t\tif i == '-' then \n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\n end",
"def value?\n Array.wrap(element_value).reject(&:empty?).any?\n end",
"def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end",
"def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end",
"def ace_value?(value)\n value.size == 2\n end",
"def end_element?\n @contents[0] == :end_element\n end",
"def paste_within?(element)\n i = 0\n element.each_byte do |b|\n if b == 32\n i += 1\n end\n end\n return true if i > 1\n end",
"def isValid\n # check that the amino acid is complete\n nonHydrogenAtoms = self.atoms.select{|atom| atom.atom != \"H\"}\n if (nonHydrogenAtoms.size == AMINO_ACID_SIZES[self.resname])\n @isvalid = true\n end\n puts \"ISVALID : #{self.isvalid} #{nonHydrogenAtoms.size} \"\n end",
"def full?\n self.cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n end",
"def elementdecl?\n @contents[0] == :elementdecl\n end",
"def emptyElement? element\n hasStandaloneAttribute = false\n @configuration.toplevel_standalone_attributes.each {|key, config|\n if config[:element_name] == element.name\n if element.attributes[config[:attribute_name].to_s] && !element.attributes[config[:attribute_name].to_s].empty?\n hasStandaloneAttribute = true\n end\n end\n }\n !element.has_elements? && element.texts.join.strip.empty? && !hasStandaloneAttribute\n end",
"def full?\n @cells.all? { |space| space == \"X\" || space == \"O\" }\n end",
"def full?\n @cells.all?{|element| element != \" \"}\n end",
"def full?\n cells.all?{|token| token == \"X\" || token == \"O\"}\n end",
"def __empty?\n return false unless super\n __elements.values.all?(&:__empty?)\n end",
"def character_size_doubled?\n @cr[3][0] == 1\n end",
"def parseElement?(string)\n return string.start_with?(\"~\") ? false : true\n end",
"def valid_contents?(arr)\n arr.each { |e| return false unless (1..@size_pow).include?(e) }\n true\n end",
"def expression_has_valid_structure? expression\n return if expression.size == 0\n\n return unless ['-', '1', '2', '3', '4', '5', '6', '7', '8', '9'].include? expression[0]\n\n return if expression[0] == '-' && !['1', '2', '3', '4', '5', '6', '7', '8', '9'].include?(expression[1])\n\n expression.each_with_index do |value, index|\n if ['+', '/', '*', '-'].include?(value) && !['-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'].include?(expression[index + 1])\n return\n elsif value == '-' && !['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'].include?(expression[index + 1])\n return\n end\n end\n\n true\nend",
"def valid_n3_value?(element)\n return !element.nil? && !element.match(/^[^\"'\\\\]*$/).nil? ? true : false\n end",
"def full?\n cells.all?{|c| c == \"X\" || c == \"O\"}\n end",
"def isFull? \n return @slots[NUMBER_OF_SLOTS-1].content != \" \" \n end",
"def full?\n cells.all? do |cell|\n cell == \"X\" or cell == \"O\"\n end\n end",
"def full?\n cells.all? {|value| value == \"X\" || value == \"O\"}\n end",
"def start_element?\n @contents[0] == :start_element\n end",
"def rebus_value?(v)\n v && v.size > 1\n end",
"def missing_one_in_middle\n regex1 = /[1-6]x[1-6][1-6]/ # example: \" x23x5x\"\n regex2 = /[1-6][1-6]x[1-6]/ # example: \" x2x45x\"\n return ( @distribution.match(regex1) || @distribution.match(regex2) )\n=begin\n [1,2,3].each { |i| \n return true if @counts[i]>0 && @counts[i+1]==0 && counts[i+2]>0 && counts[i+3]>0\n return true if @counts[i]>0 && @counts[i+1]>0 && counts[i+2]==0 && counts[i+3]>0\n }\n return false\n=end\n end",
"def has_elements?\n self.each_element{ |e| return true }\n return false\n end",
"def full?\n flags & 0x2 == 0x2\n end",
"def has_elements?\n return !( self.factures.size.eql?(0) && \n self.ventes.size.eql?(0) && \n self.produits.size.eql?(0) &&\n self.labours.size.eql?(0) &&\n self.pulves.size.eql?(0))\n end",
"def value?\n !element_value.nil? && element_value != ''\n end",
"def day_num_elem?(day)\n if day.int?\n return ((day >= 1) and (day <= DAY_SYM_SEQ.length))\n end\n\n return false\nend",
"def full_power\n return (@attributes & 0x01 == 0x01)\n end",
"def verify_message(message)\n characters = message.chars\n if @elements.all? { |element|\n characters = element.evaluate(characters)\n characters != false\n } && characters.empty?\n puts 'YES'\n else\n puts 'NO'\n end\n end",
"def parity_parts?\n defined?(parity_part_type)\n end",
"def check\n len = 0\n @sig_waveforms.each do |pair|\n values = pair[1]\n if len == 0\n len = values.length\n else\n return false if values.length != len\n end\n end\n return true\n end",
"def is_terminal(element)\n !(@cfg.sigma.index(element) == nil)\n end",
"def full?\n #@cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n @cells.all? do |cell|\n cell == \"X\" || cell == \"O\"\n end\n end",
"def main_entries?\n data.tags.any? { |t| [\"100\", \"110\", \"111\"].include? t }\n end",
"def expands?\r\n\t\treturn PeriodicTable.atomic_number(element) > 13\r\n\tend",
"def full?\n self.length == CARDS.length\n end",
"def full?\n @cells.all? do |mark|\n mark == 'X' || mark == 'O'\n end\n end",
"def binary_multiple_of_4? s\n if not s.empty? and (s.end_with?('00') or s=='0') and s.count('0-9')==(s.size)\n return true\n end\n false\nend",
"def binary_multiple_of_4?(s)\n (/^[10]*00$/ =~ s) != nil\nend",
"def valid_hwb?(hwb)\n hwb.length == 3 && hwb.each_with_index.all? do |c, i|\n c.is_a?(Numeric) && c >= 0 && c <= HWB_UPPER_LIMIT[i]\n end\n end",
"def full_house?\n @card_value_hash.value?(3) && @card_value_hash.value?(2)\n end",
"def binary_multiple_of_4? s\n if /^[10]*00$/.match(s) or /^[10]*0$/.match(s) \n return true\n else \n return false\n end\nend",
"def can_contain?(element)\n false\n end",
"def valid_n3_search_type?(element)\n return !element.nil? && [\"equal\", \"notequal\", \"matches\", \"bounded\"].include?(element)\n end",
"def binary_multiple_of_4? s\n if not s.empty? and s.count('0-9')==(s.size) and (s.end_with?('00') or s=='0')\n return true\n end\n false\nend",
"def first_includes_eps?\n @first && @first.include?(:_eps)\n end",
"def full?\n not empty?\n end",
"def can_tweak_sign?(normal_sign, vandalized_sign)\n ncount = character_count(normal_sign)\n vcount = character_count(vandalized_sign)\n vcount.each do |ch, count|\n return false if vcount[ch] > ncount[ch]\n end\n true\nend",
"def is_partial_luhn_valid?\n get_unit_digit == 0\n end",
"def hex_surrounding_hex?(hex)\n distance(hex)==1\n end",
"def hex_surrounding_hex?(hex)\n distance(hex)==1\n end",
"def binary_multiple_of_4? s\n if s.empty? || s.count('0-9')!=(s.size)\n return false\n else\n return true if s.end_with?('00') || s=='0'\n end\n false\nend",
"def ExOh(str)\n\n return true if str.scan(/x/).size == str.scan(/o/).size\n return false \n \nend",
"def full?(cells = @cells)\n cells.all?{|taken| taken == \"X\" || taken == \"O\"}\n end",
"def has_content(*elements)\n data_exists = false\n\n i = 0\n until data_exists || i >= elements.size do\n xpath = \"//#{elements[i]}\"\n i += 1\n xml_doc.xpath(xpath).each do |node|\n data_exists = true if node.content =~ /\\w/ &&\n node.content.gsub(/(\\r|\\n)/, ' ') !~ /^-\\d{1,2}$/\n end\n end\n\n data_exists\n end",
"def check_taxonomic_length(tax)\n !tax_too_short(tax) && !tax_too_long(tax)\nend",
"def can_tweak_sign?(normal_sign, vandalized_sign)\n hash1 = character_count(normal_sign)\n hash2 = character_count(vandalized_sign)\n # Check if the number of each char in vandalized sign is more than what it has in normal sign:\n hash2.each {|key, value| return false if value > hash1[key]}\n true\nend",
"def element_decl?\n node_type == ELEMENT_DECL\n end",
"def full_house?\n n_and_m_of_a_kind? 3, 2\n end",
"def extended\n divided_text.length > 1\n end",
"def any_empty?\n self.any? { |element| element.to_s.empty? }\n end",
"def cterm?\n @value.kind_of?(Fixnum) and @value.between?(0, 255)\n end",
"def terminal?\n @elements.nil?\n end",
"def valid?\r\n @bytes.same_bytes_as?(CAFE_BABE)\r\n end",
"def entire?\n entire\n end",
"def element?\n node_type == ELEMENT_NODE\n end",
"def one_bit?\n identify.include?('1-bit')\n end",
"def binary_multiple_of_4?(s)\n return /(^[10]*(00)$)|\\b0/.match(s) ? true: false\nend",
"def valid_ein_length?(record)\n record.ein.to_s.length != 9 ? false : true\n end",
"def wellformed?(sig)\n @value.wellformed?(sig)\n end",
"def can_tweak_sign?(normal_sign, vandalized_sign)\n dist_normal_sign = character_count(normal_sign)\n dist_vandalized_sign = character_count(vandalized_sign)\n dist_vandalized_sign.all?{ |ch, freq| freq <= dist_normal_sign[ch] }\nend",
"def full_column(col)\n column = get_column(col)\n return !column.any? { |k,v| v == @empty_sign }\n end",
"def any_empty?\n\t\tself.any? {|elem| elem.to_s.empty?}\n\tend",
"def has_decimal_part?()\n #This is a stub, used for indexing\n end",
"def any_empty?\n self.any? { |element| element.to_s.empty? }\n end",
"def full?\n true if cells.all?{|pos| pos == \"X\" || pos == \"O\"}\n end",
"def element?\n type == ELEMENT_NODE\n end",
"def can_tweak_sign?(normal_sign, vandalized_sign)\n normal_count = character_count(normal_sign)\n vandal_count = character_count(vandalized_sign)\n vandal_count.each do |k,v|\n if normal_count[k] < v\n return false\n end\n end\n return true\nend",
"def valid?\n self =~ /[a-h][1-8]/\n end",
"def empty?\n diversity.size < 2\n end",
"def can_tweak_sign?(normal_sign, vandalized_sign)\n norm_count = character_count(normal_sign)\n vandal_count = character_count(vandalized_sign)\n norm_count.each do |k, v|\n return false if v < vandal_count[k]\n end\n true \nend",
"def valid_oxum?\n bag_info[\"Payload-Oxum\"] == payload_oxum\n end",
"def any_eob_processed?\n self.insurance_payment_eobs.length >= 1\n end",
"def binary_multiple_of_4?(s)\n return false if s.empty?\n\n not_valid_symbol_position = s =~ /[^0,1]/\n return false unless not_valid_symbol_position.nil?\n\n\n number = s.to_i(2)\n (number % 4 == 0) ? true : false\nend",
"def full_house?\n three_of_a_kind? && pair?\n end",
"def expected_length?\n formatted_number.length == 16 ||\n formatted_number.length == 17\n end",
"def binary_multiple_of_4?(s)\n # YOUR CODE HERE\n return true if s == \"0\"\n\t/^[10]*00$/.match(s) != nil\nend",
"def full?\n each_cell do |cell|\n return false unless cell\n end\n true\n end",
"def validrptHivCommand?\n\tif @commands.size < 2\n\t\treturn false \n\telsif @commands[1].size <=0\n\t\treturn false\n\telsif @commands[2].size <=0\n\t\treturn false\n\telsif @commands[3].size <=0\n\t\treturn false\n\tend \n\t\treturn true \nend",
"def magnitude?\n self.units.reject{|d,(u,m)| m==0}.empty?\n end",
"def isPrimitive(char)\n encodedChar = @encoder.encode(char)\n \n count = 1\n current = multiplyEncoded(encodedChar, encodedChar)\n while current != encodedChar do\n current = multiplyEncoded(current, encodedChar)\n count += 1\n end\n\n count == 63\n\n end",
"def binary_multiple_of_4? s\n return false if s.empty? or s =~ /[^01]/\n return true if s.to_i % 100 == 0\n return false\nend",
"def value_omission?\n source.end_with?(':')\n end",
"def elevenish?(n)\n\treturn (n.abs % 11 == 0) || (n.abs % 11 == 1)\nend"
] |
[
"0.6025228",
"0.577176",
"0.568088",
"0.5654736",
"0.558128",
"0.558128",
"0.55590653",
"0.55169666",
"0.55040336",
"0.5490976",
"0.5484095",
"0.54756314",
"0.54338884",
"0.54252243",
"0.5423551",
"0.54182893",
"0.53976476",
"0.53847903",
"0.5377557",
"0.53722984",
"0.5356165",
"0.5344207",
"0.5335858",
"0.53277236",
"0.53093433",
"0.5306054",
"0.5304378",
"0.52932286",
"0.5291212",
"0.529068",
"0.5278214",
"0.5272761",
"0.52613115",
"0.5250569",
"0.5240274",
"0.52388614",
"0.5231231",
"0.5218666",
"0.52183485",
"0.52154106",
"0.5215029",
"0.52035207",
"0.5201188",
"0.51996386",
"0.51817554",
"0.51816326",
"0.5180519",
"0.5179413",
"0.51791435",
"0.5178416",
"0.5177077",
"0.5173991",
"0.5162487",
"0.51616937",
"0.51551425",
"0.5154736",
"0.5152257",
"0.5152257",
"0.5151836",
"0.51508224",
"0.51435316",
"0.51357514",
"0.5135262",
"0.51287514",
"0.5127663",
"0.51275676",
"0.5121589",
"0.5119379",
"0.51126987",
"0.5105471",
"0.5102758",
"0.5101374",
"0.5100935",
"0.50995594",
"0.50973976",
"0.50910664",
"0.5086192",
"0.50802416",
"0.50769717",
"0.5071627",
"0.50620186",
"0.5056348",
"0.5043998",
"0.5041569",
"0.50408745",
"0.50371623",
"0.5036572",
"0.50350237",
"0.50314826",
"0.5030092",
"0.50291634",
"0.50247335",
"0.50229734",
"0.50207573",
"0.5019496",
"0.50188583",
"0.50180227",
"0.5003845",
"0.49992168",
"0.49976197",
"0.49960098"
] |
0.0
|
-1
|
returns true if the element can expand its octet (bond to more elements)
|
def expands?
return PeriodicTable.atomic_number(element) > 13
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def paste_within?(element)\n i = 0\n element.each_byte do |b|\n if b == 32\n i += 1\n end\n end\n return true if i > 1\n end",
"def whole_reg?\n size == parent.size\n end",
"def can_contain?(element)\n false\n end",
"def instruction?\n not elements.select { |e| e.respond_to?(:to_bin) }.empty?\n end",
"def expandable?\n options[:expandable]\n end",
"def valid_contents?(arr)\n arr.each { |e| return false unless (1..@size_pow).include?(e) }\n true\n end",
"def valid_ein_length?(record)\n record.ein.to_s.length != 9 ? false : true\n end",
"def expanding?\n (from_aleph? || expanded_holdings.any?)\n end",
"def expanded?(r)\n false\n end",
"def expand(union_type)\n if not union_type.is_union_type?\n raise AssertionError.new(\n \"Cannot expand with non-union type: #{union_type}\")\n end\n\n is_expanded = false\n\n for type in union_type\n is_expanded = is_expanded | add(type)\n end\n\n return is_expanded\n end",
"def used_by?(element)\n end",
"def used_by?(element)\n end",
"def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end",
"def elements_include_mods?(*elements)\n elements.any? { |n| n =~ /[\\-\\+]/ }\n end",
"def allowed?(element_element)\n self.class.allowed_element.nil? ? false : self.class.allowed_element.include?(element_element.class.name.split('::')[1])\n end",
"def elementdecl?\n @contents[0] == :elementdecl\n end",
"def guidance_text_expanded?\n has_expanded_root?\n end",
"def fund_item_node_must_be_allowed\n return unless fund_item && fund_item.persisted? && appended? &&\n perspective && perspective == PERSPECTIVES.first\n unless fund_item.allowed_nodes.include? fund_item.node\n errors.add :fund_item, \"exceeds quantity of #{fund_item.node} that may be appended\"\n end\n end",
"def fully_expanded?\n @unexpanded.empty? && (\n self.is_root? || parent.fully_expanded?\n )\n end",
"def is_fully_collapsed(coefficients)\n coefficients.each do |col|\n col.each do |entry|\n return false if entry.length > 1\n end\n end\n true\nend",
"def include?(position)\n @field[position / ELEMENT_WIDTH] & 1 << (position % ELEMENT_WIDTH) > 0\n end",
"def element?\n node_type == ELEMENT_NODE\n end",
"def complete?\n @bytes == [[0, @length - 1, true]]\n end",
"def has_elements?\n self.each_element{ |e| return true }\n return false\n end",
"def start_element?\n @contents[0] == :start_element\n end",
"def packed?\n @packed\n end",
"def inline_element?\n\t\t\n\tend",
"def check_full? \n \t\treturn true if @size==16 #size increase by 1 with every turn so when it reaches 16 we know that all cells are full\n\tend",
"def has_elements?; end",
"def expandable?(exp, defs)\n if ((global_call?(exp) or constant_call?(exp)) and array?(exp) and defs.key?(call_keys(exp)))\n true\n else\n false\n end\n end",
"def can_overflow?\n false\n end",
"def element_decl?\n node_type == ELEMENT_DECL\n end",
"def relaxed?\n self.syntax = :invalid\n self.valid_size? or return false\n self.valid_encoding? or return false\n if self.tag\n return false unless self.mailbox =~ RELAXED_MAILBOX_REGEX &&\n self.tag =~ RELAXED_TAG_REGEX\n elsif self.local =~ RELAXED_MAILBOX_REGEX\n self.syntax = :relaxed\n true\n else\n false\n end\n end",
"def canAfford?(cost, character)\n return cost <= character.gp\n end",
"def element?\n type == ELEMENT_NODE\n end",
"def __empty?\n return false unless super\n __elements.values.all?(&:__empty?)\n end",
"def expanded?\n match(/\\[(.*?)\\]/).nil?\n end",
"def entire?\n entire\n end",
"def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end",
"def expect_lookahead?(element)\n return element.class == Node[:capture] unless element.is_a? Node[:group]\n element.payload.all? { |e| expect_lookahead?(e) }\n end",
"def isValid\n # check that the amino acid is complete\n nonHydrogenAtoms = self.atoms.select{|atom| atom.atom != \"H\"}\n if (nonHydrogenAtoms.size == AMINO_ACID_SIZES[self.resname])\n @isvalid = true\n end\n puts \"ISVALID : #{self.isvalid} #{nonHydrogenAtoms.size} \"\n end",
"def correct?\n total = 0\n @element_list.each do |element|\n total += element[1]\n end\n total == @target && @element_list.size >= @minimum_size\n end",
"def should_expand(field)\n registries[field.to_sym].present?\n end",
"def valid?\n @elements.size > 0\n end",
"def end_element?\n @contents[0] == :end_element\n end",
"def can_deal?\n size() >= 6\n end",
"def isFull\n\t@bo.each do |i| \n\t\tif i == '-' then \n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\n end",
"def capacity_chk (web_bus)\n\tweb_locs = web_bus.web_locations.sort_by {|a| a.order_num }\n\tstackLen = 0\n\tweb_locs.each do |web_loc|\n\t\tif web_loc.is_pickup\n\t\t\tstackLen = stackLen + 1\n\t\telse\n\t\t\tstackLen = stackLen - 1\n\t\tend\n\t\tif stackLen > web_bus.capacity\n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\nend",
"def capacity_chk (web_bus)\n\tweb_locs = web_bus.web_locations.sort_by {|a| a.order_num }\n\tstackLen = 0\n\tweb_locs.each do |web_loc|\n\t\tif web_loc.is_pickup\n\t\t\tstackLen = stackLen + 1\n\t\telse\n\t\t\tstackLen = stackLen - 1\n\t\tend\n\t\tif stackLen > web_bus.capacity\n\t\t\treturn false\n\t\tend\n\tend\n\treturn true\nend",
"def support_capacity?\n @ctype_id == 3\n end",
"def smartContentEnabled?\n smart_content_element.count > 0 \n end",
"def has_places?\n capacity > 0\n end",
"def check_evalation\n return true if @ep.count(-1) >= @gene_size\n false\n end",
"def complete?\n total = 0\n @element_list.each do |element|\n total += element[1]\n end\n total >= @target\n end",
"def complete?\n buff.length < @maxlen\n end",
"def full?\n return false if capacity.nil?\n capacity - mentor_terms_count <= 0\n end",
"def defensive\n return (@attributes & 0x10 == 0x10)\n end",
"def allow?(packet); end",
"def is_valid_inherit_element?(element)\n VALID_INHERIT_TAGS.include?(element.get_tag_name) &&\n Hatemile::Util::CommonFunctions.is_valid_element?(element)\n end",
"def poopy?\n\t\t@stuff_in_intestine >= 8\n\tend",
"def an_ip_number?(element)\n element.to_i >= 0 && element.to_i <= 255\nend",
"def element_start?\n @reader.node_type == XML::Reader::TYPE_ELEMENT\n end",
"def eligible?(n)\n true\n end",
"def extended\n divided_text.length > 1\n end",
"def valid?\r\n @bytes.same_bytes_as?(CAFE_BABE)\r\n end",
"def character_size_doubled?\n @cr[3][0] == 1\n end",
"def on_as_boundary?\n if !@previous.nil? && @previous.asn != @asn && @previous.ip != \"0.0.0.0\"\n return @previous.asn\n end\n\n if !@next.nil? && @next.asn != @asn && @next.ip != \"0.0.0.0\"\n return @next.asn\n end\n\n return false\n end",
"def full?\n self.length == CARDS.length\n end",
"def nested_child?\n @elements.last.class.method_defined?('add_element') && @elements.last.container\n end",
"def alto?\n @cr[0xb][7] == 1\n end",
"def elevenish?(n)\n\treturn (n.abs % 11 == 0) || (n.abs % 11 == 1)\nend",
"def is_well_formed?\n\t\t\treturn self.node_stack.length == 1\n\t\tend",
"def xml_element?(xml)\n xml.kind_of? Nokogiri::XML::Element\n end",
"def isFull?\n end",
"def full?\n self.cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n end",
"def irregular?\n false\n end",
"def full?\n return (@fill_count == size)\n end",
"def has_padding?\n parent.smb_header.flags2.unicode == 1 && pad.abs_offset % 2 == 1\n end",
"def has_bomb?\n\t\t\t@content == :BOMB\n\t\tend",
"def extension?\n node.name == \"extend\"\n end",
"def long_planeteer_calls(array)\n array.each do |element|\n return true unless element.to_s.length <= 4\n end\n return false\nend",
"def has_id_element?\n each_node do |n|\n next unless n.kind_of?(Element)\n next unless n.hid\n return true\n end\n false\n end",
"def valid?\n return false if !@item_id.nil? && @item_id.to_s.length > 6\n return false if !@item_id.nil? && @item_id.to_s.length < 1\n true\n end",
"def explosive_captive_around?\n explosive_captives_around >= 1\n end",
"def Allowed?(piece, start, stop)\r\n end",
"def full?\n flags & 0x2 == 0x2\n end",
"def flag_more?()\n return(true) if(@flags & TAC_PLUS_ACCT_FLAG_MORE == TAC_PLUS_ACCT_FLAG_MORE)\n return(false)\n end",
"def available?(digit)\n @available_digits.member? digit\n end",
"def ip_well_formed?\n\t\tunless ip_address && ip_address =~ /^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/\n\t\t\terrors.add(:ip_address, \"is malformed\")\n\t\t\treturn false\n\t\tend\n\t\t\n\t\toctets = [$1, $2, $3, $4]\n\n\t\toctets.each { |octet|\n\t\t\tunless octet.to_i <= 256 && octet.to_i >= 0\n\t\t\t errors.add(:ip_address, \"is malformed\")\n\t\t\t return false\n\t\t\tend\n\t\t}\n\t\ttrue\n\tend",
"def victory\n if @findAll + @num_mines >= quantityFields\n return true\n else\n return false\n end\n end",
"def full?\n # return true if the value of the abolute value of the instance var @tail\n # is equal to the value of the instance var @size\n # otherwise return false\n @tail.abs == (@size)\n # end the full? method\n end",
"def exploitable?\n return true if status == EXPLOITABLE or status == POSSIBLY_EXPLOITABLE\n return false\n end",
"def complete?\n @cards.length == 5\n end",
"def exceeds_appendable_quantity_limit_for_fund_request?( fund_request )\n return false unless fund_request.fund_request_type.appendable_quantity_limit\n return true if ( fund_request.fund_items.appended.where { id != my { id } }.length ==\n fund_request.fund_request_type.appendable_quantity_limit )\n false\n end",
"def as_many_bytes_as?(other)\n type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes\n end",
"def have?(length)\n return length <= @buffer.bytesize \n end",
"def has_element_like(element)\n element = element.to_s if element.kind_of? Clause\n element = \"'#{element.lore_escape}'\" if element.kind_of? String\n @value_string = \"#{element} ~~~ ANY (#{@field_name})\"\n Clause.new(@value_string, @left_side+@value_string, '', @plan)\n end",
"def movable?\r\n exist? && restriction < 4\r\n end",
"def elevenish(n) \n\tif n % 11 == 0\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"def isPrimitive(char)\n encodedChar = @encoder.encode(char)\n \n count = 1\n current = multiplyEncoded(encodedChar, encodedChar)\n while current != encodedChar do\n current = multiplyEncoded(current, encodedChar)\n count += 1\n end\n\n count == 63\n\n end"
] |
[
"0.601387",
"0.57836974",
"0.57396716",
"0.5709083",
"0.5543858",
"0.5498715",
"0.5401221",
"0.53878194",
"0.5362449",
"0.53407836",
"0.52675235",
"0.52675235",
"0.52554685",
"0.52554685",
"0.52339303",
"0.5233338",
"0.5202741",
"0.5199725",
"0.5171797",
"0.51586664",
"0.51560533",
"0.5148832",
"0.5134421",
"0.51189935",
"0.5113083",
"0.51055765",
"0.50821847",
"0.50815344",
"0.5075813",
"0.5066533",
"0.5054405",
"0.50493544",
"0.50430995",
"0.5021504",
"0.5018906",
"0.5009475",
"0.49989167",
"0.49893218",
"0.49830338",
"0.49830338",
"0.49741733",
"0.4972776",
"0.49695602",
"0.49642336",
"0.49583897",
"0.49490705",
"0.4935274",
"0.4922584",
"0.49212867",
"0.4905131",
"0.4901537",
"0.4895848",
"0.48940247",
"0.4886524",
"0.4873665",
"0.48731607",
"0.48686224",
"0.48652342",
"0.48642653",
"0.4855464",
"0.48508215",
"0.48497283",
"0.4845799",
"0.48432252",
"0.48410216",
"0.4836882",
"0.4831603",
"0.48292884",
"0.4826621",
"0.4823049",
"0.48048833",
"0.48017067",
"0.4791264",
"0.47889623",
"0.4788551",
"0.47797236",
"0.47724286",
"0.47624603",
"0.4760997",
"0.47594923",
"0.4759065",
"0.47582647",
"0.47540927",
"0.4751149",
"0.4735423",
"0.47343254",
"0.4733515",
"0.4729555",
"0.47257546",
"0.4725695",
"0.47162864",
"0.47156018",
"0.47090533",
"0.47077742",
"0.4705075",
"0.47015533",
"0.46944958",
"0.4687848",
"0.46877995",
"0.46853527"
] |
0.6616966
|
0
|
sets the next unbonded node in nodes to node
|
def next=(node)
# you can only bond if it has unbonded sites
if !full?
nodes.each_index { |i|
if nodes.at(i) == nil
nodes[i] = node
break
end
}
return node
# unless it expands, in which case you can bond
elsif expands?
nodes << node
puts nodes
nodes.flatten!
return node
# cannot further bond
else
return nil
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_next(node)\n @next_node = node\n end",
"def set_next(node)\n\t\t\t@next = node\n\t\tend",
"def next=(node_or_tags); end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next=(node)\n @next = node\n end",
"def next_sibling=(other); end",
"def replace_head(node)\n self.head = node\n end",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def move_later\n nekst = self.next\n self.append_to(nekst) if nekst\n end",
"def node=(_); end",
"def node=(_); end",
"def node_alt(node, this, nxt)\n\n # Create an edge between this and next for each child\n node.children.each do |child|\n process_node(child, this, nxt)\n end\n end",
"def replace(idx, node)\n if idx.zero?\n remove_first\n add_first(node)\n return node\n end\n\n iterate do |curr_node, count|\n if count == idx - 1\n node.next_node = curr_node.next_node.next_node\n curr_node.next_node = node\n node.prev_node = curr_node\n\n unless curr_node.next_node.next_node.nil?\n curr_node.next_node.next_node.prev_node = node\n end\n\n return node\n end\n end\n end",
"def unshift(node_value)\n # Start by creating a new node and assigning it to a var\n new_node = Node.new(node_value)\n\n #\n if empty?\n # If DLL is empty, set both head and tail to new node\n @head = new_node\n @tail = new_node\n else\n # If DLL contains one or more nodes, hold the head in a var\n hold = @head\n # Set the prev of the new head var to the new node\n hold.prev = new_node\n # Set the head prop to the new node as well\n @head = new_node\n # Set the head prop's next to the old head\n @head.next = hold\n end\n\n # Increment size in all cases\n @size += 1\n # Return self for chaining\n self\n end",
"def add_next_sibling(node_or_tags); end",
"def add_first(node)\n node.next_node = @head\n @head.prev_node = node unless @head.nil?\n @head = node\n end",
"def map_nodes!(&ruby_block)\n @ref = ruby_block.call(@ref)\n @ref.parent = self unless @ref.parent\n end",
"def set_head(value)\n @head = new_node(value)\nend",
"def previous=(node_or_tags); end",
"def replace_with(node) \n raise \"Cannot replace a node with itself!\" if node == self\n @in.each do |i|\n i.out.map! { |n| n == self ? node : n } if i != node\n end\n @graph.start = node if @graph.start == self\n @graph.remove(self) if not node.forward.include? self\n end",
"def next_node\n body_has_more_nodes? ? @body_enumerator.next : nil\n end",
"def node_seq(node, this, nxt)\n a = this\n b = new_state()\n\n # Create a sequence of transitions between this and next, \n # creating more states as needed\n node.children.each.with_index do |child, index|\n if index == node.children.size - 1\n b = nxt\n end\n\n process_node(child, a, b)\n\n a = b\n b = new_state()\n end\n end",
"def head\n @current_node = @head\n end",
"def current=(node)\n\t\t\t@try_current[-1] = node\n\t\tend",
"def delete_after(node)\n node.next = node.next.next\n end",
"def map_nodes!(&ruby_block)\n @index = ruby_block.call(@index)\n @index.parent = self unless @index.parent\n @ref = ruby_block.call(@ref)\n @ref.parent = self unless @ref.parent\n end",
"def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)\n end",
"def next\n @next ||=\n if next_uri\n node_cache.fetch(next_uri) do\n node = self.class.new(node_cache, next_uri, adapter, graph)\n node.prev = self\n node\n end\n end\n end",
"def break(node)\n tail = @next\n @next = node\n node.next = tail\n node\n end",
"def nodes=(nodes)\n range = self.range()\n\n %x{\n range.deleteContents();\n\n for (var i=nodes.length-1; i >= 0; i--) {\n var node = nodes[i];\n\n node.parentNode.removeChild(node);\n range.insertNode(node);\n }\n }\n end",
"def unshift(value)\n @head = Node.new(value, @head)\n end",
"def shift\n (e = node_set.shift) && NodeProxy.new(e, parent)\n end",
"def mark_assignments_as_referenced_in_loop(node); end",
"def set_tail(value)\nlast_node(head).next_node = new_node(value)\n end",
"def shift\n current_node = @head\n @head = current_node.next_node\n end",
"def initialize\n @first_node = nil\n end",
"def attach(head, node)\n if head.next_node == nil\n head.next_node = node\n else\n #keep going\n attach(head.next_node, node)\n end\n end",
"def nodes=(nodes)\n range = self.range\n\n `\n range.deleteContents();\n\n for (var i=nodes.length-1; i >= 0; i--) {\n var node = nodes[i];\n\n node.parentNode.removeChild(node);\n range.insertNode(node);\n }\n `\n end",
"def map_nodes!(&ruby_block)\n @statement = ruby_block.call(@statement)\n @statement.parent = self unless @statement.parent\n end",
"def swap(node_or_tags); end",
"def swap(node_or_tags); end",
"def at(index)\n node = @head\n index.times { node = node.link } \n node\n end",
"def next(num)\n @node = num\n @hour.number +=1\n end",
"def delete_this_node(node)\n node.val = node.next_node.val\n node.next_node = node.next_node.next_node\n return node\nend",
"def map_nodes!(&ruby_block)\n @child = ruby_block.call(@child)\n @child.parent = self unless @child.parent\n end",
"def delete_node(node)\n ## just copy the information of the next node and then cut it out\n node.id = node.next.id\n node.next = node.next.next\nend",
"def nodes_upward\n LinkEnumerator.new :up, self\n end",
"def set_node(val)\n self.node = val\n self\n end",
"def set_node(val)\n self.node = val\n self\n end",
"def unshift(node)\n if @head.nil?\n @head = node\n @tail = node\n else\n node.next = @head\n @head = node\n end\n end",
"def set_current(node)\n\t\t@current_node = node\n\tend",
"def next_node\n children.first || successor\n end",
"def set_prev(node)\n @prev_node = node\n end",
"def next_node\n @SuccessorReference.value\n end",
"def previous_sibling=(other); end",
"def node_at(index)\n node = head\n index.times { node = node.next_node }\n node\n end",
"def at(index)\n\t\t@current_node = @head\n\n\t\tindex.times do \n\t\t\t@current_node = @current_node.next_node\n\t\tend\n\n\t\treturn @current_node\n\tend",
"def next\n @next||=after.first\n end",
"def set_next_node(data)\n data_placed = false\n temp = @root\n until data_placed\n if data == temp.value\n data_placed = true\n elsif data < temp.value\n if temp.left_child.nil?\n temp.left_child = Node.new(data, temp)\n data_placed = true\n else\n temp = temp.left_child\n end\n else # data > temp.value\n if temp.right_child.nil?\n temp.right_child = Node.new(data, temp)\n data_placed = true\n else\n temp = temp.right_child\n end\n end\n end\n end",
"def node=(node)\n retract[:node] = node\n end",
"def assign_new_head(beats)\n @head = Node.new(beats[0])\n beats.shift\n end",
"def preceding(node); end",
"def pop\n @nodes.shift\n end",
"def delete\n @prev_node.next_node = @next_node\n @next_node.prev_node = @prev_node\n @prev_node = @next_node = nil\n @value\n end",
"def advance\n @to = @to.next\n end",
"def insert_node_between(a, b, new_one)\n a.next = new_one\n new_one.prev = a\n new_one.next = b\n b.prev = new_one\n @length += 1\n end",
"def node=(val)\r\n case val\r\n when Node, NilClass\r\n @node = val\r\n end\r\n end",
"def node=(node)\n @node = node\n end",
"def freshen(link, value)\n link.prev.next = link.next\n link.next.prev = link.prev\n attach_to_tail(link)\n link.val = value\n link\n end",
"def from_node(original_node); end",
"def moveto_next\n return if @range.empty?\n if index = @range.index(self.pos)\n @index = index\n end\n @index += 1\n @index %= @range.size\n moveto @range[@index]\n end",
"def swap(node_or_tags)\n replace node_or_tags\n self\n end",
"def update(node); end",
"def assignSiblingNode(sibling)\n\t\t@siblingNode = sibling \n\tend",
"def shift\n node = first\n first = node.nxt\n first.prv = nil\n node.nxt = nil\n node\n end",
"def remove_or_decrement_ref(*nodes); end",
"def map_nodes!(&ruby_block)\n @range = ruby_block.call(@range.first)..ruby_block.call(@range.last)\n @range.first.parent = self unless @range.first.parent\n @range.last.parent = self unless @range.last.parent\n @ref = ruby_block.call(@ref)\n @ref.parent = self unless @ref.parent\n end",
"def delete_node_improved(node)\n node.val = node.next.val\n node.next = node.next.next\nend",
"def set_prev(node)\n\t\t\t@prev = node\n\t\tend",
"def move_node_to_head(node) \n removed = remove_node(node)\n\n add_head(removed)\n end",
"def deleteNode node\n node.val = node.next.val\n node.next = node.next.next\nend",
"def initialize\n @sentinel = Node.new\n @sentinel.prev = @sentinel\n @sentinel.next = @sentinel\n end",
"def initialize\n @sentinel = Node.new\n @sentinel.prev = @sentinel\n @sentinel.next = @sentinel\n end",
"def prepend(value)\n new_node = Node.new(value)\n new_node.next = @node\n @node = new_node\n end",
"def add_first(e)\n node = Node.new(e, @sentinel, @sentinel.next)\n @sentinel.next.prev = node\n @sentinel.next = node\n end",
"def add_first(e)\n node = Node.new(e, @sentinel, @sentinel.next)\n @sentinel.next.prev = node\n @sentinel.next = node\n end",
"def assign_ins(i)\n self.first = self.last = Node.new\n self.first.value = i\n self.first.next = self.last.next = nil\n self.type = 'int'\n end",
"def add_previous_sibling(node_or_tags); end",
"def move_node!(tg,tga,i)\n #first just add node i in\n tga[0].each_index do |ii|\n if (i == tga[0][ii][0])\n tg[0].push(tga[0][ii])\n tga[0][ii] = nil\n break\n end\n end\n #then add the edges, only add edges for which both nodes exist in tg \n tga[1].each_index do |ii|\n if tg[0].index{|item| item[0] == tga[1][ii][0]} && tg[0].index{|item| item[0] == tga[1][ii][1]}\n tg[1].push(tga[1][ii])\n tga[1][ii] = nil\n end\n end\n tga[0].compact!\n tga[1].compact!\nend",
"def child_node=(_); end",
"def remove\n @nxt.prv = @prv if @nxt\n @prv.nxt = @nxt if @prv\n end",
"def last=(node)\n return self.sibling = node\n end",
"def next(node)\n @path[@path.index(node) + 1]\n end",
"def visit_node(n); end",
"def prepend(node)\n node.next = @head.next\n @head.next = node\n end",
"def add_siblings_to(node, rpr_tag = T.unsafe(nil)); end",
"def pull_node(xn)\n # nothing to do with node\n end",
"def map_nodes!(&ruby_block)\n @match = ruby_block.call(@match)\n @match.parent = self unless @match.parent\n @statement = ruby_block.call(@statement)\n @statement.parent = self unless @statement.parent\n end"
] |
[
"0.7407816",
"0.7229167",
"0.70978266",
"0.68937254",
"0.68380064",
"0.6610594",
"0.6421481",
"0.6197552",
"0.6088718",
"0.6088718",
"0.6087791",
"0.60684794",
"0.60684794",
"0.6066878",
"0.60214865",
"0.59290975",
"0.5913215",
"0.5867936",
"0.5849535",
"0.58047324",
"0.58045316",
"0.5783459",
"0.57778585",
"0.5771701",
"0.57704407",
"0.57670105",
"0.57329273",
"0.57240385",
"0.5711125",
"0.57064694",
"0.56939566",
"0.56832933",
"0.56831384",
"0.5678918",
"0.5676961",
"0.5672977",
"0.56672645",
"0.56669605",
"0.5665262",
"0.56648815",
"0.5662868",
"0.56553227",
"0.56553227",
"0.5653687",
"0.5641716",
"0.5635655",
"0.562486",
"0.56240493",
"0.5616084",
"0.56153876",
"0.56153876",
"0.5602548",
"0.559398",
"0.559026",
"0.55823934",
"0.5554046",
"0.5552083",
"0.5542239",
"0.553954",
"0.5539119",
"0.5539066",
"0.5536019",
"0.5535099",
"0.5533226",
"0.55297476",
"0.5526237",
"0.55249995",
"0.5518363",
"0.55170757",
"0.551531",
"0.55127877",
"0.5499869",
"0.5496652",
"0.5494286",
"0.54924756",
"0.5488947",
"0.54878616",
"0.5482821",
"0.5481097",
"0.5473001",
"0.5468046",
"0.5465779",
"0.54557014",
"0.5450679",
"0.5450679",
"0.54503566",
"0.5450099",
"0.5450099",
"0.5448953",
"0.54395247",
"0.5409898",
"0.5409798",
"0.5405875",
"0.53930855",
"0.5390055",
"0.53808635",
"0.5371029",
"0.53697723",
"0.5362408",
"0.53589696"
] |
0.720494
|
2
|
Check for equality with another value. If compared to Puppet Sensitive type, it compares the wrapped values.
|
def ==(other)
if other.respond_to? :unwrap
unwrap == other.unwrap
else
super
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ==(other)\n self.class == other.class && value == other.value\n end",
"def ==(other)\n self.class == other.class && value == other.value\n end",
"def ==(other)\n super || other.class == self.class && other.value == value\n end",
"def eql?(other)\n self.class == other.class && value == other.value\n end",
"def eql?(other)\n self.class == other.class && value == other.value\n end",
"def equivalentValues(other) # JS == operator\n other.is_a?(Object) && unwrap.eql?(other.unwrap)\n end",
"def ==(other)\n @value == other.value\n end",
"def eql?(other)\n self.class.equal?(other.class) && value == other.value\n end",
"def eql?(other)\n self.class.equal?(other.class) && value == other.value\n end",
"def ==(other)\n @value = other\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class && value == o.value\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class && value == o.value\n end",
"def ==(o)\n o.class == self.class && o.type == @type && o.value == @value\n end",
"def ==(other)\n case other\n when Literal\n self.value.eql?(other.value) &&\n self.language.eql?(other.language) &&\n self.datatype.eql?(other.datatype)\n when String\n self.plain? && self.value.eql?(other)\n else false\n end\n end",
"def eql?(other)\n\t\tother = other.value if other.is_a? self.class\n\t\treturn value.eql?(other)\n\tend",
"def ==(obj)\n return false unless obj.kind_of? self.class\n\n value == obj.value\n end",
"def ===(other)\n if other.is_a?(right_class)\n value === other.value\n else\n super\n end\n end",
"def ==(value)\n #\n # Bitstring/bitstring comparison\n #\n unless (value.class == self.class)\n value = _arg2int(value)\n if (self.bounded?)\n bits = [self.length, value.to_s(2).length].max\n value = self.class.new(value, bits)\n else\n value = self.class.new(value)\n end\n end\n ((self.class == value.class) &&\n (self.bounded? == value.bounded?) &&\n (self.length == value.length) &&\n (@value == value.to_i))\n end",
"def equivalentValues(other) # JS == operator\n return false unless other.is_a?(Function)\n return true if unwrap == other.unwrap\n # Method.== does check if their bind to the same object\n # JS == means they might be bind to different objects :\n unwrap.to_s == other.unwrap.to_s # \"#<Method: Foo#bar>\"\n end",
"def eql?(other)\n\t if other.zero?\n\t\t@value.zero?\n\t elsif other.respond_to?(:units)\n\t\tif other.respond_to? :value\n\t\t @units.eql?(other.units) and @value.eql?(other.value)\n\t\telse\n\t\t other == self\n\t\tend\n\t else\n\t\t@units.nil? and @value.eql?(other)\n\t end\n\tend",
"def ===(value)\n (self.class === value) && value.entries.all? do |k,v|\n (@key_type.nil? || @key_type === k) &&\n (@value_type.nil? || @value_type === v)\n end\n end",
"def ==(obj)\n self.class == obj.class and self.val == obj.val\n end",
"def ==(other)\n super(other) && (\n (@key_type == other.key_type) &&\n (@value_type == other.value_type)\n )\n end",
"def eql?(other)\n\t if other.respond_to?(:units)\n\t\t(@units == other.units) and (@value == other.value)\n\t elsif other == 0\n\t\t@value == other\n\t else\n\t\t(@units == nil) and (@value == other)\n\t end\n\tend",
"def ==(other)\n if self.class === other\n self.value == other.value && self.visible_params == other.visible_params && self.tzid == other.tzid\n else\n super\n end\n end",
"def value?(value)\n wrap(value, ->(a, b) { a == b })\n end",
"def bt_same_value?(other)\n bt_value_attributes == other.bt_value_attributes\n end",
"def === other\n self.to_sym === other.to_sym || super(other)\n end",
"def ==(other)\n other.is_a?(SysproObject) &&\n @values == other.instance_variable_get(:@values)\n end",
"def eql?(other)\n if other.is_a?(Literal::XML)\n case @library\n when :nokogiri then equivalent_nokogiri(other)\n when :rexml then equivalent_rexml(other)\n end\n elsif other.is_a?(Literal) && (other.plain? || other.datatype == RDF::XSD.string)\n value == other.value\n else\n super\n end\n end",
"def secure_compare(a, b); end",
"def secure_compare(a, b); end",
"def secure_compare(a, b); end",
"def ==(other)\n self.base.to_si.eql? other.base.to_si\n end",
"def ==(other)\n if other.kind_of? Details::Attribute\n self.name == other.name && self.value == other.value\n else\n self.value == other\n end\n end",
"def ==(other)\n matches(other) && @values == other.values\n end",
"def ==(other)\n @value == other.value and @annotation == other.annotation\n end",
"def ==(other)\n lcm_div = @div.lcm(other.div)\n (@val * (lcm_div / @div)) == (other.val * (lcm_div / other.div))\n end",
"def ==(other)\n values == other.values if other.respond_to? :values\n end",
"def test_equality_simple\n value1_ = ::Versionomy.create(:major => 2, :minor => 0, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n assert_equal(value2_, value1_)\n assert_equal(value2_.hash, value1_.hash)\n end",
"def secure_compare(value)\n a = self.secret\n b = value\n\n return false if a.blank? || b.blank? || a.bytesize != b.bytesize\n l = a.unpack \"C#{a.bytesize}\"\n\n res = 0\n b.each_byte { |byte| res |= byte ^ l.shift }\n res == 0\n end",
"def ==(other)\n `return self.valueOf() === other.valueOf() ? Qtrue : Qfalse;`\n end",
"def ==(other)\n `return self.valueOf() === other.valueOf() ? Qtrue : Qfalse;`\n end",
"def eql?(o, *fields)\n super o, *(fields + [:content_type, :value])\n end",
"def ==(other)\n other.kind_of?(Orchestrate::KeyValue) && \\\n other.collection == collection && \\\n other.key == key\n end",
"def ==(other)\n other.kind_of?(Orchestrate::KeyValue) && \\\n other.collection == collection && \\\n other.key == key\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n cusip == o.cusip &&\n ticker == o.ticker &&\n security_name == o.security_name &&\n security_type == o.security_type &&\n title_of_class == o.title_of_class &&\n stock_exchange == o.stock_exchange &&\n filing_date == o.filing_date &&\n value == o.value &&\n amount == o.amount &&\n type == o.type &&\n investment_discretion == o.investment_discretion &&\n other_manager == o.other_manager &&\n sole_voting_authority == o.sole_voting_authority &&\n shared_voting_authority == o.shared_voting_authority &&\n no_voting_authority == o.no_voting_authority\n end",
"def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end",
"def ==(ct); end",
"def ==(ct); end",
"def value?(value)\n\t\treturn self.value == value\n\tend",
"def value?(value)\n\t\treturn self.value == value\n\tend",
"def == other\n return false unless other.is_a?(RemoteHash)\n secret == other.secret\n end",
"def == other\n (self.start_value == other.start_value) &&\n (self.value_changes == other.value_changes)\n end",
"def ==(val)\n method_missing(:==, val)\n end",
"def ==(other)\n case other\n when Symbol\n self.to_sym == convert_to_snake_case_symbol(other)\n when String\n self.to_sym == convert_to_snake_case_symbol(other)\n when Numeric\n self.to_i == other.to_i\n else\n if other.kind_of?(Ably::Modules::Enum::Base)\n self.to_sym == other.to_sym\n end\n end\n end",
"def ==(other)\n # If lexically invalid, use regular literal testing\n return super unless self.valid? && (!other.respond_to?(:valid?) || other.valid?)\n\n case other\n when Literal::Numeric\n (cmp = (self <=> other)) ? cmp.zero? : false\n when RDF::URI, RDF::Node\n # Interpreting SPARQL data-r2/expr-equal/eq-2-2, numeric can't be compared with other types\n type_error(\"unable to determine whether #{self.inspect} and #{other.inspect} are equivalent\")\n else\n super\n end\n end",
"def eql?(other)\n self.suit == other.suit && self.value == other.value\n end",
"def eq=(value)\n self === value\n end",
"def eql?(other)\n type == other.to_s\n end",
"def ==(b)\n case b\n when Int\n @value == b.value\n when Numeric\n @value == b\n else\n false\n end\n end",
"def ==(other)\n # If lexically invalid, use regular literal testing\n return super unless self.valid?\n\n case other\n when Literal::Numeric\n return super unless other.valid?\n (cmp = (self <=> other)) ? cmp.zero? : false\n when RDF::URI, RDF::Node\n # Interpreting SPARQL data-r2/expr-equal/eq-2-2, numeric can't be compared with other types\n type_error(\"unable to determine whether #{self.inspect} and #{other.inspect} are equivalent\")\n else\n super\n end\n end",
"def ==(other)\n [@name, @value] == [other.name, other.value]\n end",
"def eql?(*) end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n name == o.name &&\n value == o.value &&\n timestamp == o.timestamp &&\n source_id == o.source_id &&\n source_label == o.source_label &&\n source == o.source &&\n selected_by_user == o.selected_by_user &&\n selected_by_user_timestamp == o.selected_by_user_timestamp &&\n source_vid == o.source_vid &&\n source_metadata == o.source_metadata &&\n request_id == o.request_id &&\n updated_by_user_id == o.updated_by_user_id &&\n persistence_timestamp == o.persistence_timestamp &&\n use_timestamp_as_persistence_timestamp == o.use_timestamp_as_persistence_timestamp\n end",
"def equals( t2 )\n t1 = self.clone\n t1.toK\n t2.toK\n if t1.value == t2.value then return true\n else return false\n end\n end",
"def is_equal_value?\n return true unless value_to_compare?\n assigns[@name] == @options[:with]\n end",
"def check\n if @value1 == @value2\n @message = \"#{@value1} == #{@value2}\"\n true\n else\n @message = \"#{@value1} != #{@value2}\"\n false\n end\n end",
"def !=(other)\n value != other.value\n end",
"def values_sndiff_equal?(bav, pav)\n bav == pav || string_numeric_diff_ignored? && bav.is_a?(String) && pav.is_a?(Numeric) && to_number_or_nil(bav) == pav\n end",
"def matches?(other)\n operable_values == other.operable_values\n end",
"def eql?(other)\n other.is_a?( Chamber::Settings) &&\n self.data == other.data &&\n self.namespaces == other.namespaces\n end",
"def eq?(other)\n return false if ref_type != other.ref_type\n \n case struc_type\n # :STRING, like :ATOM & :PAIR, has no referential type and does not belong here\n when :NUMERAL, :BOOLEAN then return eql?(other) # note that !1.eql?(1.0) whereas 1 == 1.0 \n when :HANDLE\n return quoted.eq?(other.quoted) if quoted.handle? # recursive call\n return quoted.list.equal?(other.quoted.list) if quoted.rail?\n return quoted.equal?(other.quoted)\n when :RAIL # Rail overrides eq?\n return self == other\n when :CLOSURE\n return true if equal?(other)\n raise_error(self, \"= not generally defined over functions\") \n when :ENVIRONMENT\n return true if equal?(other)\n raise_error(self, \"= not generally defined over bindings\") \n else\n raise_error(self, \"equality undefined for #{self.to_s} and #{other.to_s}\")\n end\n end",
"def ==(other)\n SecurityUtils.secure_compare(self, SCrypt::Engine.hash_secret(other, @cost + @salt, digest.length / 2))\n end",
"def eql?(field)\n if field.is_a?(GFA::Field)\n type == field.type && value == field.value\n else\n field.is_a?(value.class) && value == field\n end\n end",
"def ===(other)\n return true if self == other\n if self.kind == other.kind\n case self.kind\n when :variable\n return self.value == other.value\n when :abstraction\n return (self.bound_var == other.bound_var &&\n self.body === other.body)\n when :application\n return (self.function === other.function &&\n self.argument === other.argument)\n end\n end\n return false\n end",
"def eql?(other)\n other.is_a?(Chamber::Settings) &&\n data == other.data &&\n namespaces == other.namespaces\n end",
"def ==(other)\n return false unless other.is_a?(Int32)\n value == other.value\n end",
"def ==(val)\n if val.is_a?(Model)\n # Use normal comparison for a model\n super\n else\n # Compare to attributes otherwise\n attributes == val\n end\n end",
"def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end",
"def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end",
"def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end",
"def ==(other)\n case other\n when String then other == to_s\n when Symbol then other == symbol\n else super\n end\n end",
"def ==(other)\n other.kind_of?(VariableValue) && other.name == @name\n end",
"def eq(value)\n @ole.EQ = value\n nil\n end",
"def eql?(value)\n value = value.value if value.is_a?(HostName)\n @value.eql?(value)\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n attribute == o.attribute &&\n statistics == o.statistics &&\n other == o.other &&\n total == o.total &&\n missing == o.missing &&\n term_count == o.term_count &&\n term_type == o.term_type &&\n terms == o.terms\n end",
"def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end",
"def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end",
"def eql?(other)\n self.class == other.class && value == other.value &&\n position == other.position\n end",
"def ==(val)\n if val.is_a?(PasswordHashed)\n return val.hashed_value == self.hashed_value\n end\n return Translations.pass_hash_check(@value, val)\n end",
"def eql?(ct); end",
"def eql?(ct); end",
"def ==(other)\n case other\n when Literal\n # If other is a Literal, reverse test to consolodate complex type checking logic\n other == self\n when String then to_s == other\n when URI then hash == other.hash && to_s == other.to_s\n else other.respond_to?(:to_uri) && to_s == other.to_uri.to_s\n end\n end",
"def call(value)\n klass = value.class\n\n unless allowed_classes.any?(&klass.method(:equal?))\n fail TypeError, FORMAT_ERROR % {\n name: name,\n got: klass,\n allowed: allowed_classes.join(CLASS_DELIM)\n }\n end\n\n value\n end",
"def =~(other)\n case other\n when VectorType then equalish_vec4(other)\n when Numeric then equalish_scalar(other)\n else false\n end\n end",
"def eql?(other)\n self.class == other.class && value == other.value &&\n colour == other.colour && style == other.style &&\n parent == other.parent\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n authentication_type == o.authentication_type &&\n community_name == o.community_name &&\n database == o.database &&\n domain == o.domain &&\n enumerate_sids == o.enumerate_sids &&\n notes_id_password == o.notes_id_password &&\n ntlm_hash == o.ntlm_hash &&\n oracle_listener_password == o.oracle_listener_password &&\n password == o.password &&\n pem_key == o.pem_key &&\n permission_elevation == o.permission_elevation &&\n permission_elevation_password == o.permission_elevation_password &&\n permission_elevation_username == o.permission_elevation_username &&\n privacy_password == o.privacy_password &&\n privacy_type == o.privacy_type &&\n private_key_password == o.private_key_password &&\n realm == o.realm &&\n service == o.service &&\n sid == o.sid &&\n use_windows_authentication == o.use_windows_authentication &&\n username == o.username\n end",
"def ==(other)\n if other.is_a?(Numeric)\n id == other\n elsif other.is_a?(String)\n send( self.class.unique_string_field ).to_s.downcase == other.downcase\n elsif other.is_a?(Symbol)\n [\n other.to_s.downcase,\n other.to_s.humanize.downcase\n ].include?(send( self.class.unique_string_field ).to_s.downcase)\n elsif other.is_a?(self.class)\n id == other.id\n else\n other = self.class.get(other)\n other && id == other.id\n end\n end",
"def like?(other)\n if other.respond_to?(:simplified)\n @simplified == other.simplified\n else\n @simplified == Type.simplified(other)\n end\n end"
] |
[
"0.7007334",
"0.68083614",
"0.68060935",
"0.66837996",
"0.66837996",
"0.6635635",
"0.65501004",
"0.65494704",
"0.65494704",
"0.65244997",
"0.64447963",
"0.64447963",
"0.6436345",
"0.63421685",
"0.62802905",
"0.61758935",
"0.615237",
"0.6136742",
"0.61274606",
"0.61264235",
"0.6113748",
"0.6088514",
"0.6072682",
"0.60528135",
"0.6049095",
"0.60440177",
"0.60350645",
"0.5980417",
"0.59415305",
"0.592581",
"0.591922",
"0.591922",
"0.591922",
"0.5912923",
"0.5902652",
"0.58807445",
"0.58722615",
"0.5859023",
"0.58337355",
"0.5826526",
"0.58181083",
"0.58172154",
"0.58172154",
"0.58121",
"0.5811686",
"0.5811686",
"0.58107066",
"0.57916486",
"0.5776641",
"0.5776641",
"0.57751167",
"0.57751167",
"0.57680607",
"0.57497877",
"0.5736438",
"0.57338357",
"0.5733751",
"0.57316375",
"0.5730103",
"0.57129353",
"0.57107866",
"0.5709972",
"0.57075036",
"0.57004565",
"0.5695675",
"0.5694928",
"0.56934416",
"0.5687534",
"0.56727254",
"0.5668158",
"0.5664746",
"0.56600374",
"0.56506735",
"0.5649328",
"0.56473815",
"0.56453604",
"0.56410587",
"0.56403154",
"0.5639726",
"0.56328773",
"0.56328773",
"0.56328773",
"0.56212294",
"0.5620117",
"0.56191295",
"0.56183845",
"0.5618324",
"0.5611837",
"0.5611837",
"0.5611837",
"0.5609141",
"0.56079346",
"0.56079346",
"0.56006646",
"0.5596476",
"0.55940396",
"0.5591713",
"0.55907947",
"0.5588773",
"0.5584165"
] |
0.5692666
|
67
|
Helper to return value wrapped in Sensitive type.
|
def sensitive(value)
RSpec::Puppet::Sensitive.new(value)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def serialize(value)\n # expects same behavior as ActiveRecord::Type::String other than encryption\n # https://github.com/rails/rails/blob/5-0-stable/activemodel/lib/active_model/type/immutable_string.rb\n v = super(value)\n v.present? ? encryptor.encrypt_and_sign(v) : v\n end",
"def security_type\n SecurityType.find_by_type self[:type]\n end",
"def set_sensitive\n @sensitive = Sensitive.find(params[:id])\n end",
"def simple_value_type_code\n value_type_code\nend",
"def value_field\n \"string\"\n end",
"def serialize_allowed_value(v)\n { String => \"string\",\n Fixnum => \"integer\" }[v] || v\n end",
"def value\n if self[:value_type].present?\n case self[:value_type].to_sym\n when :string, :text\n self[:value].to_s\n when :password\n self[:value].to_s\n when :decimal\n BigDecimal.new(self[:value].to_s).round(2, BigDecimal::ROUND_HALF_UP)\n when :integer\n self[:value].to_i\n when :boolean\n (self[:value].to_s =~ /^[t|1]/i) != nil\n else\n self[:value].is_a?(String) ? YAML.load(self[:value]) : self[:value]\n end\n else\n self[:value]\n end\n end",
"def specialty\n if object.field == \"vocalist\"\n object.vocal\n else\n object.instrumental\n end\n end",
"def deserialize(value)\n # expects same behavior as ActiveRecord::Type::String other than decryption\n # https://github.com/rails/rails/blob/5-0-stable/activemodel/lib/active_model/type/value.rb#L21-L23\n v = super(value)\n v.present? ? encryptor.decrypt_and_verify(v) : v\n end",
"def secret_type\n return @secret_type\n end",
"def sid_type=(stype)\n if stype.is_a?(String)\n @sid_type = stype.downcase\n else\n case stype\n when Admin::SidTypeUser\n @sid_type = 'user'\n when Admin::SidTypeGroup\n @sid_type = 'group'\n when Admin::SidTypeDomain\n @sid_type = 'domain'\n when Admin::SidTypeAlias\n @sid_type = 'alias'\n when Admin::SidTypeWellKnownGroup\n @sid_type = 'well_known_group'\n when Admin::SidTypeDeletedAccount\n @sid_type = 'deleted_account'\n when Admin::SidTypeInvalid\n @sid_type = 'invalid'\n when Admin::SidTypeUnknown\n @sid_type = 'unknown'\n when Admin::SidTypeComputer\n @sid_type = 'computer'\n else\n @sid_type = 'not_found'\n end\n end\n end",
"def type\n self.class.to_s.downcase\n end",
"def digest_type(type, var) #method\n if type == 'nocortable'\n 'Fixnum'\n elsif type == 'estado'\n var.downcase!\n if var == 'verdadero'\n 'TrueClass'\n elsif var == 'falso'\n 'FalseClass'\n end\n else\n type\n end\n end",
"def indifferent_value(value)\n value\n end",
"def simplified_type(field_type)\r\n return :boolean if field_type =~ /logical/i\r\n return :string if field_type =~ /varchar/i\r\n return :binary if field_type =~ /long binary/i\r\n return :datetime if field_type =~ /timestamp/i\r\n return :integer if field_type =~ /short|integer/i\r\n return :integer if field_type =~ /autoinc/i\r\n super\r\n end",
"def only_basic_type(key)\n BasicTypes[key.camelcase(:lower)]\n end",
"def protection_type\n @descriptive_detail.protection_type\n end",
"def security_type_label\n self.security_type.label.titleize\n end",
"def raw_value; end",
"def password_require_mixed\n @attributes[:password_require_mixed]\n end",
"def sanitize_case(value, kase)\n return value if value.nil?\n\n if kase == :camelcase\n value.camelcase(:lower)\n elsif kase == :pascalcase\n value.camelcase(:upper)\n else\n value.send(kase)\n end\n end",
"def value?(value) value.is_a?(String) end",
"def nonregular_type; end",
"def value\n if show_secret\n secret\n else\n Digest::SHA1.hexdigest secret\n end\n end",
"def is_to_s(currentvalue)\n provider.id2name(currentvalue) || currentvalue\n end",
"def for_database_key\n self.without_type\n end",
"def sanitise_string(value, snake_case_keys=false)\n # *disabled* return lower camel case formatted strings\n # return value.to_sym if value =~ /^[a-z]+[A-Z0-9][a-z0-9]+[A-Za-z0-9]*$/\n # remove '$' as prefixes, etc, e.g., $schema and $ref\n str = value.gsub(/[^a-zA-Z0-9_-]/, '')\n # convert to snake case where required\n str = str.underscore if snake_case_keys\n # convert to symbol\n str.to_sym\n end",
"def value=(new_value)\n return nil if readonly?\n @value = send(\"sanitize_#{options[:type]}\", new_value)\n end",
"def typecast(value)\n return value if type === value || (value.nil? && type != TrueClass)\n\n if type == TrueClass then %w[ true 1 t ].include?(value.to_s.downcase)\n elsif type == String then value.to_s\n elsif type == Float then value.to_f\n elsif type == Fixnum then value.to_i\n elsif type == BigDecimal then BigDecimal(value.to_s)\n elsif type == DateTime then DateTime.parse(value.to_s)\n elsif type == Date then Date.parse(value.to_s)\n elsif type == Class then find_const(value)\n end\n end",
"def to_sanitize\n Sanitize.new(to_hash)\n end",
"def secret_type=(value)\n @secret_type = value\n end",
"def protect_type( type )\n self.permissions['protected_types'] << type.to_s\n end",
"def to_s\n sanitized.to_s\n end",
"def user_type; end",
"def ruby_type_of(value, dry_sum_type)\n json_type_of_value = Types.json_type(value.class)\n\n walk_dry_sum(dry_sum_type) do |type|\n return type if json_type_of_value == Types.json_type(type.primitive)\n end\n end",
"def raw_value\n to_s\n end",
"def yale?; return stype == :yale; end",
"def type\n return constant_value_type\n end",
"def string_value(value)\r\n value\r\n end",
"def value_in_class(clazz) value end",
"def lenient_value_coercions; end",
"def kase_type\n kase_class.kind if kase_class\n end",
"def kase_type\n kase_class.kind if kase_class\n end",
"def sti_type\n self.type\n end",
"def result_value_of(declared_type, value)\n if value.is_a?(::Amalgalite::Blob)\n SQL::Blob.new(value.to_s)\n elsif value.is_a?(String) && declared_type\n (meth = self.class.sql_to_method(declared_type.downcase)) ? send(meth, value) : value\n else\n super\n end\n end",
"def sid_type=(stype)\n case stype\n when Admin::SidTypeUser\n @sid_type = 'user'\n when Admin::SidTypeGroup\n @sid_type = 'group'\n when Admin::SidTypeDomain\n @sid_type = 'domain'\n when Admin::SidTypeAlias\n @sid_type = 'alias'\n when Admin::SidTypeWellKnownGroup\n @sid_type = 'well_known_group'\n when Admin::SidTypeDeletedAccount\n @sid_type = 'deleted_account'\n when Admin::SidTypeInvalid\n @sid_type = 'invalid'\n when Admin::SidTypeUnknown\n @sid_type = 'unknown'\n when Admin::SidTypeComputer\n @sid_type = 'computer'\n else\n @sid_type = 'not_found'\n end\n end",
"def xlate_authen_type()\n return AUTHEN_TYPE_XLATES[@authen_type] if (AUTHEN_TYPE_XLATES.has_key?(@authen_type))\n return(@authen_type.to_s) \n end",
"def is_to_s(currentvalue)\n provider.uid2name(currentvalue) || currentvalue\n end",
"def friendly_secret\n self.class.friendly_secret(length)\n end",
"def typecast_to_primitive(value)\n DataMapper::Ext::Module.find_const(model, value.to_s)\n rescue NameError\n value\n end",
"def value_type= value_type\n self.type = value_type.gsub(\"-\", \"_\").camelize\n end",
"def user_type\n params[:user_type].downcase\n end",
"def signed_or_encrypted; end",
"def type *val\n return @chars_allowed if val.empty?\n\n dtype = val[0]\n #return self if @chars_allowed # disallow changing\n if dtype.is_a? Regexp \n @chars_allowed = dtype\n return self\n end\n dtype = dtype.to_s.downcase.to_sym if dtype.is_a? String\n case dtype # missing to_sym would have always failed due to to_s 2011-09-30 1.3.1\n when :integer, Integer\n @chars_allowed = /\\d/\n when :numeric, :float, Numeric, Float\n @chars_allowed = /[\\d\\.]/ \n when :alpha\n @chars_allowed = /[a-zA-Z]/ \n when :alnum\n @chars_allowed = /[a-zA-Z0-9]/ \n else\n raise ArgumentError, \"Field type: invalid datatype specified. Use :integer, :numeric, :float, :alpha, :alnum \"\n end\n self\n end",
"def set_type\n case @type\n when :password\n I18n.t('hidden_password')\n when :currency\n formatted_value_currency(@value)\n when :breakable\n formatted_value_breakable(@value, @break_character)\n else\n # Other types can be autodetected\n formatted_value_other(@value, @type)\n end\n end",
"def make_valuestring\n\t\treturn self.value\n\tend",
"def snat_type\n super\n end",
"def sti_class(v)\n case v\n when String, Symbol\n constantize(v) rescue self\n when nil\n self\n when Class\n v\n else\n raise(Error, \"Invalid class type used: #{v.inspect}\")\n end\n end",
"def allowed_types\n [SearchString, User]\nend",
"def value\n to_type(@value)\n end",
"def simplified_type(field_type)\n case field_type\n when /tsvector/i\n :text\n when /regprocedure/i\n :string\n else\n simplified_type_base(field_type)\n end\n end",
"def authenticatable_salt\n read_attribute(:authenticatable_salt)\n end",
"def normalize_encrypted(_value)\n nil\n end",
"def prepare_value(value)\n return value if value.nil? || value.is_a?(String)\n\n value.to_s\n end",
"def get_string_value\n\t\tend",
"def serialize_value(value)\r\n value\r\n end",
"def raw_value\n @value\n end",
"def to_sym?(value); end",
"def coerce(value, field_name)\n type = self.class.attributes[field_name]\n case type\n when :boolean\n case\n when (value.kind_of? TrueClass or value.kind_of? FalseClass); then value\n when value == \"true\"; then true\n when (value || '').match(/no|false/); then false # For Overview\n else; value\n end\n when :number\n case\n when value.kind_of?(Numeric); then value\n when value =~ /\\A[+-]?\\d+\\Z/; then value.to_i\n when value =~ /\\A[+-]?\\d+\\.\\d+\\Z/; then value.to_f\n else; value\n end\n when :string\n value.to_s unless value.nil?\n else\n raise ArgumentError, \"#{type} isn't supported as a configuration key type.\"\n end\n end",
"def user_type(t_obj, value)\n t_obj.receiver_type = \"Student\" if value.downcase == \"s\"\n t_obj.receiver_type = \"Employee\" if value.downcase == \"e\"\n end",
"def to_citrus # :nodoc:\n if case_sensitive?\n @string.inspect\n else\n @string.inspect.gsub(/^\"|\"$/, '`')\n end\n end",
"def literal_value(param)\n case param[:type]\n when \"integer\", \"decimal\", \"boolean\"\n param[:value][:value]\n else\n \"\\\"#{param[:value][:value]}\\\"\"\n end\n end",
"def enforce_type(key, value)\n ensure_apply_object_class\n # Enforce attribute value formatting\n normalize_attribute(key, value)[1]\n end",
"def sti_type_to_s\n I18n.t(\"sti_types.#{self.sti_type.downcase}\")\n end",
"def sanitize(s, level=:relaxed)\n Sanitize.clean(s, DC::Sanitizer::LEVELS[ level ] )\n end",
"def quote_class(value)\n quote_string(value.name)\n end",
"def encoded_value\n case value_type\n when \"Array\", \"Hash\" then value.to_json\n when \"Boolean\" then value.to_s == \"true\" ? \"true\" : \"false\"\n else value.to_s\n end\n end",
"def swapcase\n s = self.dup\n s.swapcase!\n # s.taint if self.tainted?\n s\n end",
"def sanitize(object) #:nodoc:\n quote_value(object)\n end",
"def user_type\n # if self.is_vendor\n # \"vendor\"\n # else\n # \"customer\"\n # end\n\n self.is_vendor ? 'vendor' : 'customer'\n end",
"def clean_value(value)\n # value.is_a?(String) ? value.strip.gsub(/\\A\"|\"\\Z/, '') : value\n value\n end",
"def value_type\n @type.value_type\n end",
"def simplify\n super\n return @x.x if @x.is_a? CAS::Atan\n return self.simplify_dictionary\n end",
"def only_with_a_string(value)\r\n if value.is_a?(String)\r\n yield(value)\r\n return self\r\n else\r\n raise ArgumentError, 'only string values are accepted'\r\n end\r\n end",
"def expect_string name, value\n expect_type name,\n value, \n \"string\",\n String\n end",
"def authenticatable_salt; end",
"def canonic_type\n t = type.to_s.downcase.to_sym\n CANONIC_TYPES[ t ] || t\n end",
"def getEnrollmentType(s)\r\n# //The enrollment type. One of 'StudentEnrollment', 'TeacherEnrollment',\r\n# //'TaEnrollment', 'DesignerEnrollment', 'ObserverEnrollment'.\r\n# \"type\": \"StudentEnrollment\",\r\n\ttype = \"\"\r\n\tcase s[\"type\"]\r\n\twhen \"StudentEnrollment\"\r\n\t type = \"student\"\r\n\twhen \"TeacherEnrollment\"\r\n\t type = \"teacher\"\r\n\tend\r\n\treturn type\r\nend",
"def getEnrollmentType(s)\r\n# //The enrollment type. One of 'StudentEnrollment', 'TeacherEnrollment',\r\n# //'TaEnrollment', 'DesignerEnrollment', 'ObserverEnrollment'.\r\n# \"type\": \"StudentEnrollment\",\r\n\ttype = \"\"\r\n\tcase s[\"type\"]\r\n\twhen \"StudentEnrollment\"\r\n\t type = \"student\"\r\n\twhen \"TeacherEnrollment\"\r\n\t type = \"teacher\"\r\n\tend\r\n\treturn type\r\nend",
"def typecast(value)\n value\n end",
"def get_value(value) #method\n if is_memory(value)\n @current_context[value]\n else\n digested_value = digest_constant(value)\n if is_number(digested_value)\n get_type(digested_value)\n elsif is_bool(digested_value)\n get_type(digested_value)\n else\n digested_value\n end\n end\n end",
"def type_helper \n self.type \n end",
"def attr_get_sb1(attr_type, strict = true)\n #This is a stub, used for indexing\n end",
"def type_cast_for_solr(value, dest_type = nil)\n return nil if value.nil?\n return coder.dump(value) if encoded?\n\n case (dest_type || type)\n when :boolean then value ? 'true' : 'false'\n when :date, :time, :datetime, :timestamp then value.to_time.utc.strftime(Format::SOLR_TIME_FORMAT)\n when :list, :set then list_to_solr_value(value)\n when :map then map_to_solr_value(value)\n when :uuid, :timeuuid then value.to_s\n else value\n end\n end",
"def case_sensitive?\n true\n end",
"def possessify\n return \"#{self}'\" if self =~ /s$/\n return \"#{self}'s\"\n end",
"def authenticatable_salt\n end",
"def type(key); end",
"def type(key); end",
"def authen_type=(val)\n if (val.kind_of?(Integer))\n @authen_type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @authen_type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end"
] |
[
"0.6045922",
"0.5658334",
"0.542132",
"0.5413805",
"0.5369554",
"0.53265435",
"0.5323478",
"0.5323209",
"0.5275717",
"0.52063715",
"0.5171681",
"0.5109026",
"0.50969106",
"0.50938916",
"0.5082484",
"0.50803465",
"0.50617754",
"0.5057589",
"0.5050582",
"0.5043511",
"0.5036802",
"0.5031422",
"0.5015205",
"0.4992267",
"0.49864665",
"0.4980553",
"0.49787125",
"0.49685174",
"0.49654314",
"0.49586484",
"0.4957611",
"0.49435392",
"0.49420536",
"0.49347532",
"0.49255183",
"0.4922917",
"0.49210548",
"0.4909432",
"0.4886036",
"0.4884485",
"0.48794255",
"0.4876528",
"0.4876528",
"0.48699602",
"0.4865719",
"0.48502418",
"0.48490962",
"0.4845908",
"0.48377192",
"0.4832416",
"0.48214075",
"0.48165324",
"0.4813186",
"0.48074263",
"0.4797883",
"0.47844744",
"0.47838074",
"0.47750735",
"0.47740966",
"0.47704035",
"0.47702965",
"0.4770256",
"0.4769755",
"0.47690073",
"0.47648525",
"0.47609624",
"0.475881",
"0.47583154",
"0.4751731",
"0.47485104",
"0.4745611",
"0.47425637",
"0.4741872",
"0.47376093",
"0.47330162",
"0.47317794",
"0.4731021",
"0.4724858",
"0.47199762",
"0.47145432",
"0.4708998",
"0.47069627",
"0.4701275",
"0.46937284",
"0.46934962",
"0.46909282",
"0.46876767",
"0.46848232",
"0.46848232",
"0.4677898",
"0.46744016",
"0.46663493",
"0.46657762",
"0.4660882",
"0.4659805",
"0.46562296",
"0.46558255",
"0.4654104",
"0.4654104",
"0.465136"
] |
0.54983246
|
2
|
before_filter :is_logged_in, :only => [ :login ] before_filter :service_access Generate New User form
|
def new
@user = User.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n #user wants to log in \n end",
"def new\n #user wants to log in \n end",
"def login_filter\n\t\tif not protect?( action_name )\n\t\t\treturn true \n\t\tend\n\n\t\tif not session[:user_id]\n\t\t\t# user isn't logged in\n\t\t\tstore_location\n\t\t\tredirect_to :controller=>\"account\", :action=>\"login\"\n\t\t\treturn false\n\t\tend\n\n\t\t# initialize the @user variable\n\t\t@user = User.find( session[:user_id] )\n\t\t\n\t\tif not @user.validated?\n\t\t\t# user is logged in, but they haven't been validated\n\t\t\tredirect_to :controller=>\"account\", :action=>\"not_activated\"\n\t\t\treturn false\n\t\telsif not authorized?( @user, action_name )\n\t\t\t# user is logged in and validated, but not authorized\n\t\t\tredirect_to :controller=>\"account\", :action =>\"denied\"\n\t\t\treturn false\n\t\telse\n\t\t\t# user is logged in AND validated AND authorized! let 'em in!\n\t\t\treturn true\t\n\t\tend\n\n\t\t# we shouldn't get here\n\t\traise \"Serious malfunction in 'login_filter' -- please contact manufacturer (cgahan@ideeinc.com)...\"\n\tend",
"def signed_in_user_filter\n if signed_in?\n redirect_to root_path, notice: \"Already logged in\"\n end\n end",
"def logged_in\r\n end",
"def run_filters\n set_user\n authorize\n end",
"def login\n\t#Login Form\n end",
"def before_filter\n if current_user\n true\n end\n end",
"def login\n # show LOGIN form\n\n end",
"def login_required\n if params[:create_user] # hidden field in posted form. Create the user.\n user = User.new\n user.last_login = request.remote_ip\n if user.save && user.errors.empty?\n self.current_user = user # !! now logged in\n else\n flash[:error] = \"I am sorry. the system could not create a new account for you.\"\n access_denied\n end\n elsif authorized?\n return true\n else\n access_denied\n end\n end",
"def before_filter; end",
"def new\n # If someone is already logged in, skip this step\n login(current_user) and return if logged_in?\n end",
"def login_form\n @user = User.new\n end",
"def login_page\n end",
"def adm_login_form\n render 'adm_login'\n end",
"def loginpage\n end",
"def user_authentication\n end",
"def create_user\n \tunless @user\n \t\tflash[:notice_login] = \"Incorrect password or username.\"\n \t return render action: 'new_user'\n \tend\n \tsession[:comedian_id] = nil\n \tsession[:user_id] = @user.id\n\n \tflash[:notice_login] = 'Signed in!'\n \tredirect_to root_path\n end",
"def new #login page\n end",
"def create\n user = User.find_by(username: params[:session][:username])\n\n if user && user.authenticate(params[:session][:password])\n # Log the user in\n log_in user\n user.update_attribute(:is_login, true)\n redirect_to index_path\n else\n # Using render in case any error flash message is to shown in future. \n render 'new'\n end # END IF-ELSE login\n end",
"def login_check\n if session[:user_id].present?\n unless (controller_name == \"user\") and [\"first_login_change_password\",\"login\",\"logout\",\"forgot_password\"].include? action_name\n user = User.active.find(session[:user_id])\n \n \n end\n end\n end",
"def log_in\n end",
"def login\n\tend",
"def create\n if user = User.Authenticate(params[:login][:email], params[:login][:password])\n # Save the user ID in the session so it can be used in\n # subsequent requests\n session[:current_user_id] = user.id\n redirect_to root_url\n else\n \tflash[:error] = \"Email ou senha incorreto.\"\n \trender :index\n end\n end",
"def authorise\n unless User.find_by_id(session[:user_id]) || (self.controller_name == 'users' && (self.action_name == 'new' || self.action_name == 'create'))\n session[:original_uri] = request.request_uri\n flash[:notice] = \"Please login!\"\n redirect_to login_url\n end\n end",
"def user_access_create\n check_user_access(params[:user_id])\n end",
"def user_access_create\n check_user_access(params[:user_id])\n end",
"def new\n\tif(filters)\n\t\t#Revisamos que no haya iniciado sesion\n\t\tif(session[:user_id])\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\tend\n \n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def create\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n\n @user = User.new(params[:user])\n if @user.save\n redirect_to :action => 'index'\n else\n render 'new'\n end\n #Make sure only non-logged in users can register\n elsif ! @loggedinuser\n #Register a new user from data provided by the form. If the save fails for\n #some reason, redirect back to the form so that errors can be corrected and tried again.\n @user = User.new(params[:user])\n\t@user.authorizationlevel=1\n if @user.save\n redirect_to '/welcome/login'\n else\n render 'register'\n end\n else \n redirect_to '/'\n end\n end",
"def create\n user = User.find_by(username: params[:session][:username])\n if (user && (!user.disabled? && user.authenticate(params[:session][:password]))) \n log_in user \n redirect_back_or active_jobs_path \n else \n flash.now[:danger] = \"Invalid Username/Password Combination\" \n render :new\n end\n end",
"def create\n if logged_in?\n # User who has logged in has no need to access create action\n redirect_to current_user\n else \n # Ready to create new user\n @user = User.new(params[:user])\n if @user.save\n # Handle a successful save.\n log_in @user\n flash[:success] = \"Welcome to the Sample App!\"\n redirect_to @user\n else\n \t# Render signup page\n render 'new'\n end\n end\n end",
"def login_required\n authenticate_user! \n end",
"def autologin_the_user\n #unless logged_in?\n # FrontendUserSession.create(params[:frontend_user_session])\n #end\n end",
"def login_check\n if not is_logged_in session\n # should never get in here\n redirect_to :action => :index\n end\n sunet = session[:user_hash][\"username\"]\n if User.find_by_sunet(sunet)\n redirect_to :action => :index\n else\n # create new user\n gn = session[:user_hash][\"gn\"] || \"\"\n sn = session[:user_hash][\"sn\"] || \"\"\n phone = session[:user_hash][\"phone_number\"] || \"\"\n major = session[:user_hash][\"org\"] || \"\"\n @user = User.new(:sunet => sunet, :first_name => gn.titlecase, :last_name => sn.titlecase, :bio => \"I dance for Basmati Raas!\", :is_alumni => false, :is_undergrad => true, :phone => phone, :major => major)\n @user.save\n flash[:notice] = \"Welcome! We started filling out your profile. Please upload a picture and update your information.\"\n redirect_to \"/users/#{@user.id}/edit\"\n end\n end",
"def login_check\n if not is_logged_in session\n # should never get in here\n redirect_to :action => :index\n end\n sunet = session[:user_hash][\"username\"]\n if User.find_by_sunet(sunet)\n redirect_to :action => :index\n else\n # create new user\n gn = session[:user_hash][\"gn\"] || \"\"\n sn = session[:user_hash][\"sn\"] || \"\"\n phone = session[:user_hash][\"phone_number\"] || \"\"\n major = session[:user_hash][\"org\"] || \"\"\n @user = User.new(:sunet => sunet, :first_name => gn.titlecase, :last_name => sn.titlecase, :bio => \"I dance for Basmati Raas!\", :is_alumni => false, :is_undergrad => true, :phone => phone, :major => major)\n @user.save\n flash[:notice] = \"Welcome! We started filling out your profile. Please upload a picture and update your information.\"\n redirect_to \"/users/#{@user.id}/edit\"\n end\n end",
"def create\n\tif(filters)\n\t#Revisamos que no haya iniciado sesion\n\t\tif(session[:user_id])\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\tend\n\t\n @user = User.new(params[:user])\n\n if !(@user.email.match(/\\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+\\z/))\n flash[:form_error] = \"El correo ingresado no tiene el formato adecuado\"\n\t\trespond_to do |format|\n\t\t\tformat.html { render action: \"new\" }\n\t\tend\n \treturn\n end\n\t\n\t#Revisamos que el mail no este ocupado por una cuenta activa\n\tif(User.exists?(:email => @user.email, :deleted => 0))\n\t\tflash[:form_error] = \"El correo ingresado ya fue inscrito\"\n\t\tredirect_to new_user_path\n\t\treturn\n\tend\n\t\n\t#Que la contrasena y la confirmacion sean iguales\n\tif !(params[:password] == params[:password_confirmation] and params[:password].length >= 6)\n\t\tflash[:form_error] = \"Error en la contrasena\"\n\t\trespond_to do |format|\n\t\t\tformat.html { render action: \"new\" }\n\t\tend\n\t\treturn\n\tend\n\t\n\t#Guardamos el hash\n\t@user.salt = SecureRandom.hex\n\t@hashed = params[:password] + @user.salt\n\t100.times do\n\t\t@hashed = Digest::SHA1.hexdigest(@hashed)\n\tend\n\t@user.hashed_password = @hashed\n\n\t#Seteamos los valores por defecto\n\t@user.deleted = 0\n\t@user.admin = false\n\t@user.session_token = \"\"\n\t#@user.last_login_date = Time.new.advance(:hours => -4)\n\t#@user.last_login_server = request.remote_ip\n\t#@user.last_login_server = \"desaweb1.ing.puc.cl\"\n\t\n\t#TODO: Aca enviar mail y setear active en false\n\t@user.active = false\n\t\n\t#if(request.env[\"HTTP_X_FORWARDED_FOR\"])\n\t#\t@user.last_login_server = request.env[\"HTTP_X_FORWARDED_FOR\"]\n\t#end\n\t@user.profile = \"<h2>#{@user.name} #{@user.lastname}</h2>\"\n\tif(User.all.count < 1)\n\t\t@user.admin = true\n\tend\n\n\t#Se guarda\n respond_to do |format|\n if @user.save\n\t\t\n\t\t@activation = EmailActivation.new\n\t\t@activation.user_id = @user.id\n\t\t@activation.token = SecureRandom.hex\n\t\t@activation.expires_at = DateTime.now + 2.days\n\t\t@activation.save\n\t\tUserMailer.welcome_email(@user,@activation).deliver\n\t\t\n\t\tflash[:succes] = \"Bienvenido a tareApp2 #{@user.name + \" \" + @user.lastname}, revise su email para activar su cuenta\"\n format.html { redirect_to home_path }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def login\n\n end",
"def login\n\n end",
"def create\n #this used to use params[:user] as the variable, but uses the more secure method\n #defined below in the private section (user_params)\n @user = User.new(user_params)\n if @user.save\n flash.now[:alert] = 'Welcome!'\n log_in(@user)\n redirect_to root_url\n else\n render 'new'\n end\n end",
"def logging_in\n \t\t\n \tend",
"def create\n @user = User.new(user_params)\n #set default privilege. anyone named sinjihn is an admin\n if(@user.first_name == \"sinjihn\")\n puts \"[USER_CONTROLLER] admin privileges accepted\"\n @user.update_attribute(:privilege, true)\n else \n @user.update_attribute(:privilege, false)\n end\n\n respond_to do |format|\n if @user.save #if succesfully saved to db\n puts \"[USER_CONTROLLER] user.save\" \n log_in @user\n format.html { redirect_to @user, success: 'User was successfully created. Automatically logged in' }\n format.json { render :show, status: :created, location: @user } #should render homepage\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n @main = @user.main\n authorize @user\n\n if @user.save\n sign_in(@user)\n redirect_to(@user)\n else\n render :new\n end\n end",
"def make_user_login\n #If you aren't logged in redirect to login page\n if !logged_in?\n redirect_to(:controller => 'sessions', :action => 'login')\n end\n end",
"def new_user\n \n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def login\n end",
"def index\n redirect_to(:action => 'login') and return unless logged_in?\n \n @user = current_user\n end",
"def index\n @user=Userlogindetail.new(params[:userlogindetail])\n currentuser=Userlogindetail.find_by_id(session[:user_id])\n @currentuser=currentuser\n respond_to do |format|\n format.html\n end\n \n end",
"def login\n end",
"def new\n\n if signed_in? && !isAdmin?\n sign_out\n redirect_to signup_url\n elsif signed_in? && isAdmin?\n redirect_to \"/new_prof\"\n end\n @title= \"Sign Up\"\n @user = User.new\n\n \n end",
"def login; end",
"def new\n \t@request=Request.new\n if !logged_in?\n flash[:danger]=\"Please login to access our services\"\n redirect_to root_url\n end\n end",
"def security\n if !logged_in?\n flash[:login_please] = \"Please Exist\"\n redirect_to login_path\n end\n end",
"def new\n render :new\n endl\n\n def create\n user = User.find_by_credentials(\n params[:user][:user_name],\n params[:user][:password]\n )\n\n if user.nil?\n flash.now[:errors] = [\"Invalid username or password\"]\n render :new\n else\n login!(user)\n redirect_to cats_url\n end\n end\n\n def destroy\n logout!\n redirect_to new_session_url\n end\n\nend",
"def authorize\n if(session[:userName]!='nil')\n unless User.find_by_userName(session[:userName])\n redirect_to(:controller => \"logins\" , :action => \"index\" )\n #if(params[:name]!='nil')\n #redirect_to(:controller => \"logins\", :action => \"index\")\n end\n end\n end",
"def login_instructions\n end",
"def login\n puts \"Usercontroller Login:\"\n puts \"params? #{params}\"\n respond_to do |format|\n if request.post?\n password_ok, active = false\n uname = params[:user][:user_name]\n @user = User.find(:first, :conditions =>[ \"user_name = ?\", uname])\n if @user then\n password_ok = @user.password_is? params[:user][:password]\n active = @user.active?\n end\n \n if password_ok and active\n @user.userdata.update_attribute(:last_login, Time.now.gmtime)\n @user.userdata.update_attribute(:password_faults, 0)\n session[:uid] = @user.id\n session[:time] = Time.now.gmtime.to_a.join(\";\")\n user_info \"Eingeloggt unter Nutzername: #{uname}\"\n if @user.is_admin? then\n format.html { redirect_to(users_url) }\n else\n #format.html { redirect_to(@settings[\"default_page\"])}\n format.html { redirect_to(:controller => 'ipnets', :action => 'index')}\n end\n else\n if !@user\n flash[:error] = 'Username oder Passwort falsch!'\n user_error \"Login-Versuch mit unbekanntem Nutzernamen: #{uname}\"\n return\n elsif !active\n flash[:error] = 'Account ist deaktiviert! Bitte wenden Sie sich an den Systemadministrator!'\n user_error \"Login-Versuch bei deaktiviertem Account! Nutzer: #{uname}\"\n return \n else\n increase_password_faults_and_eventually_deactivate(@user)\n flash[:error] = 'Username oder Passwort falsch!'\n user_error \"Falsches Passwort für User: #{@user.user_name}\"\n return\n end\n end\n else # request ist GET, Leerobjekt anlegen\n @user = User.new\n format.html\n end\n end\n end",
"def filter_user_is_registered\n unless( user_is_registered)\n redirect_to_login\n end\n end",
"def authenticate_user\n# save current page for redirection after login\n redirect_to controller: :user, action: :login unless logged_in? \n current_user\n end",
"def make_user\n end",
"def logged_in_user\n unless logged_in?\n redirect_to login_url\n end\n end",
"def create\n @user = User.new(user_params)\n if params[:commit] == 'Client'\n @user.toggle(:is_client)\n elsif params[:commit] == 'Counselor'\n @user.is_client = false\n end \n\n if @user.save\n log_in @user\n session[:user_id] = @user.id\n flash[:success] = \"Welcome to Openly! Please visit your Account section to complete your profile.\"\n redirect_to @user\n else\n render 'new'\n end\n end",
"def login_user\n do_request builder.build_login_user\n end",
"def logged_user_only\n unless logged_in?\n\t store_location\n\t flash[:danger] = \"Please log in!\"\n\t redirect_to login_url\n\t end\n end",
"def create\n params.permit!\t\n @user = User.new(params[:user], params[:password])\n if params[:login]\n redirect_to(:action => \"login\")\n elsif params[:add_user]\n redirect_to(:action => \"add\") \n end\n# if @user.save\n# redirect_to(:action => \"add\")\n# end\n end",
"def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end",
"def logged_in_user\n \t\tunless logged_in?\n \t\t\tflash[:error] = \"You must be logged in\"\n \t\tredirect_to login_path\n \t\tend\n \tend",
"def login_required\n not_authorized unless current_user\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n flash[:success] = \"welcome to croakr!\"\n log_in @user\n redirect_to @user\n else\n render 'new'\n end\n end",
"def index\n redirect_to(:action => 'login') #unless logged_in? || User.count > 0\n end",
"def new_user\n \trender action: 'new_user'\n end",
"def new\n if logged_in?\n # User who has logged in has no need to access create action\n redirect_to current_user\n else\n # Get ready to display signup page by declaring instance var\n \t @user = User.new\n end\n end",
"def login \n @user = User.new\n @current_uri = request.env['PATH_INFO']\n render \"users/new\", :layout => \"signup_login\"\n end",
"def logged_user_only\n unless logged_in?\n\t store_location\n\t flash[:danger] = \"Please log in!\"\n\t redirect_to login_url\n\tend\n end",
"def collect_user_info(get_password=true, \n first_time=false,\n third_party=false,\n need_email=true)\n\n values = {\n \"form_target\" => url(:handle_collect_user_info, \n get_password, \n third_party,\n need_email),\n \"user_affiliate_opts\" => Affiliate.options,\n \"first_time\" => first_time,\n \"third_party\" => third_party\n }\n\n \n @data.user.add_to_hash(values)\n\n standard_page(\"Create New User\",\n values,\n Login::EDIT_USER)\n end",
"def require_login\n end",
"def authorize\n unless User.find_by_id(session[:user_id]) or User.count == 0\n session[:original_uri] = request.request_uri\n flash[:notice] = \"Please log in.\" \n redirect_to(:controller=>\"admin\", :action=>\"login\")\n end\n if User.count == 0 \n if request.path_parameters[:action]==\"add_user\" and request.path_parameters[:controller]==\"login\" \n #As we are already on our way to the add_user action, do nothing here.\n else\n flash[:notice] = \"Please create an account.\" \n redirect_to(:controller=>\"login\", :action=>\"add_user\")\n end\n end\n end",
"def create_user\n @user = User.find(session[:user_id])\n redirect_to(root_url) unless current_user?(@user) || current_user.admin?\n end",
"def create?\n #everyone who is loggedin can do this action\n true\n end",
"def create\n \t@user = User.new(user_params) \n \tif @user.save\n \t\t log_in @user\n flash[:success] = \"Prof-Folio welcomes you onboard!\"\n redirect_back_or\n #redirect_to @user\n \telse\n \t\trender 'new'\n \tend\n end",
"def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\tsession[:user_id] = @user.id\n\t\t\t# line above automatically logs in when user created successfully\n\t\t\tredirect_to cuisine_types_path \n\t\telse\n\t\t\trender :new\n\t\tend\n\tend",
"def authorize_user\n unless current_user\n flash[:notice] = \"Sorry, you need to be logged in to access that feature\"\n redirect_to new_session_path\n end\n end",
"def login\r\n if request.get?\r\n # Logout user\r\n self.logged_in_user = nil\r\n else\r\n # Authenticate user\r\n user = User.try_to_login(params[:login], params[:password])\r\n if user\r\n self.logged_in_user = user\r\n # user.update_attribute(:ip_last, request.remote_ip)\r\n journal(\"log_in\",user.id)\r\n # generate a key and set cookie if autologin\r\n if params[:autologin] && Setting.autologin?\r\n token = Token.create(:user => user, :action => 'autologin')\r\n cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }\r\n end\r\n puts \"aqui\"\r\n if user.show? \r\n puts \"1\"\r\n redirect_back_or_default :controller => 'my', :action => 'athletes'\r\n else \r\n puts \"2\" \r\n redirect_back_or_default :controller => 'my', :action => 'page'\r\n end\r\n else\r\n # if user.locked?\r\n # flash.now[:notice] = l(:status_locked)\r\n # else\r\n flash.now[:notice] = l(:notice_account_invalid_creditentials)\r\n # end\r\n journal(\"invalid-\"+params[:login]+\"-\"+params[:password],0)\r\n end\r\n end\r\n end",
"def logged_in_user\n unless logged_in?\n redirect_to '/login'\n end\n end",
"def login\n # render :login\n end",
"def index\n return render_logged_in if logged_in?\n return redirect_to_signup_flow_entry_point if connected? && !feature_enabled?('onboarding.create_profile_modal')\n render_logged_out\n end",
"def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end",
"def log_web_user_in\n # Remeber to set :js => true\n user = create_factory_user\n\n # Signin\n visit root_path\n page.find('.sign-in').trigger(:mouseover)\n fill_in \"user_email\", :with => user.email\n fill_in \"user_password\", :with => user.password\n click_button \"hit it\"\n\n # Disable the tutorial screen\n no_tutorial\n\n # Make sure you're logged in\n page.should have_content(\"Here are the people\")\n page.should have_content(\"add new contact\")\n\n return user\n end",
"def login_as\n @page_title = _('Login_as')\n @page_icon = 'key.png'\n\n\n @users = User.select(\"*, #{SqlExport.nice_user_sql}\").where(hidden: 0).order(\"nice_user ASC\")\n\n end",
"def authorize\n unless User.find_by_userName(session[:userName])\n flash[:notice] = \"Please log in\"\n redirect_to(:controller => \"logins\" , :action => \"index\" )\n end\n end",
"def create\n @user = User.new(user_params)\n respond_to do |format|\n if @user.save\n format.html { log_in(@user,notice: \"User was created successfully\")}\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def authorized\n redirect_to \"/login\" unless logged_in? \n end",
"def create\n user=ApiM8::Client::Account::Users.instance.login(params[:login], params[:password])\n puts user.current_user\n\n if user\n session[:current_user_id]=user.id\n redirect_to role_super_admin_dashboards_url, :notice => \"Logged in as #{params[:login]}!\"\n else\n flash[:danger] = 'Invalid email/password combination' # Not quite right!\n render \"new\"\n end\n\n\n end",
"def index\n redirect_to(:action => 'login') unless logged_in? \n end"
] |
[
"0.6799184",
"0.6799184",
"0.679115",
"0.6691876",
"0.65706986",
"0.6506864",
"0.6455333",
"0.64454085",
"0.6418236",
"0.6380623",
"0.6376366",
"0.6362515",
"0.6330301",
"0.63251907",
"0.6303485",
"0.6290494",
"0.6268363",
"0.6265933",
"0.6248299",
"0.62462926",
"0.6227918",
"0.6226769",
"0.6226367",
"0.62248176",
"0.62238926",
"0.6218837",
"0.6218837",
"0.6208702",
"0.62062246",
"0.619465",
"0.6190272",
"0.6184546",
"0.61843497",
"0.6182645",
"0.6182645",
"0.61785674",
"0.6177224",
"0.6177224",
"0.6154895",
"0.61508286",
"0.61495656",
"0.61478764",
"0.6145031",
"0.6142917",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.61285526",
"0.6114982",
"0.6105742",
"0.60886097",
"0.60881066",
"0.608406",
"0.60832775",
"0.60783494",
"0.6078207",
"0.60718435",
"0.6062763",
"0.60590947",
"0.60459006",
"0.6044158",
"0.60415775",
"0.6039091",
"0.60359216",
"0.6030025",
"0.60255474",
"0.6020024",
"0.60185343",
"0.60178196",
"0.6014755",
"0.6013983",
"0.60054594",
"0.6000853",
"0.5999244",
"0.59886134",
"0.5986959",
"0.5979607",
"0.59788275",
"0.59690267",
"0.5967669",
"0.5967349",
"0.5966758",
"0.59637237",
"0.59589076",
"0.59582925",
"0.59573364",
"0.5950769",
"0.59500784",
"0.59455633",
"0.5942658",
"0.5940709",
"0.5939577",
"0.59365344",
"0.5934038",
"0.5924375",
"0.5922358"
] |
0.0
|
-1
|
Generate Form for changing Password
|
def change_password
@user = User.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def edit_password; end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def password_change_new\n\n end",
"def change_password\r\n \r\n end",
"def change_password(old_password, new_password)\n old_password_tb.type_text(old_password)\n new_password_tb.type_text(new_password)\n password_confirm_tb.type_text(new_password)\n change_pw_btn.click\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_password_field(password)\n end",
"def password\n @controls.password_field.text\n end",
"def input_password(f, value)\n\t\trender :partial => \"shared/forms/panel/password\", :locals => { :f => f, :value => value }\n\tend",
"def password_changed_confirm\n pw_change_confirm.click\n end",
"def password_field; end",
"def password=(new_password); end",
"def password\n\n end",
"def password_input \n\t\t@browser.text_field(id: @password)\n\tend",
"def input_password(label, name, args = {})\n # The ID can come from 2 places, id_for and the args hash\n id = args[:id] ? args[:id] : id_for(name)\n args = args.merge(:type => :password, :name => name, :id => id)\n \n if !args[:value] and @form_values.respond_to?(name)\n args[:value] = @form_values.send(name)\n end\n \n @g.p do\n label_for(id, label, name)\n @g.input(args)\n end\n end",
"def change_password\n return if generate_filled_in\n if do_change_password_for(@user)\n # since sometimes we're changing the password from within another action/template...\n #redirect_to :action => params[:back_to] if params[:back_to]\n redirect_back_or_default :action => 'change_password'\n end\n end",
"def adm_reenter_password_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_password2/\"), __method__)\n end",
"def password\n end",
"def password\n end",
"def join_reenter_password_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_content_ctl00_fragment_17442_ctl01_ctl00_ctl00_ctl05_PasswordPlaceholder_ctl09_Password2/\"), __method__)\n end",
"def modal_password_field\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.input.className(create_ats_regex_string(\"ats-createpwdfield\")), format_method(__method__))\n end",
"def password_for(method,options={})\n content = build_tags(method,options)\n content << @template.password_field(@object_name,method,sanitize_opts(options))\n end",
"def recruiter_password_change(current_password,new_password)\n current_password_field.set current_password\n\t new_password_field.set new_password\n confirm_password_field.set new_password\n\t change_button.click\n\t \n end",
"def login_password_field\n $tracer.trace(__method__)\n #unit_test_no_generate: login_password_field, input.className(create_ats_regex_string(\"ats-pwdfield\"))\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-pwdfield\")), __method__, self)\n end",
"def change_password(new_password)\n update_password(new_password)\n @password = new_password\n puts 'Success! Your password has been changed.'.colorize(:light_green)\n @prompt.keypress('Press any key to continue..')\n menu = Menu.new(self)\n menu.account_details\n end",
"def enter_password\n end",
"def password_field\n $tracer.trace(__method__)\n #unit_test_no_generate: password_field, input.id(\"Password\")\n return ToolTag.new(input.id(\"Password\"), __method__, self)\n end",
"def join_choose_password_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_content_ctl00_fragment_17442_ctl01_ctl00_ctl00_ctl05_PasswordPlaceholder_ctl09_Password/\"), __method__)\n end",
"def change_password\n @attributes[:change_password]\n end",
"def generate_password\n if new_record?\n self.password = self.password_confirmation = /\\w{0,10}/.gen unless password\n end\n end",
"def new_password(data)\n data.strip!\n unless data =~ /^\\w{6,20}$/\n ask_password\n return\n end\n @display.echo_on\n @new_password = data\n ask_color\n end",
"def password; end",
"def password; end"
] |
[
"0.775281",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75570434",
"0.75561213",
"0.75561213",
"0.74771744",
"0.74204326",
"0.73552054",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341745",
"0.7341582",
"0.7341582",
"0.72605926",
"0.72479314",
"0.7242309",
"0.7179904",
"0.71545494",
"0.7098174",
"0.7086759",
"0.7063154",
"0.70618147",
"0.7060318",
"0.70154566",
"0.70086414",
"0.70086414",
"0.70035577",
"0.6982128",
"0.6970402",
"0.69592047",
"0.69295305",
"0.6918053",
"0.69017327",
"0.69008434",
"0.6899436",
"0.68786114",
"0.6875565",
"0.6820289",
"0.67664325",
"0.67664325"
] |
0.0
|
-1
|
Set New password to database
|
def set_password
@user = User.find(session[:user_id])
if @user.password == params[:old_password]
if @user.update_attributes(params[:user])
redirect_to user_new_path
else
flash[:notice] = "Please enter correct passwords"
render user_change_password_path
end
else
flash[:notice] = "Please enter your correct passwords"
redirect_to user_change_password_path
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def newPassword(newPass)\n\t\tDATABASE.edit(\"users\", \"password\", newPass, \"username\", @username)\n\tend",
"def pass=(new_password)\n self.password = Password.create(new_password)\n end",
"def set_password\n @password = Password.last\n @new_password = Password.new\n end",
"def set_password=(new_password)\n self.password = Password.create(new_password)\n self.save\n end",
"def password=(new_password); end",
"def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end",
"def password_set(password)\n self.password.set password\n self.passwordconfirm.set password\n end",
"def password= new_password\n new_password ||= SecureRandom::hex(8)\n @password = Password.create new_password\n self.password_digest = @password.to_s\n self.save\n end",
"def set_new_password \n new_passwd = generate_password()\n self.password = self.password_confirmation = new_passwd\n self.save!\n return new_passwd\n end",
"def attempt_set_password(params)\n\t p = {}\n\t p[:password] = params[:password]\n\t p[:password_confirmation] = params[:password_confirmation]\n\t update_attributes(p)\n end",
"def change_password(new_pass)\n self.salt = User.gen_salt\n salted_pass = User.salt_password(new_pass, self.salt)\n self.password = salted_pass\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.encrypted_password = @password\n end",
"def set_password(password) \n\t\t#Generate salt\n\t\tbase = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n\t\tsalt = (0...50).map{ base[rand(base.length)] }.join\n\t\t\n\t\tenc_password = Digest::SHA1.hexdigest(salt+password)\n\t\t\n\t\tself.salt = salt\n\t\tself.password = enc_password\n\t\tself.temp_password = nil\n\t\tself.save\n\tend",
"def password= new_pass\n # don't allow setting a blank password\n return if new_pass.blank?\n\n @password = BCrypt::Password.create(new_pass)\n self.password_digest = @password\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end",
"def set_password(pass)\n self.user_password = User.crypt(pass)\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def attempt_set_password(params)\n p={}\n p[:password]=params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end",
"def password=(new_password)\n @passowrd = Password.create(new_password)\n self.password_hash = @password\n end",
"def password=(new_password)\n @password = new_password\n end",
"def set_change_password(user)\n user.update_column(:must_change_passwd, true)\n session[:pwd] = 1\n end",
"def create_new_password\n pass = generate_password\n set_password(pass)\n pass\n end",
"def password=(new_password)\n @raw_password = new_password\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def set_password pass\n self.pass_salt = SHA256Salt.generate_random\n self.pass_hash = WodaHash.digest(self.pass_salt + pass).to_hex\n end",
"def password= passwd\n return unless passwd\n new_salt = User.fresh_salt\n self.passworddate = Date.today.to_s\n self.salt = new_salt\n self.send(:write_attribute, :password, User.password_hash(passwd.to_s, new_salt))\n end",
"def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes p\n end",
"def set_password; nil; end",
"def password= new_password\n @password = new_password\n end",
"def update_password(db, domain_name, new_pw)\n db.execute(\"UPDATE organizer SET password='#{new_pw}'' WHERE domain_name='#{domain_name}'\")\nend",
"def update_password(newpwd)\n self.password = Utils.sha1(newpwd + 'ad2012spot' + email)\n end",
"def change_password\r\n \r\n end",
"def change_password!(password)\n json = JSON.generate(:changePassword => { :adminPass => password })\n @compute.connection.req('POST', \"/servers/#{@id}/action\", :data => json)\n @adminPass = password\n end",
"def passwd\r\n @password = \"12345\"\r\n end",
"def change_temp_password\n\tend",
"def set_password(new_password)\n UserPassword.new(:id => id, :new_password => new_password).post\n end",
"def set_password_field(password)\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.digest_password = @password\n end",
"def password=(new_pass)\n validate_password new_pass\n self.password_salt = User.random_string\n self.password_hash = digest(new_pass)\n end",
"def password=(pwd)\n @password = pwd\n\n self.password_digest = BCrypt::Password.create(pwd)\n\n self.save\n end",
"def set_default_password\r\nself.password = :random\r\nend",
"def password=(val)\n return if val.blank?\n attribute_set(:salt, Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{name}--\")) if new?\n attribute_set(:crypted_password, val.encrypt(self.salt))\n end",
"def password=(pwd) # define password = pwd(arg)?\n # set password_digest column to encrypted version of user's pwd.\n self.password_digest = BCrypt::Password.create(pwd)\n end",
"def change_password(new_password)\n put(\"\", {:password => new_password})\n @password = new_password\n end",
"def old_password=(string)\n end",
"def password=(value)\n\t\t\t@password = value\n\t\tend",
"def cdb_set_password(password, confirm_password=password) \n raise ArgumentError, \"Passwords do not match\" unless password == confirm_password\n raise ArgumentError, \"Password cannot be blank\" if (password.nil? || password.length==0)\n raise ArgumentError, \"Password must be a minimum of 6 characters\" if password.length < 6\n generate_salt\n @password = encrypt_password(password) \n end",
"def password=(value)\n @password = value\n end",
"def set_password\n @password = Password.find(params[:id])\n end",
"def password=(new_password)\n if new_password != ''\n @password = Password.create(new_password)\n self.password_digest = @password\n end\n end",
"def password=(new_password)\n self[:password] = new_password\n self.password_digest = BCrypt::Password.create(new_password)\nend",
"def password=(new_password)\n @password = new_password if validate_password(new_password)\n end",
"def password=(new_password)\n @password = new_password if validate_password(new_password)\n end",
"def reset_password(password)\n self.termpassword = password\n save\n end",
"def set_password(v)\n @password = v\n # returns v\n end",
"def add_password(password)\n @password = password\n end",
"def password=(pwd)\n @password = pwd\n create_new_salt\n self.password_hash = User.encrypted_password(self.password, self.password_salt) \n end",
"def set_password(new_password)\n self.salt = SecureRandom.base64(SALT_BYTES)\n self.password = Base64.encode64(OpenSSL::PKCS5::pbkdf2_hmac_sha1(new_password, salt, PBKDF2_ITERATIONS,\n HASH_BYTES))\n end",
"def password(value)\n @config[:password] = value\n end",
"def password=(pwd)\n @password = pwd\n return if pwd.blank?\n create_new_salt\n self.hashed_password = Agent.encrypted_password(self.password, self.salt)\n end",
"def password=(new_password)\n @password = BCrypt::Password.create(new_password, :cost => 8)\n self.hashed_password = @password\n end",
"def set_temp_password() \n\t\t#Generate new password\n\t\tpassword = User.generate_password()\n\t\t\n\t\tsalt = self.salt\n\t\tenc_password = Digest::SHA1.hexdigest(salt+password)\n\t\t\n\t\tself.temp_password = enc_password\n\t\tself.save\n\t\t\n\t\t#Ignore temp password if user is already logged in\n\t\tself.temp_password = nil\n\t\t\n\t\t#Notify user\n\t\tAppMailer.temporary_password_created(self, password).deliver\n\tend",
"def change_password!(opts = {})\n password!(opts.merge(:verb => :put))\n end",
"def password=(new_password)\n if validate_password(new_password)\n @password = new_password\n end\n end",
"def password=(new_password)\n self.password_hash = BCrypt::Password.create(new_password, :cost=>BCRYPT_COST)\n end",
"def update_password(db_connection, new_pass)\n sql = 'UPDATE user_logins SET password=$1 WHERE id=$2;'\n db_connection.exec_params(sql, [ new_pass, id ])\n end",
"def password=(new_password)\n @password = new_password\n self.encrypted_password = encrypt(@password) if @password.present?\n end",
"def change_password(opts = {})\n password(opts.merge(:verb => :put))\n end",
"def password=(pass)\n @password=pass\n # self.password_updated_at = Time.now()\n salt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n self.password_salt, self.password_hash = salt, Digest::SHA256.hexdigest(@password + salt)\n end",
"def password=(pass)\n return if ignore_blank_passwords? && pass.blank?\n run_callbacks :password_set do\n @password = pass\n if password_salt_field\n send(\"#{password_salt_field}=\", Authlogic::Random.friendly_token)\n end\n send(\n \"#{crypted_password_field}=\",\n crypto_provider.encrypt(*encrypt_arguments(@password, false))\n )\n @password_changed = true\n end\n end",
"def password=(new_password)\n self.encrypted_password = new_password\n @password = new_password\n end",
"def password=(password)\n @password = password\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end",
"def set_Password(value)\n set_input(\"Password\", value)\n end"
] |
[
"0.8172648",
"0.795693",
"0.794503",
"0.7914509",
"0.790696",
"0.77838653",
"0.76716846",
"0.75761163",
"0.753777",
"0.75182897",
"0.7497023",
"0.7489766",
"0.74849355",
"0.74771965",
"0.7476955",
"0.74627095",
"0.7447655",
"0.7447655",
"0.7442661",
"0.74389315",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.7433787",
"0.74259645",
"0.741275",
"0.74017954",
"0.7398845",
"0.73968136",
"0.73902273",
"0.7379438",
"0.7366564",
"0.7361293",
"0.7352794",
"0.73053867",
"0.7295007",
"0.72911733",
"0.7285472",
"0.72744024",
"0.7273755",
"0.7271016",
"0.72582215",
"0.7251214",
"0.7247226",
"0.72471803",
"0.7245747",
"0.7224614",
"0.7211539",
"0.7202504",
"0.7201561",
"0.71902674",
"0.7176748",
"0.7168388",
"0.716347",
"0.71589",
"0.7149242",
"0.71439534",
"0.71439534",
"0.7141837",
"0.7139865",
"0.7132517",
"0.7130551",
"0.7123663",
"0.7117199",
"0.71121407",
"0.7092593",
"0.70747954",
"0.7072199",
"0.7069055",
"0.7067889",
"0.70636797",
"0.7062657",
"0.7060152",
"0.7053869",
"0.7041933",
"0.70409375",
"0.7038214",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294",
"0.70349294"
] |
0.0
|
-1
|
Release 1: Calculate Fibonacci Numbers
|
def fibs(num)
x = 0
y = 1
arr = []
num.times {
z = x + y
arr << x
x = y
y = z
}
arr
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def q9_fibonacci(num)\n f1 = 0\n f2 = 1\n (num-1).times {|_|\n tmp = f2\n f2 += f1 \n f1 = tmp\n }\n f2\nend",
"def fibonacci\n\tresults, first, second, current = 0, 1, 2, 2\n\twhile current <= 4000000\n\t\tif current % 2 == 0\n\t\t\tresults += current\n\t\tend\n\t\tcurrent = first + second\n\t\tfirst, second = second, current\n\tend\n\treturn results\nend",
"def iterative_fib(num)\r\n a = 0\r\n b = 1\r\n\r\n num.to_i.times do\r\n temp = a\r\n a = b\r\n # Add up previous two numbers in sequence\r\n b = temp + b\r\n end\r\n\r\n return b\r\nend",
"def fibonacci(fib)\r\n \t#Set a variable to 0\r\n\tvalue1 = 0 \r\n\t#Set a variable to 1 (array must start with 0, 1...)\r\n\tvalue2 = 1\r\n\t\t#For the number of digits it will be, loop do this many times\r\n\t\tfib.times do \r\n\t\t\t#Create a temp to store value1\r\n \t\t\ttemp = value1\r\n \t\t\t#Make value1 equal value2\r\n \t\t\t#This will help when printing out 0,1,1.. in the beginning\r\n \t\t\tvalue1 = value2\r\n \t\t\t#Make value2 equal the sum of temp and value2\r\n \t\t\t#This will add the last numbers to get the next number\r\n \t\t\tvalue2 = temp + value2\r\n \t\t#End do loop\r\n\t\tend\r\n\t#Return the first value\r\n \tvalue1\r\n#End of method\r\nend",
"def iter_fib(number)\n v1 = 0\n v2 = 1\n (number-1).times.each do\n temp = v2\n v2 = v2 + v1\n v1 = temp\n end\n v2\nend",
"def fib (x)\n y = x-2\nfib_sequence = y.times.inject(%5B0,1%5D) do |a, idx|\n a << a[-2] + a[-1]\nend",
"def fib(x)\n fib_nums = [0,1]\n number = x - 2\n number.times do\n fib_nums << fib_nums[-2] + fib_nums[-1]\n end\n p fib_nums\nend",
"def get_fibonacci(num)\n f = [0,1]\n for i in (2..num)\n f << (f[-1] + f[-2])\n end\n if num == 0\n f = 0\n end\n f[-1]\nend",
"def fib (n)\n # return appropriate starter values if n is 0 or 1\n if n == 0 \n return 0\n elsif n == 1\n return 1\n end\n # set up initial constants\n prevNum = 0\n currNum = 1\n # Loop through fibonacci numbers, starting at index 2.\n 2.upto(n) do\n nextNum = prevNum + currNum\n prevNum = currNum\n currNum = nextNum\n end\n return currNum\nend",
"def nthFibonacci (n)\r\n # Your code here\r\n f = [0, 1, 1, 2, 3, 5, 8]\r\n if n < 7\r\n return f[n]\r\n end\r\n\r\n t = 6\r\n fn = 8\r\n\r\n while t < n\r\n fn = (fn * PHI).round(0)\r\n t += 1\r\n end\r\n\r\n return fn\r\nend",
"def regular_fib(sequence)\n first = 0\n second = 1\n if sequence == 0\n puts \"total = 0\"\n end\n sequence.times do \n total = first + second\n puts \"total(#{total}) = #{first} + #{second}\"\n first = second\n second = total\n end \nend",
"def nthFibonacci (n)\r\n # Your code here\r\n a = 0\r\n b = 1\r\n n.times do\r\n temp = a\r\n a = b\r\n b = temp + b\r\n end\r\n return a\r\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibonacci(n)\n return 1 if n <= 2\n num1, num2 = [1, 1]\n index = 2\n while n > index\n running_total = num1 + num2\n num1, num2 = num2, running_total\n n -= 1\n end\n running_total\nend",
"def gen_fibs3\n fibs = [0,1]\n n = 10\n a,b = 0,1\n (n-1).times do\n a,b = b,a+b\n fibs << b\n end\n fibs\nend",
"def fibonacci (n)\r\n def calculation(n)\r\n a = 0\r\n b = 1\r\n\r\n # Compute Fibonacci number in the desired position.\r\n n.times do\r\n temp = a\r\n a = b\r\n # Add up previous two numbers in sequence.\r\n b = temp + b\r\n end\r\n\r\n return a\r\n\r\n end \r\n\r\n fib_results = []\r\n\r\n n.times do |n|\r\n\r\n result = calculation(n)\r\n fib_results << result\r\n end \r\n\r\n return fib_results\r\n\r\nend",
"def iterative_nth_fib(n)\n return 1 if n <= 2\n a = 1\n b = 1\n i = 3\n while i <= n\n new_a = b\n b = a + b\n a = new_a\n i += 1\n end\n b\nend",
"def fib(n)\n fib_0 = 0\n fib_1 = 1\n (0...n).each do \n temp = fib_0\n fib_0 = fib_1\n fib_1 = temp + fib_1\n end\n return fib_1\nend",
"def fibonacci_number(n)\n #define nth Fibonacci term\n fibonacci_lst=[0,1] #F1=1,F2=1\n for i in 2..n\n fibonacci_lst[i]=fibonacci_lst[i-1]+fibonacci_lst[i-2]\n end\n return fibonacci_lst[n]\nend",
"def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"def fib(number)\n #start with 0 and 1\n fibonacci = [0,1]\n n = number - 2\n a = 0\n b = 1\n n.times do\n num = a\n a = b\n b += num\n fibonacci << b\n end\n return fibonacci\n end",
"def fib(x)\n fibo_number = [0, 1]\n (x - 2).times do\n n = fibo_number[-1] + fibo_number[-2]\n fibo_number << n\n end\n puts fibo_number\nend",
"def fibonacci\n @sequence = [1,1]\n x = 0\n while (@sequence[x+1] < 4e+6)\n @sequence << @sequence[x] + @sequence[x+1]\n x += 1\n end\n even? x\nend",
"def nthFibonacci (n)\n # Your code here\n fArr = []\n a = 0\n b = 1\n if n == 0\n fArr << 0\n elsif n == 1\n fArr << 0\n elsif n > 1\n fArr << 0\n while fArr.size < n+1 do\n fArr << b\n a,b = b,a+b\n end\n end\n return fArr[n]\nend",
"def fibs(n) ; PHI**n - PHA**n ; end",
"def fib(n)\n a = 0\n b = 1\n\n while n > 0\n old_b = b\n b = a + b\n a = old_b\n n -= 1\n end\n\n b\n end",
"def fib2(n)\n a = 0\n b = 1\n\n while n > 1\n c = a + b\n a = b\n b = c\n n -= 1\n end\n\n return b\nend",
"def fib(n)\n current_value = 0\n next_value = 1\n\n n.times do |i|\n current_value, next_value = next_value, current_value + next_value\n end\n\n return current_value\nend",
"def fib(number)\n sequence = [0,1]\n number.times {sequence << sequence[-1] + sequence[-2]}\n sequence[-1]\n return sequence\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n end\n\n number1 = 0\n number2 = 1\n number3 = 0\n\n (2..n).each do |index|\n number3 = number1 + number2\n number1 = number2\n number2 = number3\n end\n\n return number3\nend",
"def cool_fib(number)\n (0..number).inject([1,0]) {|i_arr| [i_arr.last, i_arr.first + i_arr.last]}.first\nend",
"def fibonacci(p2, p1, sum)\n next_number = p2 + p1\n return sum if next_number >= 4000000\n sum += next_number if next_number.even?\n fibonacci p1, next_number, sum\nend",
"def fib(x)\n fib = [0,1]\n index_count = 0\n until index_count == x - 2\n fib << (fib[index_count] + fib[index_count + 1])\n index_count += 1\n end\n p fib\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |_, results| results << results[-2] + results[-1] }\nend",
"def fib(number)\n if number == 0\n 0\n elsif number == 1\n 1\n else\n test= fib(number-1) + fib(number-2)\n puts \"adding number #{number-1} and #{number-2} = #{test}\"\n test\n end\nend",
"def fibonacci\n start_value = 1\n new_value = 1\n while new_value <= 1000\n\n new_value = new_value + start_value\n end\nend",
"def fibonacci_numbers(num) #method takes one argument. The amount of fibonacci numbers you wish to generate.\r\n\tfib_arr = [0,1] #the fibonacci sequence begins with integers 0 and 1\r\n\t(num-2).times {fib_arr << fib_arr[-1] + fib_arr[-2]} #because the first two numbers are given we subtract 2 from the number of times we want to push numbers into our fib_arr.\r\n#we add the last two numbers in the sequence togther and push that to the fib_arr\r\n\treturn fib_arr #return array with new numbers\r\nend",
"def nthFibonacci (n)\r\n num = n.to_i\r\n fibonacci_sequence = Array.new\r\n case num\r\n when 0 \r\n fibonacci_sequence << 0\r\n when 1\r\n fibonacci_sequence << [0,1]\r\n else\r\n fibonacci_sequence[0] = 0\r\n fibonacci_sequence[1] = 1\r\n i = 1\r\n while i < num\r\n i+= 1\r\n fibonacci_sequence[i] = fibonacci_sequence[i-1] + fibonacci_sequence[i-2] \r\n end\r\n end\r\n return fibonacci_sequence\r\nend",
"def fibonacci(n)\n # raise NotImplementedError\n\n if n == 0\n return 0\n end\n\n if n == nil || n < 0\n raise ArgumentError\n else\n a = 0\n b = 1\n for i in (1...n)\n temp = b\n b += a\n a = temp\n end\n # Golden Ratio\n # f = ((1.618034 ** n) - ((-0.618034) ** n)) / Math.sqrt(5)\n end\n\n return b\n # return f.round(0)\nend",
"def fibs(n)\nend",
"def fib(n)\n return n if n < 2\n f0, f1 = 0, 1\n (n-1).times { f0, f1 = f1, f0+f1 }\n f1\nend",
"def fibonacci(amount)\r\n fib_array = [0, 1]\r\n current_value = 0\r\n if (amount == 0) ; return 0; end # Edge case...\r\n if (amount == 1) ; return 1; end # Edge case...\r\n\r\n index = 2 # Start indexing after the edge cases.\r\n until index == amount\r\n current_value = fib_array[-1] + fib_array[-2] # Equation for Fib-sequence. push it onto array afterwards.\r\n fib_array.push(current_value)\r\n index += 1 # counter approaching amount\r\n end \r\n return fib_array[-1] # return the last value we did!\r\nend",
"def iter_fib(n)\n return n if n == 0 || n == 1\n\n two_before = 0\n one_before = 1\n\n for i in 2..n\n current = two_before + one_before\n two_before = one_before\n one_before = current\n end\n one_before\nend",
"def fibonaci(n)\n\tfi= [1, 1]\n\t(n-1).times do\n\t\tfi << fi[1]+fi.shift\n\tend\n\treturn fi[0]\nend",
"def fibonacci(num)\n fib_nums = []\n (0...num).each do |i|\n if i == 0 || i == 1\n fib_nums << 1\n next\n end\n fib_nums << fib_nums[i-2] + fib_nums[i-1]\n end\n return fib_nums\nend",
"def fibonacci(num)\n (1..num).inject( [0,1] ) { |fib| fib << fib.last(2).inject(:+) }\n\nend",
"def fibonacci(n)\n if n == 0\n 0\n elsif n == 1\n 1\n else\n before_previous = 0\n previous = 1\n actual = nil\n (2..n).each do\n actual = previous + before_previous\n before_previous = previous\n previous = actual\n end\n actual\n end\nend",
"def fibo(n)\n\n first = 0\n second = 1\n total = 0\n\n (1...n).each do\n total = first + second\n first = second\n second = total\n end\n return total\nend",
"def fibonacci(n)\n fib1 = 0\n fib2 = 0\n fib = 0\n\n (1..n).each do |num|\n if num <= 2\n fib = 1\n fib1 = 1\n fib2 = 1\n else\n fib1 = fib2\n fib2 = fib\n fib = fib1 + fib2\n end\n end\n\n fib\nend",
"def fib_it count\n prev = 0\n curr = 1\n for i in 0...count do\n tmp = curr\n curr += prev\n prev = tmp\n end\n prev\nend",
"def nth_fib(x)\n arr = [0,1]\n count = 1\n while count < x\n next_val = arr[-1] + arr[-2]\n arr = [arr[-1], next_val]\n count += 1\n end\n puts next_val\n # puts \"The weird algorithm from Hackerank comes to: #{next_val % (10**8 + 7)}\"\n end",
"def fibonacci(num) \n\tfib = [0,1]\n (num - 2).times do \n \tfib << fib[-2] + fib[-1]\n end\n fib[-1]\nend",
"def fibs(num)\n array = []\n 0.upto(num) do |i|\n array << i if i.zero? || i == 1\n array << array[i - 1] + array[i - 2] if i > 1\n end\n array\nend",
"def nthFibonacci (n)\n \n if n == 0\n return 0\n end\n\n i = 0\n\n sequence = Array.new\n\n sequence.push(i)\n\n i += 1\n\n sequence.push(i)\n\n while i < n do\n sequence[i+1] = (sequence[-1]) + (sequence[-2])\n\n i += 1\n end\n\n sequence[-1]\nend",
"def fib(n)\n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n last = 1\n next_to_last = 0\n i = 2\n\n while i <=n\n cur_fib = last + next_to_last\n next_to_last = last\n last = cur_fib\n i +=1\n end\n return cur_fib\nend",
"def fibonacci(how_many_numbers)\n fibonacci_sequence = []\n count = 0\n while count < how_many_numbers\n if count == 0\n fibonacci_sequence << 0\n count += 1\n elsif count == 1\n fibonacci_sequence << 1\n count += 1\n else\n fibonacci_sequence << fibonacci_sequence[-1] + fibonacci_sequence[-2]\n count += 1\n end\n end\n fibonacci_sequence\nend",
"def fib(number)\n\narr = [0, 1]\n\n\ti = 0\n\t\n\twhile i < number - 2\t\t\n\t\tarr.push(arr[i] + arr[i+1])\n\t\ti += 1\n\tend\n\t\narr\t\nend",
"def fibonacci_fast_doubling(n)\n return 1 if n <= 2\n\n nums = []\n while n > 0\n nums << n\n n /= 2\n end\n\n a = 0 # F(n) = F(0)\n b = 1 # F(n + 1) = F(1)\n\n until nums.empty?\n n = nums.pop\n c = a * ((2 * b) - a) # c = F(2n)\n d = b**2 + a**2 # d = F(2n + 1)\n if n.odd?\n a = d\n b = c + d\n else\n a = c\n b = d\n end\n end\n a\nend",
"def fib \n arr = [0, 1]\n\n while arr[-1] + arr[-2] <= 4_000_000\n arr << arr[-1] + arr[-2]\n end\n arr.select(&:even?).inject(:+)\nend",
"def fibonacci2(n)\n return 0 if n == 0\n return 1 if n == 1 || n == 2\n last = 0\n lastlast = 1\n current = 0\n n.times do\n current = last + lastlast\n lastlast = last\n last = current\n end\n current\nend",
"def fib_iter(n)\n return n if n <= 1\n\n a = 0\n b = 1\n\n 2.upto(n) do |i|\n tmp = b\n b = a + b\n a = tmp\n end\n\n b\nend",
"def fib(n)\n return 1 if n <= 2\n \n fib_index = 3\n a, b = 1, 1\n \n while fib_index <= n\n c = a + b\n a = b\n b = c\n fib_index += 1\n end\n \n c\nend",
"def fibonacci(n)\n if n.nil?\n raise ArgumentError.new(\"Invalid\")\n elsif n < 0\n raise ArgumentError.new(\"Invalid\")\n end\n\n return 0 if n == 0\n\n num_one = 0\n num_two = 1\n fib_n = 1\n\n count = n - 1\n\n count.times do\n fib_n = num_one + num_two\n num_one = num_two\n num_two = fib_n\n end\n\n return fib_n\nend",
"def nthFibonacci (n)\n # Your code here \nend",
"def naive_fib(number)\n return -1 if number < 0\n return 0 if number == 0# && (@operations += 1)\n return 1 if number == 1# && (@operations += 1)\n naive_fib(number-1) + naive_fib(number-2)\nend",
"def fib_itera(n)\n a, b = 0, 1\n \n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n i = 1\n while i < n\n result = a + b\n a = b\n b = result\n i += 1 \n end\n\n result\nend",
"def even_fibonacci_numbers\n a = 1\n b = 2\n\n total = b # b= 2, even number.\n\n while b < 4_000_000\n c = b\n b = a + b\n a = c\n if b % 2 == 0\n total += b\n end\n end\n puts total\nend",
"def iterative_fib (num)\n fib_arr = []\n (1..num).each do |i|\n if i == 1 || i == 2\n fib_arr << 1\n else\n fib_arr << fib_arr[-1] + fib_arr[-2]\n end\n end\n fib_arr\nend",
"def fibonacci (integer)\n\tfib_arr = [0, 1]\n\t(integer-2).times do |index|\n\t\tresult = fib_arr[index+1] + fib_arr[index]\n\t\tfib_arr << result\n\tend\n\t\np fib_arr\nend",
"def fib(n)\n n += 2\n n.times do |num|\n if num == 0\n next\n elsif num == 1\n next\n else\n print \"#{(1.618034 ** num - (1 - 1.618034) ** num) * 1 / Math.sqrt(5)}\".to_i\n print \", \"\n end\n end\n puts \"*****\"\nend",
"def fib_iterative(n)\n\tnum = 0\n\tnext_num = 1\n\tpositions = 1..n\n\tpositions.each do |position|\n\t\tnum = next_num\n\t\tnext_num = next_num + num\n\tend\n\tretun num\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2]+obj[-1]}\nend",
"def fib(terms)\r\n\tfib_arr = [0,1]\r\n\tfor i in 2...terms\r\n\t\t\tfib_arr << fib_arr[i-1]+fib_arr[i-2]\r\n\tend\r\n\tfib_arr\r\n#\tfib_arr[-1]\r\nend",
"def fibo(num)\n \n print \"Fibonacci series is: \"\n\n if num == 0\n puts num\n return num\n end\n\n if num == 1\n puts \"0 1\"\n return num\n end\n\n i,j,cur = 0,1,1\n\n print \"0 1 \"\n while cur < num\n k = i\n i = j\n j = k + j\n print \"#{j} \"\n cur = cur + 1\n end\n\n return j\n\nend",
"def fibonacci number\n sequence = []\n a = 1\n b = 1\n while true\n sequence << b\n newa = b\n b = a+b\n a = newa\n break if b > number\n end\n sequence\nend",
"def fib(n)\r\n gRatio = 1.61803398875\r\n\r\n if n == 0\r\n return 0\r\n elsif n == 1\r\n return 1\r\n else\r\n num = (((gRatio)**n) - ((1 - gRatio) ** n)) / Math.sqrt(5)\r\n return num.to_i\r\n end\r\nend",
"def fib\n sum = 0\n a = 1\n b = 2\n while b < 4000000\n sum += b if b % 2 == 0\n a, b = b, a + b\n # sum += b if b % 2 == 0\n end\n puts sum\nend",
"def even_fib\n x=[0,1]\n i = 0\n a = []\n\n while x.last < 4000000\n x.push(x[i] + x[i+1])\n i += 1\n end\n\n x.pop\n\n x.each do |blah|\n if blah.even?\n a.push(blah)\n end\n \n end\n\n a.reduce(:+)\n\nend",
"def fibb(i)\n if i==0 \n return 0\n elsif i==1\n return 1\n else\n prev1=0\n prev2=1\n curr = 0\n #(2..i).each do |x|\n (2..i).each do #so it works w/o x as well\n #2.upto(i) do\n curr = prev1 + prev2 #3 = 1 + 2\n prev1 = prev2 # 1 := 2\n prev2 = curr # 2 := 3\n end\n end\n return curr\nend",
"def fib_iterate(n)\n\n fib_nums = []\n i = 0\n fib_nums << 0 if n > 0\n fib_nums << 1 if n > 1\n while i < n\n if i > 1\n fib_nums << fib_nums[i-1] + fib_nums[i-2]\n end\n i+= 1\n end\n\n fib_nums\nend",
"def fibonacci(n)\n a = 0\n b = 1\n\n n.times do\n temp = a\n a = b\n b = temp + b\n end\n a\nend",
"def iterative_fib(num)\r\n\treturn num if num < 2\r\n\tfib = [0, 1]\t\r\n\t(2..num).each do |digit|\r\n\t\tx = fib[digit - 1] + fib[digit - 2]\r\n\t\tfib << x\r\n\tend\r\n\treturn fib.last\r\nend",
"def quick_fib(n)\n (((1 + Math.sqrt(5)) / 2) ** n / Math.sqrt(5)).round\nend",
"def getFibbo\n prev_num = 1\n cur_num = 2\n running_total = 0\n sum_total = 0\n while (prev_num < 4E6)\n if (prev_num % 2 == 0)\n sum_total += prev_num\n end\n running_total = cur_num + prev_num\n prev_num = cur_num\n cur_num = running_total\n puts \"Current total is #{running_total}\"\n end\n return sum_total\nend",
"def fib(n)\n return n if n < 2\n arr = [0, 1]\n (n-1).times { arr << arr.last(2).inject(:+) }\n arr.last\nend",
"def fibonacci_num(num)\n return 0 if num == 0\n return 1 if num == 1\n return 1 if num == 2\n fib_num = (fibonacci_num(num - 1)) + (fibonacci_num(num - 2))\nend",
"def fibonacci_numbers\n fibonacci_snapshot = [1,2]\n fibonacci_results = []\n loop do\n return fibonacci_results if fibonacci_snapshot[1] > 4_000_000\n fibonacci_snapshot << fibonacci_snapshot.reduce(:+)\n fibonacci_results << fibonacci_snapshot[0]\n fibonacci_snapshot.shift\n end\nend",
"def fibs(num)\n arr = [0, 1]\n\n (2..num).each do |_i|\n arr << arr[-1] + arr[-2]\n end\n\n arr.last\nend",
"def fibbernacho(number)\n\t\n\tprimer = [0,1,1]\n\tn= 0\n\tevensum = 0\nwhile n <=100 && primer.last < 5000000\n\tprimer << (primer.last + primer[-2])\n\tprimer.last\n\t\tif primer.last % 2 == 0\n \t\t evensum += primer.last\n\t\tend\n\tn+=1\n\tend\n\tputs \"The sum of all even Fibbonacci numbers in the sequence up to #{number} is #{evensum}\"\n\tputs \"The value chain: #{primer.inspect}\"\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2] + obj[-1] }\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n \n\n fib(n - 1) + fib(n - 2)\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n [fib(n-1),fib(n-2)].reduce(:+)\n\t\nend",
"def nthFibonacci(n)\r\n fibonacci = []\r\n a = 0 \r\n b = 1\r\n\r\n while n >= fibonacci.length\r\n fibonacci.push(a)\r\n fibonacci.push(b)\r\n a = a + b\r\n b = a + b\r\n end\r\n return fibonacci[n]\r\nend",
"def fibonacci(n)\n return 1 if n <= 2\n num1 = 1\n num2 = 1\n new_num = 0\n (n-2).times do\n new_num = num1 + num2\n num1 = num2\n num2 = new_num\n end\n new_num\nend",
"def fib(repeat)\n num1 = 1\n num2 = 1\n repeat.times do\n num1, num2 = num2, num1 + num2\n end\n num1\nend",
"def fib(n)\n if n <= 2\n return [0, 1].take(n)\n end\n previous_fib = fib(n-1)\n next_ele = previous_fib[-1] + previous_fib[-2]\n previous_fib << next_ele\nend",
"def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend"
] |
[
"0.8325293",
"0.8218008",
"0.8147935",
"0.79460585",
"0.7944949",
"0.7930545",
"0.7903512",
"0.7899261",
"0.78793126",
"0.7866132",
"0.7862448",
"0.784195",
"0.7839586",
"0.7839586",
"0.7839586",
"0.7839586",
"0.7839586",
"0.78351057",
"0.7832777",
"0.78290737",
"0.7827159",
"0.78236127",
"0.7806511",
"0.78050846",
"0.77909577",
"0.7783635",
"0.7779039",
"0.77762014",
"0.7769483",
"0.776558",
"0.7764142",
"0.7750693",
"0.773614",
"0.7730642",
"0.77257323",
"0.7719296",
"0.7710703",
"0.7707961",
"0.77023405",
"0.76936126",
"0.76876915",
"0.76839197",
"0.7682022",
"0.7678338",
"0.7675675",
"0.76736176",
"0.76733786",
"0.7672824",
"0.7670648",
"0.7670202",
"0.7660065",
"0.7657876",
"0.7644352",
"0.76431584",
"0.7633545",
"0.76303643",
"0.763032",
"0.76295793",
"0.76221895",
"0.7615865",
"0.76148385",
"0.7593376",
"0.7592771",
"0.7591341",
"0.7587639",
"0.75869554",
"0.7585583",
"0.75851744",
"0.7577365",
"0.7577281",
"0.7574529",
"0.7573457",
"0.75681144",
"0.75620943",
"0.75571394",
"0.7555028",
"0.75547403",
"0.7554174",
"0.75532395",
"0.7551627",
"0.7551098",
"0.75466645",
"0.75456244",
"0.7540495",
"0.7534076",
"0.7533852",
"0.7524406",
"0.75240874",
"0.7521368",
"0.75205266",
"0.7517137",
"0.751434",
"0.7514277",
"0.7512999",
"0.75119823",
"0.75119466",
"0.75118184",
"0.75109476",
"0.7504771",
"0.75047433",
"0.7503581"
] |
0.0
|
-1
|
Release 2: Sort an Array First take the input of the array from the user Figure out how long the array is (length) left element > right element , if left is bigger than we swap if it is less than we keep it the same looping until the array is sorted
|
def bubble_sort(arr)
sorted = false
until sorted
sorted = true
(arr.length - 1).times do |index|
if arr[index] > arr[index + 1]
arr[index], arr[index + 1] = arr[index + 1], arr[index]
sorted = false
end
end
end
arr
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sort(input)\n # If the length of the array is < or = 1, then we already\n # know it's sorted, so exit\n return input if input.length <= 1\n\n # Now we want to run this algorithm in a loop for forever\n # until we know that the entire array is sorted. That\n # will be our \"break\" condition - the condition to\n # break out of the loop.\n\n swapped = true\n while swapped do\n # We set swapped equal to false here, because we\n # basically want to set it only to true when we've\n # actually swapped something. If we never swap anything\n # in this iteration of the loop, it means that the\n # array is sorted and we're done.\n swapped = false\n\n # We use upto, which is a function from Enumerators\n # https://ruby-doc.org/core-2.2.0/Integer.html#method-i-upto\n # We basically are saying we are going to access through the\n # array we're given, up until the length of it -2. Why?\n # We're accessing each of the array elements by index.\n # Example: [1,2,3,4]\n # If we want to get 1 from the array, we access element 0.\n # In this example, we want to access the current index and the\n # index ahead of it. So, in this loop, we only want to try\n # and access the length of the array minus 2, because otherwise\n # we'll run out of the bounds of the array.\n 0.upto(input.length - 2) do |index|\n # If the number at our current index is greater than the one\n # in front of it... swap!\n if input[index] > input[index+1]\n # Here's a neat trick you can do so you don't have to assign\n # any variables to hold onto a value.\n input[index], input[index+1] = input[index+1], input[index]\n swapped = true\n end\n end\n end\n\n input\nend",
"def sorting(arr)\n#display orig array\n p arr \n p \"**************************************************\"\n # do something to the array\n # compare each value of an array to the value on its left\n # if the value is less than the value on its left, switch places\n # do this by placing the lesser value in a holder and then moving the greater\n # value to the lesser value's former position in the array, then rewrite the\n # greater value's former position, with the holder value.\n # do this until the value is greater than the value on its left for \n # the entire array \n#Here is our brute force attempt at making our own .sort! method\n#we used the .sort! method from the Array class.\narr.length.times do\n |x|\n holder = \"\"\n if arr[x] > arr[x-1]\n holder = arr[x-1]\n arr[x-1] = arr[x]\n arr[x] = holder\n end \n end\nputs \"this is the one we made #{arr} \"\n # if arr[1] > arr[0]\n p arr.sort!\n p \"above is the sorting method\"\n#rerturn the changed array\nend",
"def shell_sort(a)\n i = 0\n j = 0\n size = a.length\n increment = size / 2\n temp = 0\n \n while increment > 0\n i = increment\n while i<size\n j = i\n temp = a[i]\n while j>=increment and a[j-increment]>temp\n a[j] = a[j-increment]\n j = j-increment\n end\n a[j] = temp\n i+=1\n end\n if increment == 2\n increment = 1\n else\n increment = (increment/2).to_i\n end\n end\n return a\nend",
"def sort(num_array)\n if num_array.length > 1\n middle = num_array.length/2\n left = num_array[0, middle]\n right = num_array[middle, num_array.length]\n\n # sort each side\n sort(left)\n sort(right)\n\n i = j = k = 0\n\n # copy data to left and right\n while i < left.length && j < right.length\n if left[i] < right[j]\n num_array[k] = left[i]\n i += 1\n else\n num_array[k] = right[j]\n j += 1\n end\n\n k += 1\n\n end\n\n # checking if any element was left\n while i < left.length\n num_array[k] = left[i]\n i += 1\n k += 1\n end\n\n # checking any right\n while j < right.length\n num_array[k] = right[j]\n j += 1\n k += 1\n end\n end\n return num_array\nend",
"def sort(array, length)\r\n i = 0;\r\n while i < array.length\r\n if array[i] > array[i+1]\r\n j = 0;\r\n while j < array.length\r\n if array[j] > array[i + 1]\r\n temp = array[j];\r\n array[j] = array[i + 1];\r\n array[i + 1] = temp;\r\n end\r\n j++;\r\n end\r\n j++;\r\n end\r\n i++;\r\n end\r\nend",
"def bubble_sort(array)\r\n sorted = false\r\n\r\n until sorted\r\n sorted = true\r\n (0...array.length-1).each do |idx|\r\n if array[idx].length > array[idx +1].length\r\n array[idx] , array[idx + 1] = array[idx + 1], array[idx]\r\n sorted = false\r\n end\r\n end\r\n end\r\n\r\n array\r\nend",
"def sorter(arr)\n\nreturn arr if arr.length <= 1\n\nnot_sorted = true\n\n while not_sorted\n not_sorted = false\n (arr.length-1).times do |i|\n if arr[i] > arr[i+1]\n arr[i], arr[i+1] = arr[i+1], arr[i]\n not_sorted = true\n p arr\n p \"swap occurred\"\n end\n end\n end\n arr\nend",
"def sorter(arr)\n\nreturn arr if arr.length <= 1\n\nnot_sorted = true\n\n while not_sorted\n not_sorted = false\n (arr.length-1).times do |i|\n if arr[i] > arr[i+1]\n arr[i], arr[i+1] = arr[i+1], arr[i]\n not_sorted = true\n p arr\n p \"swap occurred\"\n end\n end\n end\n arr\nend",
"def sort(array)\nfor j in 1..(array.length-1) #Sets loop parameter to count between 1 and length instead of starting at zero\n compare = array[j]\n i = j - 1\n while i >= 0 and array[i] > compare\n array[i+1] = array[i]\n i = i - 1\n end\n array[i+1] = compare\nend \nputs array\nend",
"def shell_sort(array)\n # p array\n gap = array.length/2\n while gap > 0\n idx = 0\n while idx < array.length - gap\n # while loop to move multiple steps\n while array[idx + gap] < array[idx]\n array[idx+gap],array[idx] = array[idx],array[idx+gap]\n if idx >= gap\n idx -= gap \n else\n break\n end\n end\n idx += 1\n end\n gap = gap/2\n # puts \"new gap is #{gap}\"\n p \"-\" * 10\n # p array verify properly sorting\n end\nend",
"def sort_array array\n sorted=[]\n a=0\n b=0\n until a==(array.length-1)||b==(array.length)\n if array[a] <= array[b]\n b+=1\n else\n a+=1\n b=0\n end\n end\n sorted.push array[a]\n array.delete(array[a])\n \n while true\n if array.length==1\n sorted.push array[0]\n break\n else\n a=0\n b=0\n until a==(array.length-1)||b==(array.length)\n if array[a]<=array[b]\n b+=1\n else\n a+=1\n b=0\n end\n end\n sorted.push array[a]\n array.delete_at(a)\n end\n end\n sorted\nend",
"def shell_sort(array)\n p array\n gap = array.length/2\n while gap > 0\n puts \"gap is currently #{gap}\"\n idx = 0\n while idx < array.length - gap\n # while loop to move multiple steps\n while array[idx + gap] < array[idx]\n array[idx+gap],array[idx] = array[idx],array[idx+gap]\n if idx > 0\n idx -= 1\n else\n break\n end\n end\n idx += 1\n end\n gap = gap/2\n p \"-\" * 10\n p array\n end\nend",
"def bubble_sort(array)\n fixed_position = array.length\n while true\n left_elem_index = 0\n while true\n #compare the left and the right\n left = array[left_elem_index]\n right = array[left_elem_index +1]\n if left > right then\n array[left_elem_index] = right\n array[left_elem_index + 1] = left\n left_elem_index +=1\n else\n left_elem_index +=1\n end\n break if left_elem_index +1 == fixed_position\n end\n fixed_position -=1\n break if left_elem_index ==1\n end\n return array\nend",
"def shell_sort(arr)\n gap = arr.size / 2\n until gap >= 1\n (0...gap).each do |i|\n j = i\n while j < arr.size\n arr[j], arr[j+gap] = arr[j+gap], arr[j] if arr[j] > arr[j+gap]\n j = j + gap\n end\n end\n gap, mod = gap.divmod(2)\n gap = mod == 0 ? gap + 1 : gap\n end\n arr\nend",
"def sort(num_array)\n # Your code goes here\n (num_array.length).times do |i|\n while i > 0\n if num_array[i-1] > num_array[i] \n num_array[i-1], num_array[i] = num_array[i], num_array[i-1]\n else\n break\n end\n i-=1\n end\n \n end\n return num_array\n \nend",
"def array_sort(arr)\nx = arr.length\nif x == 1\nelsif x == 2\n if arr[0] > arr[1]\n arr[0], arr[1] = arr[1], arr[0]\n end\nelse\n loop do\n modified = FALSE\n (x-2).times do |x|\n if (arr[x] < arr[x + 1]) && (arr[x] < arr[x + 2])\n if arr[x + 2] < arr[x + 1]\n arr[x], arr[x + 1], arr[x + 2] = arr[x], arr [x + 2], arr[x + 1]\n modified = TRUE\n end\n elsif (arr[x + 1] < arr[x]) && (arr[x + 1] < arr[x + 2])\n if arr[x] < arr[x + 2]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 1], arr[x], arr[x + 2]\n modified = TRUE\n elsif arr[x + 2] < arr[x]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 1], arr [x + 2], arr[x]\n modified = TRUE\n elsif arr[x + 2] == arr[x]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 1], arr[x], arr[x + 2]\n modified = TRUE\n end\n elsif (arr[x + 2] < arr[x]) && (arr[x + 2] < arr[x + 1])\n if arr[x] < arr[x + 1]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 2], arr[x], arr[x + 1]\n modified = TRUE\n elsif arr[x + 1] < arr[x]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 2], arr[x + 1], arr[x]\n modified = TRUE\n elsif arr[x] == arr[x + 1]\n arr[x], arr[x + 1], arr[x + 2] = arr[x + 2], arr[x], arr[x + 1]\n modified = TRUE\n end\n end\n end\n break if modified == FALSE\n end\nend\n arr\nend",
"def bubble_sort(array)\ntemp = nil\n\tfor n in 0..array.length-1\n\t\tswapped = false\n\t\tfor i in 0...array.length-1\n\t\t\tif array[i] < array[i+1]\n\t\t\t\tarray\n\t\t\telse \n\t\t\t\ttemp = array[i]\n\t\t\t\tarray[i] = array[i+1]\n\t\t\t\tarray[i+1] = temp\n\t\t\t\tarray\n\t\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\tif !swapped\n\t\tbreak\n\t\tend\n\tend\n\t\tarray\nend",
"def shell_sort(array)\n len = array.length\n gap = 1\n\n # calculate gap distance for initial sub-array checks\n gap = gap * 3 + 1 while gap < len / 3\n\n while gap > 0\n (gap...len).each do |i|\n j = i\n while j >= gap\n if array[j - gap] > array[j]\n array[j - gap], array[j] = array[j], array[j - gap]\n end\n j -= gap\n end\n end\n gap /= 3\n end\n array\nend",
"def bubble_sort(array)\n\tlength = array.length \n\tcounter = 0\n\n\tuntil counter == length\n \t(length - 1).times do |index|\n \t\tif array[index] > array[index + 1]\n \t\tarray[index], array[index + 1] = array[index + 1], array[index]\n \t\tend\n \tend\n \tcounter += 1\n \tend\n \tp array\nend",
"def merge_sort(input_array)\n array_length = input_array.length\n if array_length <= 1\n input_array\n else\n left_side = merge_sort(input_array.slice(0, (array_length/2.0).round))\n right_side = merge_sort(input_array.slice((array_length/2.0).round, array_length))\n merge_halves(left_side, right_side)\n end\nend",
"def bubble_sort(array)\n length = array.length\n \n i = 0\n \n while i < length - 1\n j = 0\n while j < length - i - 1\n if array[j] > array[j+1]\n temp = array[j]\n array[j] = array[j+1]\n array[j+1] = temp\n end\n j += 1\n end\n i += 1\n end\n return array\nend",
"def sort2(num_array)\n n = num_array.length - 1\n for i in 0..n\n for j in 0..(n-i-1)\n if num_array[j] >= num_array[j+1]\n num_array[j], num_array[j+1] = num_array[j+1], num_array[j]\n end\n end\n end\n return num_array\nend",
"def bubble_sort(input_array)\n\n # Initialization of variables used for the while loop\n list_is_not_sorted = true\n iteration = 0\n\n # Duplication of the input array to not destroy the input array\n output_array = input_array\n\n # While loop with early stopping function provided by checking if the list is sorted.\n while list_is_not_sorted\n\n # The array processed is reduced of one at each loop because the biggest value will always bubble to the right\n output_pair = iterate_through_array(output_array.first(output_array.length - iteration))\n\n # Adding the values already processed at the end of the processed array\n output_array = output_pair[0] + output_array.last(iteration)\n\n # Checking if at least one sorting action has been done if not the while loop will be cut early \n list_is_not_sorted = output_pair[1]\n\n # Adding one iteration at each loop to feed the array processing reduction function.\n iteration += 1\n end\n return output_array\nend",
"def bubblesort(array)\n array if array.length <= 1\n swap = true\n while swap\n swap = false\n (array.length - 1).times do |x| ## block iterates array.length - 1 times, passing in integers\n ## from 0 to array.length - 1\n if array[x] > array[x+1]\n array[x], array[x+1] = array[x+1], array[x]\n swap = true\n end\n end\n end\n array\n\nend",
"def bubble_sort(unsorted_array)\n\t# Copy the array (arrays are mutable)\n\tsorted_array = Array.new(unsorted_array)\n\t\n\tarray_length = unsorted_array.length\n\t(array_length - 1).times do |num_sorted|\n\t\t(array_length - num_sorted - 1).times do |idx|\n\t\t\tif sorted_array[idx] > sorted_array[idx + 1]\n\t\t\t\tswap(sorted_array, idx, idx + 1)\n\t\t\tend\n\t\tend\n\tend\n\n\tsorted_array\nend",
"def bubble_sort(array)\n arr_length = array.length\n loop do\n swapped = false\n# Compare each number to the next number\n# and if that number is larger than the former, print the larger into the new var called sorted\n (arr_length-1).times do |i|\n \t# Do this x amount of .times and then subtract 1 each time\n if array[i] > array[i+1] # if the array index is greater than the next index then...\n array[i], array[i+1] = array[i+1], array[i] # swap the order of the array's index\n swapped = true\n end\n end\n\n break if not swapped # break once everything is in order.\n end\n array # return an array\nend",
"def bubble_sort (array)\n for j in 0..(array.length)\n for i in 0..(array.length - 2)\n if array[i] > array[i+1]\n max = array[i]\n min = array[i+1]\n array[i] = min\n array[i+1] = max\n end\n end\n end\n array\nend",
"def bubble_sort(array)\r\n #Create a do loop to iterate through the loop\r\n loop do\r\n \t#Make a variable called switch that will switch the numbers as you sort\r\n \t#Set it to false, it will become true if the numbers are not in the right place\r\n switch = false\r\n #MAke a loop inside the other loop\r\n #The length of the array - 1 (To catch last two values as you go through), iterate this many times \r\n (array.length-1).times do |i|\r\n #If the array at the first index is greater value than the one on front of it\r\n if array[i] > array[i+1]\r\n \t#Then it equals one placeholder/index in front/next index spot\r\n \t#It's a larger number and needs to swap\r\n array[i], array[i+1] = array[i+1], array[i]\r\n #Set switch to true\r\n switch = true\r\n #End if statement\r\n end\r\n end\r\n #Break this iteration and go back in line, iterating through if not - switch is false\r\n break if not switch\r\n end\r\n #Return the sorted array\r\n array\r\n #End method\r\nend",
"def bubble_sorting array\r\n#assign length of the array = variable(z)\r\n z = array.length\r\n# like a while loop\r\n loop do\r\n#boolean variable called \"sorted\" = false is when algorithm should exit\r\n# if true keeps looping\r\n sorted = false\r\n#Inside loop check the value of each element and compare it w/ the next one\r\n# how many times it runs = z-1\r\n (z-1).times do |i|\r\n if array[i] > array[i+1]\r\n array[i], array[i+1]=array[i+1], array[i]\r\n#ends loop once sorting = true \r\n sorted = true\r\n end\r\n end\r\n\r\n break if not sorted\r\n end\r\n\r\n array\r\nend",
"def bubble_sort(array)\n return array if array.length <= 1\n swapped = true\n while swapped do\n swapped = false\n 0.upto(array.length - 2) do |i|\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n end\n end\n array\nend",
"def bubble_sort(array)\n swapped = true\n length = array.length-1\n while swapped do\n i = 0\n swapped = false\n while i <length\n n = i +1\n if array[i] > array[n]\n temp = array[i]\n array[i]= array[n]\n array[n] = temp\n swapped = true\n end\n i+=1\n end\n end\n return array\nend",
"def buuble_sort(arr)\n\tloop do\n\t\tloop_break = true\n\t\t(arr.length-1).times do |i|\n\t\tif arr[i]>arr[i+1]\n\t\t\tarr[i], arr[i+1] = arr[i+1], arr[i]\n\t\t\tloop_break = false\n\t\tend\n\t\tend\n\tbreak if loop_break\n\tend\n\tputs arr\nend",
"def bubble_sort(array)\nsorted=false\nwhile sorted==false\nsorted=true\n(0...array.length-1).each do |i|\nif array[i]>array[i+1]\narray[i],array[i+1]=array[i+1],array[i]\nsorted=false\nend\nend\nend\nreturn array\nend",
"def bubble_sort(array)\n\n needs_sorting = true\n\n while needs_sorting\n\n needs_sorting = false\n\n for i in (0..array.length-2)\n # puts \"1: \" + array[i].to_s + \", 2: \" + array[i + 1].to_s\n if array[i] > array[i+1]\n array[i+1], array[i] = array[i], array[i+1]\n needs_sorting = true\n end\n end\n\n end\n\n array\n\nend",
"def bubble_sort(array)\n # get number of elements in array to sort\n array_length=array.length\n # for the first iteration we need to go all the way to the last element of the array\n total_compares_to_do_this_iteration = array_length -1\n \n while total_compares_to_do_this_iteration >=1 \n # start new iteration \n # start at first element \n left_index=0 \n # go to the right, comparing each set of numbers along the way and swapping if necessary; stop when we have reached the last \"already sorted\" element \n while left_index <= (total_compares_to_do_this_iteration -1) do\n if array[left_index] > array[left_index + 1]\n # value on right exceeds value on left, swap\n value1 = array[left_index]\n value2 = array[left_index + 1]\n array[left_index] = value2\n array[left_index + 1] = value1\n end \n # increment left index so that we keep moving to the right for our compares\n left_index += 1 \n end \n # decrement total compares - one less for next iteration since the rightmost value\n # in this iteration has been declared \"sorted\"\n total_compares_to_do_this_iteration = (total_compares_to_do_this_iteration - 1)\n end\n # return array\n array\nend",
"def mothrah_sort (an_array)\n\tdef move_to_end (value, array)\n\t\tarray.delete(value)\n\t\tarray.push(value)\n\tend\n\tpos = 0\n\twhile pos < an_array.length \n\t\tif an_array[pos] > an_array[pos + 1]\n\t\t\tmove_to_end(an_array[pos], an_array)\n\t\telse\n\t\t\tpos += 1\n\t\tend\n\tend\n\tan_array\nend",
"def bubble_sort(array)\n array_length = array.size\n return array if array_length <= 1\n\n loop do\n swapped = false\n (array_length - 1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swapped = true\n end\n end\n break unless swapped\n end\n array\nend",
"def merge_sort(array)\r\n\tif array.length > 1\r\n\t\tleft_array = []\r\n\t\t\t(array.length/2).times { left_array << array.shift }\r\n\t\tright_array = array\r\n\t\tleft_sorted = merge_sort(left_array)\r\n\t\tright_sorted = merge_sort(right_array)\r\n\t\tresult = []\r\n\t\twhile left_sorted.length>0 && right_sorted.length>0\r\n\t\t\tif left_sorted[0] <= right_sorted[0]\r\n\t\t\t\tresult << left_sorted.shift\r\n\t\t\telse\r\n\t\t\t\tresult << right_sorted.shift\r\n\t\t\tend\r\n\t\tend\r\n\t\tif left_sorted.length>0\r\n\t\t\tleft_sorted.each { |e| result << e }\r\n\t\telsif right_sorted.length>0\r\n\t\t\tright_sorted.each { |e| result << e }\r\n\t\tend\r\n\t\treturn result\r\n\telse\r\n\t\treturn array\r\n\tend\r\nend",
"def sort3(array, length)\n\nend",
"def shell_sort(a)\n array = a\n \n m = 1\n while (gap = array.length / (2 ** m)) >= 1\n puts \"gap: #{gap}\"\n 0.step(array.length-1, gap) do |i|\n #puts \"#{i}\"\n # insertion sort\n #puts \" ###{i+gap}\"\n (i+1).upto(i+gap-1) do |j|\n #puts \" #{j}\"\n if array[j] < array[j-1]\n # need to shift everything over until it isn't\n j.downto(i+1) do |k|\n if array[k] < array[k-1]\n array[k], array[k-1] = array[k-1], array[k]\n end\n end\n end\n end\n p a\n end\n \n m += 1\n end\nend",
"def bubble_sort1!(array)\n return nil unless array.all?(array[0].class)\n \n to_be_sorted = array.size - 1\n\n loop do\n new_ending = 0\n \n 0.upto(to_be_sorted - 1) do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n new_ending = i\n end\n end\n to_be_sorted = new_ending - 1\n break if to_be_sorted < 0\n new_ending == nil ? (to_be_sorted -= 1) : to_be_sorted = new_ending\n end\nend",
"def bubble_sort(array)\n begin\n \n swapped = false\n \n array.length.times do |x|\n if x < array.length - 1 && array[x] > array[x+1]\n array[x], array[x+1] = array[x+1], array[x]\n swapped = true\n end\n end\n end while swapped == true\n \n return array\nend",
"def sort(array)\n for index in (1...array.size)\n stored = array[index]\n position = index\n while position > 0 && array[position - 1] > stored\n array[position] = array[position - 1]\n position -= 1\n end\n array[position] = stored\n end\n array\nend",
"def checksorted(array)\n i = 0\n until i > array.length-2 do\n # print array[i]\n if array[i] > array[i+1] then\n array[i], array[i+1] = array[i+1], array[i]\n print array\n next\n end\n print array\n i +=1\n end\n\n end",
"def bubble_sort(array)\n # Create a variable n equal to the array's length\n n = array.length\n # Loop until array's length (n) is less than or equal to 1\n until n <= 1\n # Make new length variable\n new_n = 0\n # Loop through array for 1 to n-1 times\n for i in 1..(n - 1) do\n # If previous element is greater than the next element...\n if array[i - 1] > array[i]\n # Swap the elements\n array[i - 1], array[i] = array[i], array[i - 1]\n # Assign new length to current iteration number\n new_n = i\n end\n end\n # Assign length to the new length\n n = new_n\n end\n # Return sorted array\n p array\nend",
"def ascend_bubble_sort(arr)\n len = arr.length\n until len == 0 \n i = 0\n swap_count = 0\n while i < arr.length - 1\n current_num = arr[i]\n next_num = arr[i +1]\n if current_num > next_num\n arr[i], arr[i +1] = arr[i +1], arr[i] #swap\n swap_count += 1\n #p swap_count #[debugger to check how many swaps are being made]\n end\n i += 1\n end\n if swap_count == 1\n break\n end\n len -= 1\n #p arr #[debugger to check how many times the array is being checked]\n end\n arr\nend",
"def bubble_sort!(array)\n length = array.size\n tail = 0\n loop do \n swapped = false\n element_1, element_2 = 0, 1\n loop do\n if array[element_1] > array[element_2]\n array[element_1], array[element_2] = array[element_2], array[element_1]\n swapped = true\n end\n element_1 += 1\n element_2 += 1\n break if element_2 > length - 1 - tail\n end\n tail += 1\n return array if swapped == false\n end\nend",
"def bubble_sort( array )\n\n #\n # Beginning of Bubble Sort\n #\n iteration = 1\n\n no_swaps = false\n\n until no_swaps # stops when condition becomes true\n\n no_swaps = true\n i = 0\n puts( \"Iteration #{iteration}\" )\n\n while( array.length - 1 > i )\n\n if( array[i+1] > array[i] ) #change this to reverse order\n puts(\"Made a swap with index #{i+1} & #{i}:\")\n\n temp_store = array[i] # smaller value #change this to reverse order\n array[i] = array[i+1] #change this to reverse order\n array[i+1] = temp_store # put smaller value to the left #change this to reverse order\n\n no_swaps = false\n\n puts( array.inspect )\n puts()\n\n end # if\n\n i += 1\n\n end # while\n\n iteration += 1\n\n end # until\n #\n # End of Bubble Sort\n #\n puts(\"Bubble Sort done!\")\n\n return array\n\n\nend",
"def bubble_sort(array)\n (array.size).downto(0) do |stop_index|\n swapped = false\n\n (1...stop_index).each do |index|\n if array[index] < array[index - 1]\n array[index - 1], array[index] = array[index], array[index - 1]\n swapped = true\n end\n end\n\n break unless swapped\n end\n\n array\nend",
"def sort(to_sort)\n # if the array is of length 0 or 1, consider it is already sorted\n if to_sort.length <= 1\n then return to_sort\n end\n\n # otherwise split the remaining elements in two\n # I had to look this line on the web (sourcerefactormycode.com)\n second_array = to_sort.slice!((to_sort.length / 2.0).round..to_sort.length)\n\n # recursive method call on both arrays\n first_sorted_array = sort(to_sort)\n second_sorted_array = sort(second_array)\n\n # merge the two sorted arrays together\n return merge(first_sorted_array, second_sorted_array)\nend",
"def bubble_sort(array)\n n = array.length # assigns array length to variable n\n count = 0\n loop do\n swapped = false # initializes swapped variable as false\n # p \"count = #{count}\" # for visualization\n # p \"array = #{array}\"\n (n-1).times do |i| # for array length - 1 iterate through \n # p \"count = #{count}\" # for visualization\n # p \"array = #{array}\"\n # p \"if #{array[i]} > #{array[i+1]}\"\n if array[i] > array[i+1] # if preceding number is larger\n array[i], array[i+1] = array[i+1], array[i] # swap them and run through again\n swapped = true # marking that action has been taken\n count += 1\n end\n end\n\n break if not swapped\n end\n\n array\nend",
"def bubble_sort array\n\t(0...array.length-1).each do |i|\n\t\t(i+1...array.length).each do |j|\n\t\t\tif array[i]>array[j]\n\t\t\t\tarray[i]=array[i]+array[j]\n\t\t\t\tarray[j]=array[i]-array[j]\n\t\t\t\tarray[i]=array[i]-array[j]\n\t\t\tend\n\t\tend\n\tend\n\tarray\nend",
"def bubble_sort(array)\n\tnum = array.length\n\n\tloop do\n\t\tswapped = false\n\t\t(num-1).times do |i|\n\t\t\tif array[i] > array[i+1]\n\t\t\t\tarray[i], array[i+1] = array[i+1], array[i]\n\t\t\t\tswapped = true\n\t\t\tend \n\t\tend \n\t\tbreak if not swapped\n\tend \n\tarray\nend",
"def bubble_sort(array)\n sorted = false\n while !sorted\n sorted = true\n\n (0...array.length - 1).each do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n sorted = false\n end\n end\n end\n\n array\nend",
"def bubble_sort(arr)\r\n\tchecker = true\r\n\twhile checker\r\n\t\tchecker = false\r\n\t\t0.upto(arr.length-2) do |i|\r\n\t\t\tif arr[i] > arr[i+1]\r\n\t\t\t\tplaceholder = arr[i]\r\n\t\t\t\tarr[i] = arr[i+1]\r\n\t\t\t\tarr[i+1] = placeholder\r\n\t\t\t\tchecker = true\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\treturn arr\r\nend",
"def sort\n limit = array.size\n while limit.positive?\n 0.upto(limit).each do |index|\n next if array[index + 1].nil?\n next unless array[index] > array[index + 1]\n\n array[index], array[index + 1] = array[index + 1], array[index]\n end\n limit -= 1\n end\n array\n end",
"def bubble_sort(array)\n n = array.length\n#loop through array n-1 times\n loop do\n swap = false\n#loop through array one time less than the length\n (n-1).times do |i|\n if array[i] > array[i+1]\n #if the number is greater than the number next to, than swap\n array[i], array[i+1]=array[i+1], array[i]\n swap = true\n end\n end\n\n break if not swap\n end\n\n array\nend",
"def sort(arr)\n for j in 0...arr.size\n for i in 0...arr.size\n break if i > (arr.size - 2)\n arr[i], arr[i+1] = arr[i+1], arr[i] if (arr[i].size > arr[i+1].size)\n end\n end\n arr\nend",
"def bubble_sort(array)\n\t#outer loop keeps track if something was swapped or not\n\tloop do \n\t\tswapped = false\n\t\t#inner loop swaps numbers that aren't in order\n\t\t(array.length-1).times do |i|\n\t\t\t#take each pair of numbers and compare them. Swap if a > b. If so, swapped = true.\n \t\t\tif array[i] > array[i+1]\n \t\t\tarray[i], array[i+1] = array[i+1], array[i]\n\t\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\t\tbreak if not swapped\n\tend\n\tarray\nend",
"def bubble_sort(array)\n i = 0\n while i < array.length\n j = i + 1\n while j < array.length\n swap(array, i, j) if array[j] < array[i]\n j += 1\n end\n i += 1\n end\n array\nend",
"def sort arr\n return arr if arr.length <= 1\n middle = arr.pop\n less = arr.select{|x| x < middle}\n more = arr.select{|x| x >= middle}\n sort(less) + [middle] + sort(more)\nend",
"def bubble_sorter(given_array)\n \n given_array.length.times do\n counter = 1\n while counter < given_array.length do\n \n holder = 0\n \n if given_array[counter - 1] > given_array[counter] \n #puts counter\n holder = given_array[counter]\n given_array[counter] = given_array[counter - 1] \n given_array[counter - 1] = holder\n end\n counter += 1\n end\n end\n\n\n\n\n puts given_array\nend",
"def sort array\n\t\tarray = array.clone\n\t\tfinished = false\n\t\t##\n\t\t# Ok, should be an easy one. Compare the current and next value\n\t\t##\n\t\twhile !finished\n\t\t\t#Flag to track whether an iteration edited the array\n\t\t\twasSorted\t= false\n\t\t\t# Compare value pairs from input array\n\t\t\t(1...array.length).each{|idx|\n\t\t\t\t# Get the target values\n\t\t\t\tcurrentValue\t\t= array[idx]\n\t\t\t\tpreviousValue\t\t= array[idx - 1]\n\t\t\t\t# Figure out if the previous and current value arein the correct order\n\t\t\t\tcurrentVsPrevious\t= @sorter.predict([previousValue, currentValue]).first.round\n\t\t\t\t# If they aren't (as best we know at least), swap the two values\n\t\t\t\tif currentVsPrevious == 0\n\t\t\t\t\tarray[idx]\t\t= previousValue\n\t\t\t\t\tarray[idx - 1]\t= currentValue\n\t\t\t\t\twasSorted\t\t= true\n\t\t\t\tend\n\t\t\t}\n\t\t\t# If no sort action was taken, the array must be sorted.\n\t\t\tfinished = !wasSorted\n\t\tend\n\t\t# Return to caller\n\t\tarray\n\tend",
"def bubble_sort(array)\n sorted = false\n until sorted\n sorted = true\n 0.upto(array.length - 2) do |idx|\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n sorted = false\n end\n end\n end\n array\nend",
"def bubble_sort(array)\n # determine the length of the list\n n = array.length\n # go through each item on list and determine if item is less than or greater than subsequent item\n loop do\n swapped = false\n \n (n-1).times do |i|\n # if item is less than subsequent item, leave as is\n # if item is greater than subsequent item, switch item with subsequent item\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n swapped = true\n end\n \n end\n # stop going through each item on list when all items are less than their subsequent counterparts\n break if not swapped\n end\n # print array\n array\nend",
"def bubble_sort(array)\n sorted = false\n until sorted\n sorted = true\n (array.length-1).times do | index |\n if array[index] > array[index+1]\n array[index], array[index+1] = array[index+1], array[index]\n sorted = false\n end\n end\n end\n array\nend",
"def b_sort(array)\n v = array.length\n loop do\n swap = false\n (v-1).times do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n swap = true\n end\n end\n break if not swap\n end\n p array\nend",
"def bubble_sort(array)\n arr = array\n i = 0\n while i < (arr.length)\n j = 0\n while j < (arr.length - i - 1)\n if arr[j] > arr[j + 1]\n arr[j], arr[j + 1] = arr[j + 1], arr[j]\n end\n j += 1\n end\n i += 1\n end\n\n arr\nend",
"def bubble_sort(array)\r\n\t\tnum = array.length\r\n\t\tloop do \r\n\t\t\tswapp = false\r\n\t\t\t(num-1).times do |i|\r\n\t\t\t\t\t\t\tif array[i] > array[i+1]\r\n\t\t\t\t\t\t\t\tarray[i], array[i+1] = array[i+1], array[i]\r\n\t\t\t\t\t\t\t\tswapp = true\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tbreak if not swapp\r\n\t\tend\r\n\t\tarray\r\n\tend",
"def bubble_sort(array)\n# Create a variable equal to the array length\nn = array.length\n loop do\n # Perform a loop:\n # Create a variable 'swapped' that is equal to false; we will set it to true after the pair of values has been swapped.\n swapped = false\n # For each item in the array,\n (n-1).times do |i|\n # If the item is greater than the item whose index is one larger than it,\n if array[i] > array[i+1]\n # Switch the indexes of the two items,\n array[i], array[i+1] = array[i+1], array[i]\n # and set swapped equal to true.\n swapped = true\n end\n end\n\n break if not swapped\n end\n\n # Return the array.\n array\nend",
"def shell_sort(a)\n n = a.length # Size of input\n h = 1\n h = h * 3 + 1 while h < n / 3\n\n while h >= 1\n i = h\n while i < n\n j = i\n while j >= h && a[j] < a[j - h]\n temp = a[j - h]\n a[j - h] = a[j]\n a[j] = temp\n\n j -= h\n end\n i += 1\n end\n h = (h / 3).to_i\n end\n a\nend",
"def sort arr\n return arr if arr.length <= 1\n middle = arr.pop\n lesss = arr.select{|x| x < middle}\n more = arr.select{|x| x>= middle}\n\n sort(less) + [middle] + sort(more)\nend",
"def bubble_sort(array)\n\tn = array.length + 1\n\tloop do \n\t\tswapping = false \n\t\t(n-1).times do |i|\n\t\t\tif i > 0 && array[i] < array[i - 1]\n\t\t\t\tarray[i - 1], array[i] = array[i], array[i - 1]\n\t\t\t\tswapping = true\n\t\t\tend\n\t\tend \n\t\tbreak if not swapping\n\tend\n\tarray \nend",
"def bubbleSort(array)\n\tarray.each_index do |index|\n\t\tstart = 0\n\t\twhile(start < array.length - 1)\n\t\t\tif array[start]>array[start + 1]\n\t\t\t\ttemp = array[start + 1]\n\t\t\t array[start + 1 ] = array[start]\n\t\t\t array[start]= temp\n\t\t\tend \n\t\t\tstart += 1\n end\n end \t\n return array\t\nend",
"def sort_array(array)\n n = array.size\n return array if n < 2\n (0..n - 2).each do |i|\n (i + 1..n - 1).each do |j|\n next if array[i].even? || array[j].even?\n interchange(array, i, j) if array[i] > array[j]\n end\n end\n array\nend",
"def sort(arr)\n return arr unless arr.size > 1\n\n mid = arr.size / 2\n left, right = sort(arr[0...mid]), sort(arr[mid..-1])\n\n merge(left, right)\nend",
"def bubble_sort!(array)\n loop do\n done = true\n idx = 0\n loop do\n if array[idx] > array[idx + 1]\n array[idx], array[idx + 1] = array[idx + 1], array[idx]\n idx += 1\n done = false\n else\n idx += 1\n end\n break if idx == array.size - 1\n end\n break if done == true\n end\n array\nend",
"def sorting(array)\n #set a variable equal to the length of the array\n n = array.length\n\n #create main loop and set a variable equal to false. This variable will break the loop once all the swaps have been made\n loop do\n swapped = false\n\n #create a times loop\n (n-1).times do |i|\n if array[i] > array[i+1]\n switch = array[i+1] #store element to be swapped in a temporary variable\n array[i+1] = array[i]\n array[i] = switch\n swapped = true #if a swap happens then break variable becomes true. Either way, the .times loop will happen again until i reaches n-1\n end\n end\n\n #once .times loop ends\n break if !swapped\n end\n\n array\nend",
"def bubble_sort(array)\n sorted = false\n until sorted\n sorted = true\n\n (0...array.length - 1).each do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n sorted = false\n end\n end\n end\n\n array\nend",
"def sort arr\n return arr if arr.length <= 1\n \n middle = arr.pop\n less = arr.select{|x| x < middle}\n more = arr.select{|x| x >= middle}\n\n sort(less) + [middle] + sort(more)\nend",
"def sort arr\n return arr if arr.length <= 1\n \n middle = arr.pop\n less = arr.select{|x| x < middle}\n more = arr.select{|x| x >= middle}\n\n sort(less) + [middle] + sort(more)\nend",
"def bubble_sort(array)\r\n\tn = array.length\r\n\r\n\tloop do #going to keep going until swapped is false\r\n\t\tswapped = false\r\n\t\t# we run this one less time than the amount of elements in the array\r\n\t\t# because there is no element after the last element in the array.\r\n\t\t(n-1).times do |i|\r\n\t\t\tif array[i] > array[i + 1]\r\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]\r\n\t\t\t\tswapped = true\r\n\t\t\tend\r\n\t\tend\r\n\t\tbreak if not swapped\r\n\tend\r\n\tarray\r\nend",
"def merge_sort(array)\n return array if array.length == 1\n\n mid_index = array.length / 2\n end_index = array.length - 1\n\n left_half = array[0..mid_index - 1]\n right_half = array[mid_index..end_index]\n\n left_half_sorted = merge_sort(left_half)\n right_half_sorted = merge_sort(right_half)\n\n sorted = []\n until left_half_sorted.empty? || right_half_sorted.empty?\n sorted << (left_half_sorted.first < right_half_sorted.first ? left_half_sorted.shift : right_half_sorted.shift)\n end\n sorted + left_half_sorted + right_half_sorted\nend",
"def bubblesort(array)\n swapped = true\n length = array.length-1\n while swapped do\n i = 0\n swapped = false\n while i <length\n n = i +1\n if array[i] > array[n]\n dummy = array[i]\n array[i]= array[n]\n array[n] = dummy \n swapped = true\n end\n i+=1\n end\n end\n return array\nend",
"def bubble_sort(array)\n\n (0..array.size-1).each do |i|\n (i..(array.size-1)).each do |j|\n if array[i] > array[j]\n temp = array[i]\n array[i] = array[j]\n array[j] = temp\n end\n end\n end\n array\nend",
"def bubble_sort!(array)\r\n swap = false\r\n restrict = array.length - 1 # index of the last element\r\n\r\n (array.length-1).times do \r\n array.each_with_index do |_, index|\r\n break if index == restrict # optimization for the tail elements as well as avoiding \"out-of-index exception\"\r\n if array[index] > array[index + 1]\r\n array[index], array[index + 1] = array[index + 1], array[index]\r\n swap = true\r\n end\r\n end\r\n\r\n break if !swap\r\n\r\n swap = false # reset swap to false to check the next time if something is swapped\r\n restrict -= 1 # tail elements restricted for optimization\r\n end\r\n array\r\nend",
"def sort arr\r\n\treturn arr if arr.length <= 1\r\n\r\n\tmiddle = arr.pop\r\n\tless = arr.select{|x| x < middle}\r\n\tmore = arr.select{|x| x >= middle}\r\n\r\n\tsort(less) + [middle] + sort(more)\r\nend",
"def bubble_sort(array)\n\n\t swaped = false \n\t array[0...-1].each_with_index do |element, i|\n\t \t if element > array[i+1]\n\t \t\tarray[i], array[i+1] = array[i+1], array[i]\n\t \t\tswaped = true\n\t \t end\n\t end \n\n\t bubble_sort(array) if swaped\nend",
"def sort(arr)\n return arr if arr.length < 1\n\n pivot = arr.pop\n less = arr.select { |item| item < pivot}\n more = arr.select { |item| item >= pivot}\n\n sort(less) + [pivot] + sort(more)\nend",
"def bubble_sort(array)\n\tindex = array.length - 1\n\tloop do \n\t\tsorted = false\n\t\tindex.times do |i|\n\t\t\tif array[i] > array[i + 1]\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i]\n\t\t\t\tsorted = true\n\t\t\tend\n\t\tend\n\t\tbreak if not sorted\n\tend \n\tarray\nend",
"def bubble_sort(array)\n\t\tarr = array.length\n\t\n\tloop do\t\n\t\tswap_num = false\n\t\t(arr - 1).times do |i|\n\t\t\tif array[i] > array[i + 1]\n\t\t\t\tarray[i], array[i + 1] = array[i + 1], array[i] #swapping them out\n\t\t\t\tswap_num = true\n\t\t\tend\n\t\tend\n\t\tbreak if not swap_num\n\t\t\n\tend\n\tp array\nend",
"def bubble_sort!(array)\n size = array.size\n loop do\n exchange_made = false\n 0.upto(size - 2) do |index|\n if array[index] > array[index + 1]\n temp = array[index + 1]\n array[index + 1] = array[index]\n array[index] = temp\n exchange_made = true\n end\n end\n break unless exchange_made\n end\n \n array\nend",
"def bubble_sort(array)\n\n # set variables\n i = 0\n swapped = false\n\n# initiate a loop\n while i < array.length - 1\n # set up temporary variables to hold array items\n a = array[i]\n b = array[i+1]\n # if a and b are in the correct order...\n if a < b || a == b\n i += 1\n else # if a and b are in an incorrect order...\n array[i] = b\n array[i+1] = a\n swapped = true\n i += 1\n end\n # Is sorting complete (swapped remains false)? If any were in an incorrect order, rerun bubble_sort on array\n if swapped\n bubble_sort(array)\n end\n end\n # return array\n array\nend",
"def bubble_sort(array)\n return array if array.length < 2\n (0...array.count - 1).each do |i|\n if array[i] > array[i + 1]\n array[i], array[i + 1] = array[i + 1], array[i]\n end\n end\n bubble_sort(array[0...-1]) + [array.last]\nend",
"def bubble_sort(array)\n i = array.length\n while (i > 0) do\n for j in 0...i-1 do\n if array[j] > array[j+1]\n array[j], array[j+1] = array[j+1], array[j]\n end\n end\n i -= 1\n end\n return array\nend",
"def sort\n\n arr_len = @data.length\n start_build_idx = arr_len / 2 - 1 # The last half of the array is just leaves\n\n for i in (start_build_idx).downto(0)\n\n max_heapify(@data, arr_len, i) # Build the heap from the array\n end\n\n for i in (arr_len-1).downto(0)\n\n swap(@data, i, 0) # Move the current root to the end of the array\n max_heapify(@data, i, 0) # Heapify the remaining part of the array excluding the root which was just sorted to the end\n end\n\n puts(@data)\n end",
"def sortarray (sort_me)\n counter = sort_me.length\n a = 0\n b = 1\n while a < (counter-1)\n b = a+1\n while b < (counter)\n if sort_me[a] > sort_me[b]\n temp = sort_me[a]\n sort_me[a] = sort_me[b]\n sort_me[b] = temp\n end\n b += 1\n end\n a += 1\n end\n return sort_me\nend",
"def quick_sort(arr)\n return arr if arr.length <= 1\n\n ref = arr.shift\n left = quick_sort(arr.select{|x| x.length <= ref.length})\n right = quick_sort(arr.select{|x| x.length > ref.length})\n\n left + [ref] + right\nend",
"def bub_sort(array)\n l = 1\n pairs = 0\n while l != array.length\n pairs += (array.length-l)\n l += 1\n end\n count = 0\n while count < pairs\n index = 0\n n = 0\n while index < array.length - n\n if array[index] > array[index+1]\n low = array[index+1]\n high = array[index]\n array[index] = low\n array[index+1] = high\n index += 1\n count += 1\n else\n index += 1\n count += 1\n end\n end\n n += 1\n puts array\n\n end\nend",
"def quick_sort(array)\n return array if array.length <= 1\n\n pivot = array[0]\n left = []\n right = []\n\n array[1..-1].each do |el|\n if el.length < pivot.length\n left << el\n else\n right << el\n end\n end\n\n dom_oct(left) + [pivot] + dom_oct(right)\n\nend",
"def bubble_sort(array)\n\tn = array.length\n\n\tloop do \n\n\tswapped = false\n\n\t(n-1).times\tdo |i|\n\t\tif array [i] > array [i + 1]\n\t\t\tarray[i], array[i+1] = array[i + 1], array[i]\n\t\t\tswapped = true\n\t\t\tend\n\t\tend\n\n\t\tbreak if not swapped\n\tend \n\t\n\tarray\nend"
] |
[
"0.7949869",
"0.78888434",
"0.7711308",
"0.7576027",
"0.75648993",
"0.7468106",
"0.7464556",
"0.7464556",
"0.7444162",
"0.74379086",
"0.74335575",
"0.7386587",
"0.73791",
"0.7361151",
"0.73464066",
"0.7323018",
"0.7317064",
"0.72933924",
"0.72894126",
"0.7288337",
"0.7258595",
"0.72473055",
"0.72364897",
"0.7234356",
"0.72313625",
"0.72290754",
"0.7226127",
"0.72233486",
"0.7223148",
"0.72228324",
"0.7219579",
"0.72156686",
"0.7212088",
"0.7199423",
"0.71898127",
"0.71819115",
"0.71760696",
"0.71742237",
"0.7160274",
"0.71573925",
"0.7156387",
"0.7150331",
"0.71467865",
"0.7140676",
"0.71323884",
"0.71315664",
"0.71287584",
"0.7122446",
"0.7119466",
"0.7113216",
"0.711298",
"0.7085702",
"0.70825064",
"0.708248",
"0.7081873",
"0.7080958",
"0.70775414",
"0.7076202",
"0.706516",
"0.7064761",
"0.70632184",
"0.7062524",
"0.7055029",
"0.7053765",
"0.7052031",
"0.7048982",
"0.70449173",
"0.7040889",
"0.7034295",
"0.7025248",
"0.70225114",
"0.7019397",
"0.7016102",
"0.7013002",
"0.7012281",
"0.70117617",
"0.7011352",
"0.70097464",
"0.7009021",
"0.70074993",
"0.70074993",
"0.7003513",
"0.69995517",
"0.6994787",
"0.6994481",
"0.6993791",
"0.6992727",
"0.699064",
"0.6978693",
"0.6977732",
"0.69765556",
"0.69711155",
"0.6970972",
"0.69700867",
"0.6968879",
"0.6968054",
"0.6960723",
"0.69593495",
"0.69560367",
"0.69549",
"0.6948654"
] |
0.0
|
-1
|
read_in returns the file as an array
|
def read_in
File.foreach(file_name).map(&:chomp)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def _read filename\n d = []\n File.open(filename).each { |line|\n d << line\n }\n return d\n end",
"def read_input\n ary = []\n File.open('./input.txt', 'r') do |file|\n file.each do |line|\n ary << line.to_s\n end\n end\n\n ary.freeze\nend",
"def read_input_file(input_path)\n all_lines = []\n\n File.open(input_path, \"r:UTF-8\") do |file|\n while (line = file.gets)\n all_lines += [line]\n end\n end\n\n all_lines\nend",
"def load\n arr = []\n begin\n while(!@file.eof?)\n line = @file.readline.chomp\n arr.concat(line.split)\n end\n ensure\n @file.close\n end\n arr\n end",
"def read_file(fname=nil)\n return if fname.nil?\n # Array we use to store entries\n lines = Array.new\n ah_data = Array.new\n # Deal with DOS line endings by reading in file, then manually splitting on DOS line ending\n File.open(fname).each_line do |line|\n lines = line.split(/\\r\\n?/).map(&:chomp)\n end\n return lines\nend",
"def get_from_file(path)\n\n array = []\n file = File.open(path)\n if file != nil\n array = file.readlines.map(&:chomp) # Discard the final '\\n'\n file.close\n end\n\n return array\n\nend",
"def get_file_array(path)\n array = []\n File.open(path) do |f|\n f.each_line do |line|\n array.push(line)\n end\n end\n return array\nend",
"def open_file (file)\r\n \r\n data = Array.new\r\n input = File.new(file, \"r\")\r\n input.gets\r\n while line = input.gets # gets each line of the file\r\n line.chomp! # deletes \\n\r\n data << line\r\n end\r\n input.close\r\n \r\n return data\r\n \r\nend",
"def file_to_array file\n lines = []\n File.open(file, \"r\") do |infile|\n while (line = infile.gets)\n lines.push(line.gsub(\"\\n\", \"\").rstrip)\n end\n end\n lines\n end",
"def read\n @input_files.each do |file|\n if File.exist? file\n input_data[file] = File.read(file)\n end\n end\n nil\n end",
"def read_file(path)\n file_contents = []\n File.open(path).each { |line| file_contents << line }\n\n file_contents\n end",
"def q1_read_to_array(data_file_name)\r\n array2d = []\r\n \r\n read_file(\"data/\"+data_file_name).each{ |line|\r\n array1d = line.split(\",\").map(&:strip).map(&:to_s)\r\n array2d << array1d\r\n }\r\n return array2d\r\nend",
"def get_file_as_string_array\n file = (\"#{File.dirname(__FILE__)}/../data/seed.txt\")\n string_array = []\n \n File.open(file, 'r') do |f|\n f.each_line do |line|\n string_array << line\n end\n end\n \n string_array\n end",
"def read_file\n \t@readin = []\n file = File.open(@filename[@file_count], 'r')\n\t @readin = file.each.to_a\n\t # chop off the escaped characters (in this case: \\r\\n)\n @readin.map! {|s| s.chomp}\n # increment the file count\n @file_count += 1\n file.close\n # determine which file was read in\n # the files either have a \"W\" (for power) or \"Wh\" as the first line\n \tif @readin[0] =~ /Wh/\n \t\tparse_energy\n \telse @readin[0] =~ /W/\n \t\tparse_power\n \tend\n end",
"def take_input\n pp File.open('input.txt').read.split\n end",
"def read file\n File.open file\n end",
"def read_input(file_name)\n file = File.open(file_name)\n input_data = file.read\n lines = 0\n data = []\n input_data.each_line do |line|\n i = Integer(line.chomp!)\n data << i\n end\n puts \"input_data length = #{input_data.length} lines = #{data.length}\"\n data\nend",
"def read_input_file\n gridfile_name = ARGV[0]\n # puts gridfile_name\n grid_data = File.read(gridfile_name).split\nend",
"def read\n IO.readlines(@sieve_path)\n rescue\n return []\n end",
"def read_file_to_arr(path)\n ret = []\n File.open(path, \"r\") do |f|\n f.each_line do |line|\n ret << line.split(\" \").map { |s| s.to_i}\n end\n end\n return ret\nend",
"def read_input_file\n text = nil\n File.open(input_filename, \"r\") do |file|\n text = file.read\n end\n text\n end",
"def read_input_file\n gridfile_name = ARGV[0]\n puts gridfile_name\n grid_data = File.read(gridfile_name).split\nend",
"def import_ori(file_path)\n string = IO.read(file_path)\n array = string.split(\"\\n\")\n array.shift\n return array\n end",
"def read_loaded_txt_file_to_array(file)\n\ttext_array = file.read.split(\",\")\nend",
"def read(files); end",
"def read(files); end",
"def load_file(path)\n file_array = IO.readlines(path)\n file_array.map {|element| element.chomp}\nend",
"def grab_input(input, file = false)\n\tinput = File.read(input) if file\n\tinput.split(\"\\n\").map { |orders| orders.split(',') }\nend",
"def getFileContent(dir, file):Array\n arr = Array.new\n File.open(\"#{dir}/#{file}\", \"r\").each do |line|\n arr.push line\n end\n arr\n end",
"def read_file(filename); end",
"def read\n file.read\n end",
"def my_file_reader(fname)\n fstream = File.open(fname, 'r')\n data = fstream.read\n fstream.close\n \n return data\nend",
"def read_from_file\n begin\n File.open(@file) do |file|\n file.each_line {|line| @data_for_output << line}\n end\n rescue Errno::ENOENT => e\n puts e\n exit\n end\n end",
"def read(file)\n begin\n if file.class == String\n f = File::open(file)\n else\n f = file\n end\n f.each_line do |line|\n input(line.strip)\n end\n ensure\n f.close\n end\n end",
"def read_contents\n\t\treturn File.open(self.file_name).read.lines.map(&:chomp) if self.file_name\n\tend",
"def read\n file\n end",
"def get_input_from_file(file_name)\n\t\tabort \"Could not locate file: #{file_name}\" unless File.exists?(file_name)\n\t\tfile_input = File.read(file_name)\n\n\t\treturn file_input\n\tend",
"def readFile(fileName)\n if File.file?(fileName)\n return File.read(fileName).split(/\\n/)\n else\n return \"\"\n end \nend",
"def read_file(file_name=\"\")\n\tFile.open(file_name) do |file|\n\t\twhile line = file.gets\n\t\t\ta = %w{#{line}}\n\t\t\tputs a\n\t\t\tputs line\n\t\tend\n\tend\nend",
"def read(file)\n if @options[:input_file]\n file = File.join(File.dirname(@options[:input_file]), file)\n end\n File.read(file)\n end",
"def readlines\n lns = infile.readlines.map(&:strip)\n infile.close unless infile.tty?\n lns\n end",
"def read_file(file_name)\n file = File.open(file_name, \"r\")\n data = file.read\n file.close\n return data\nend",
"def read\n @read ||= File.read(path)\n end",
"def read_data_file(path); end",
"def readfile(path, opt={})\n if File.readable?(path)\n bin = File.read(path).utf8!\n [bin, bin.former_enc ||'ascii-8bit' ]\n else\n raise ArgumentError.new(\"File is not readable!\")\n end\n end",
"def read_file\n\t\tif @filename == \"\"\n\t\t\t@text = [\"\"]\n\t\t\treturn\n\t\telse\n\t\t\tif File.exists? @filename\n\t\t\t\ttext = IO.read(@filename)\n\t\t\telse\n\t\t\t\t@text = [\"\"]\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\t\t# get rid of crlf\n\t\ttemp = text.gsub!(/\\r\\n/,\"\\n\")\n\t\tif temp == nil\n\t\t\t@eol = \"\\n\"\n\t\telse\n\t\t\t@eol = \"\\r\\n\"\n\t\tend\n\t\ttext.gsub!(/\\r/,\"\\n\")\n\t\t@text = text.split(\"\\n\",-1)\n\tend",
"def get_multi_line_input_int_arr(original_filename)\n get_input_str_arr(original_filename).map(&:to_i)\nend",
"def read_file(file)\n File.read(file)\nend",
"def readFile(input)\n\t\tmain=[]\n\t\tentryList=[]\n\t\tinputFileObj=File.open(input, \"r\")\n\t\tinputFileObj.readlines.each do |x|\n\t\t\tentryList<<(x)\n\t\tend\n\t\tentryList.each do |x|\n\t\t\tline=Array.new()\n\t\t\tobj=x.split(\" \")\n\t\t\tobj.each do |x|\n\t\t\t\tline<<(x)\n\t\t\t\tif $hashMain[x].nil?\n\t\t\t\t\t$hashMain[x]=1\n\t\t\t\telse\n\t\t\t\t\t$hashMain[x]+=1\n\t\t\t\tend\n\t\t\tend\n\t\t\tmain<<(line)\n\t\tend\n\t\treturn main\n\tend",
"def read_data(file_name)\n file = File.open(file_name,\"r\")\n object = eval(file.gets.untaint.encode('UTF-8', :invalid => :replace, :replace => '').gsub('\\n', \"\"))\n file.close()\n return object\nend",
"def get_single_line_input_int_arr(original_filename, separator: ',')\n get_input_str(original_filename).split(separator).map(&:to_i)\nend",
"def input_file(file)\n inputs = []\n t = -1\n i = 0\n f = File.new(file)\n f.each_line do |line|\n if t == -1\n t = line.to_i\n else\n if i < t\n inputs << line\n i += 1\n end\n end\n end\n return inputs\nend",
"def input_file(file)\n inputs = []\n t = -1\n i = 0\n f = File.new(file)\n f.each_line do |line|\n if t == -1\n t = line.to_i\n else\n if i < t\n inputs << line\n i += 1\n end\n end\n end\n return inputs\nend",
"def read(path); end",
"def read_file\n match_file = File.new(\"matches.txt\", \"r\")\n no_of_match = match_file.gets\n if no_of_match != nil\n for i in 0..no_of_match.to_i - 1\n match_result = match_file.gets\n @matchesarr << match_result\n end\n end\n match_file.close\n end",
"def read(*args) IO.read(path, *args) end",
"def input\n STDIN.read.split(\"\\n\")\nend",
"def read\n return nil if FileTest.exist?(@fname)==false\n\n open(@fname,\"rb\") do |file| #Read & Binary mode\n @data = Marshal.load(file)\n end\n @data\n end",
"def get_file_contents(file_path)\n input_file = File.open(file_path, 'r')\n input_file_contents = input_file.read\n input_file.close\n input_file_contents.split(\"\\n\")\n end",
"def readFile(fname)\n\tinf = File.new(fname, \"r\")\n\tret = inf.read()\n\tinf.close\n\treturn ret\nend",
"def read_binary(file); end",
"def read_file pn\n pn.readlines.map(&:chomp)\n .each do |line|\n @entries.add line, pn\n end\n end",
"def load_sample_data\n\tbegin # try to load the file\n\t\t# open the file and create an array to hold it\n\t\tsample_data_file = File.open($sample_data_filename)\n\t\tsample_contents = Array.new{Array.new}\n\t\ti = 0\n\t\t# add the contents of the file to the two-dimensional array\n\t\tsample_data_file.each do |line|\n\t\t\tsample_contents[i] = line.split(\",\").map(&:strip)\n\t\t\ti += 1\n\t\tend\n\t\treturn sample_contents\n\trescue # catch exceptions\n\t\tabort \"Unable to continue - sample data file #{$sample_data_filename} not found.\"\n\tend\nend",
"def read_file(filename)\n file = File.open(filename, 'r')\n data = file.read\n file.close\n data\nend",
"def readFile()\n\t#This is assuming the file name will be used\n\tfilename = 'names-data.txt'\n\topen(filename, 'r') {|f| f.read}\nend",
"def readlines(eol=$/)\n ary = []\n ary << line while line = self.gets(eol)\n ary\n end",
"def read_file(path)\n File.read(path)\n end",
"def read_file(file)\n lines = []\n IO.foreach(find(file)) do |line|\n lines << line.strip unless line.strip == ''\n end\n lines\n end",
"def parse_input(input_file); end",
"def parse_input(input_file); end",
"def read_todos(filename)\n File.readlines(filename)\nend",
"def read_data(file_name)\n file = File.open(file_name,\"r\")\n object = eval(file.gets)\n file.close()\n return object\nend",
"def read_input(file_name)\n\n all_inputs = Array.new\n file = File.open(file_name)\n input_data = file.read\n input_data.each_line do |line|\n #next if line.start_with?('#')\n #next if line.chomp.empty?\n input = line.chomp.strip\n all_inputs << input\n end\n return all_inputs[0]\nend",
"def load_list filename\n\tlist = []\n\tbegin\n\t\topen filename do |f|\n\t\t\tuntil (line = f.gets).nil?\n\t\t\t\tnext if line.strip.empty?\n\t\t\t\tlist << line.strip\n\t\t\tend\n\t\tend\n\trescue Errno::ENOENT\n\tend\n\tlist\nend",
"def readList # read the list file and return an array\n array_list = []\n i = 0\n File.open(\"list.txt\").readlines.each do |line|\n array_list[i] = line\n i += 1\n end\n array_list\nend",
"def read_file(file)\n File.read(file)\n end",
"def read_file(file)\n File.read(file)\n end",
"def readlines(*args) IO.readlines(path, *args) end",
"def parse_input (input_file)\nend",
"def read\n return unless ::File.exist?(@file)\n\n @data = Bencode.decode(::File.read(@file))\n end",
"def read_m\n Integer(@file.gets)\n end",
"def get_data_from_file(file)\r\n f = File.open(file, \"r\")\r\n gene = Array.new\r\n f.each_line do |line|\r\n gene << line.delete(\"\\n\") # We remove end of line \\n \r\n end\r\n return gene\r\nend",
"def read_file\n file = File.new(\"/tmp/cipher1.txt\", \"r\")\n text = Array.new()\n line = file.gets\n line.chomp!()\n line.split(/,/).each {\n | num |\n text.push(Integer(num))\n }\n file.close\n return text\nend",
"def read_keys_file(path)\n return [] unless File.exists?(path)\n File.readlines(path).map! { |l| l.chomp.strip }\n end",
"def readlines(src_path)\n if File.exist?(src_path) && !File.directory?(src_path)\n File.readlines(src_path)\n else\n []\n end\n end",
"def read_file(file)\r\n\tlines = IO.readlines(file)\r\n\tif lines != nil\r\n\t\tfor i in 0 .. lines.length-1\r\n\t\t\tlines[i] = lines[i].sub(\"\\n\",\"\")\r\n\t\tend\r\n\t\treturn lines[0..lines.length-1]\r\n\tend\r\n\treturn nil\r\nend",
"def read\n data = []\n\n File.open(@source) do |file|\n while line = file.gets\n data.push(Hash[@columnNames.zip(line.split(' '))])\n end\n end\n\n data\n end",
"def load_array\n #return if $valid_array\n $valid_array = false\n @data = []\n File.open(@app_file_path).each do |line|\n row = line.chomp.split( @app_delim ) \n @data << row\n end\n $valid_array = true\n end",
"def read_input(file_name)\n file = File.open(file_name)\n input_data = file.read\n lines = 0\n data = []\n input_data.each_line do |line|\n #data << Integer(line.chomp)\n data << line.chomp\n end\n puts \"input_data lines = #{data.length} num_bits = #{data[0].length}\"\n data\nend",
"def input\n @input ||= reader.read\n end",
"def read_input_file\n\t\tbegin \n\t\t\tfile = File.read('data.json')\n\t\t\tjson_info = JSON.parse(file)\n\t\t\t\n\t\t\t#getting cars and rentals information\n\t\t\t@cars = json_info[\"cars\"]\n\t\t\t@rentals = json_info[\"rentals\"]\n\t\trescue Exception => e \n\t\t\tputs \"Error trying to read the input file!\" \n\t\t\tputs e.message\n\t\tend\n\tend",
"def readFile(filename)\n f = java.io.File.new(filename)\n return java.util.ArrayList.new() unless f.exists()\n fis = java.io.FileInputStream.new(f)\n dis = java.io.DataInputStream.new(fis)\n # Read count of regions\n count = dis.readInt()\n regions = java.util.ArrayList.new(count)\n index = 0\n while index < count\n regions.add(HRegionInfo.parseFromOrNull(Bytes.readByteArray(dis)))\n index = index + 1\n end\n dis.close()\n return regions\nend",
"def read_file filename\n\t\tbegin\t \n\t\t\tfile = File.new(filename, \"r\")\n\t\t\tline_number = 1\n\t\t file.each do |line|\t\t \t\n\t\t \tself.read_input_line line, line_number\n\t\t \tline_number += 1\n\t\t end\t \n\t\trescue => err\n\t\t puts \"File not loaded: #{err}\"\n\t\t err\n\t\tensure file.close if file end\n\tend",
"def read_text(filename); end",
"def q3_read_to_array(data_file_name)\r\n orders = []\r\n \r\n h = q3_read_to_hash(data_file_name)\r\n h.each_pair { |k,v| orders << v }\r\n \r\n return orders\r\nend",
"def readlines(src_path)\n if File.exist?(src_path) && !File.directory?(src_path)\n File.readlines(src_path)\n else\n []\n end\n end",
"def read_lines\n File.read(@document_file).split(\"\\n\")\n end",
"def read_file(file)\n\tlines = IO.readlines(file)\n\tif lines != nil\n\t\tfor i in 0 .. lines.length-1\n\t\t\tlines[i] = lines[i].sub(\"\\n\",\"\")\n\t\tend\n\t\treturn lines[0..lines.length-1]\n\tend\n\treturn nil\nend",
"def readlines(*args)\n IO.readlines(@path, *args)\n end",
"def read(*args)\n IO.read(@path, *args)\n end"
] |
[
"0.7229379",
"0.7203641",
"0.7145829",
"0.7018414",
"0.701738",
"0.6934913",
"0.69124293",
"0.6893728",
"0.68787366",
"0.6861761",
"0.6787055",
"0.6716616",
"0.6702938",
"0.66436106",
"0.6636006",
"0.6630562",
"0.6575508",
"0.65720767",
"0.6569631",
"0.6548059",
"0.65473473",
"0.6543085",
"0.6540986",
"0.65244615",
"0.6499346",
"0.6499346",
"0.64799464",
"0.64525086",
"0.64445573",
"0.6432771",
"0.6404886",
"0.6324084",
"0.63236064",
"0.63236046",
"0.6318202",
"0.6310932",
"0.63089746",
"0.63076794",
"0.63038915",
"0.6274005",
"0.62724626",
"0.6271693",
"0.6258902",
"0.6257266",
"0.625468",
"0.62545824",
"0.6248013",
"0.6232025",
"0.6225606",
"0.62236327",
"0.62118644",
"0.6207526",
"0.6207526",
"0.620463",
"0.620193",
"0.6164097",
"0.6141891",
"0.6128422",
"0.61234987",
"0.61181444",
"0.6118042",
"0.61153924",
"0.61045843",
"0.60990214",
"0.60923386",
"0.6084357",
"0.6081575",
"0.60703456",
"0.60665023",
"0.60665023",
"0.60305446",
"0.6029123",
"0.6028891",
"0.6025991",
"0.6018333",
"0.60035336",
"0.60035336",
"0.6001112",
"0.60004735",
"0.59869576",
"0.5985894",
"0.598356",
"0.5977205",
"0.5973093",
"0.59704584",
"0.5964998",
"0.59594184",
"0.59531",
"0.59523255",
"0.59436953",
"0.59371585",
"0.5935899",
"0.5934667",
"0.5932416",
"0.5930719",
"0.5926691",
"0.5926298",
"0.59165424",
"0.59070295",
"0.58959675"
] |
0.7587839
|
0
|
write_out Args write out rows into file
|
def write_out(rows)
File.open(file_name, 'w') do |f|
f.puts rows
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def write_output\n rows = data_to_rows\n CSV.open(@filename, 'wb') do |csv|\n rows.each {|row| csv << row}\n end\n end",
"def writeOut\n\t\t\n\tend",
"def write_file(*args)\n end",
"def write_csv filename, fields = nil\n\n # By default all fields present in every row of output_data will be incorporated.\n if fields.nil?\n # Transform each output struct into a list of its keys, then take the intersection of each Array of keys.\n # This ensures that only fields present for all rows will be incorporated.\n fields = output_data.map{|o| o.to_h.keys}.inject do |last_keys, this_keys|\n last_keys & this_keys\n end\n end\n\n CSV.open filename, \"wb\", row_sep: \"\\r\\n\" do |csv|\n # Header line\n csv << fields\n\n output_data.each do |out|\n output_row = []\n fields.each do |field|\n output_row << out[field]\n end\n csv << output_row\n end\n end\n end",
"def write(*args)\n @writer.<<(*args) if @writer\n end",
"def write(data)\n @output_row << data\n end",
"def put\n\t\tif @out_file_kind == :sqlite3\n\t\t\tRecordsDatabase.open(@out_file) do |db|\n\t\t\t\tdb.insert_records(@out_items)\n\t\t\tend\n\t\telse\n\t\t\tFile.open(@out_file, \"a\") {|fp| fp.puts to_csv(@out_items)}\n\t\tend\n\t\t#Puts log lines to log file.\n\t\tFile.open(@log_file, \"a\") {|fp| fp.puts @log_lines}\n\tend",
"def write(out)\n out.puts @parts.join(' ')\n end",
"def file_output output_lines, friend\n # using 'write_to' method with given parameters\n write_to \"#{friend}.txt\" do |file|\n file.write output_lines[0]\n file.write output_lines[1]\n end\nend",
"def write(output_to); end",
"def write_file(out_file, output)\n File.open(out_file, 'w') { |f| output.each { |l| f.write(\"#{l}\\n\") } }\n end",
"def writeTable(outf, db)\n fieldNames = db.fields\n rows = db.data\n \n #outf.puts(\"*** Field Names (#{fieldNames.length}) *** \\n\", fieldNames, \"\\n\") # debug\n #outf.puts(\"*** Records *** \\n\", rows) # debug\n outf.puts(rows)\nend",
"def write_content(file_out)\n @array.each do |row|\n file_out.puts(' <Row>')\n row.each do |e|\n t = float?(e) ? 'Number' : 'String'\n file_out.puts(\n \" <Cell><Data ss:Type=\\\"#{t}\\\">#{e}</Data></Cell>\"\n )\n end\n file_out.puts(' </Row>')\n end\n end",
"def writeOut(fname=\"out\")\n File.open(fname, \"w\").write(@mResult)\n end",
"def write_rows file_name, names, values\n header = names.join(',') + \"\\n\"\n body = values.map {|row| row.join(',') }.join($/)\n File.open(file_name + \".csv\", 'w') { |f| f.write(header + body) }\nend",
"def write(data_row)\n @csv << data_row.values_at(*@output_fields)\n end",
"def _write filename, array\n File.open(filename, \"w\") do |file| \n array.each { |row| file.puts row }\n end\n end",
"def output_to_csv(rows, destination_file_path)\n logger.debug { \"Outputting to CSV File. '#{destination_file_path}'\" }\n total_rows = rows.length\n CSV.open(destination_file_path, 'w') { |writer|\n rows.each_with_index do |row, idx|\n logger.debug { \"Writing Row #{idx+1} of #{total_rows}\" }\n writer << row\n end\n }\n logger.info { \"Output Saved to CSV File. '#{destination_file_path}'\" }\n end",
"def process_outputs(args)\n @input = @generator = @window = @fill_value = nil # Cover our tracks.\n\n if (name = args[:out_file])\n IO.write(name, @output, mode: \"wb\")\n elsif (out_str = args[:out_str])\n out_str << @output\n end\n\n (_, @output = @output, nil)[0] # Return output and erase it.\n end",
"def csv_to_stdout(rows, cols: nil)\n CSV($stdout) { csv_write0(_1, rows, cols:) }\n end",
"def write(filename)\n ints = Mspire::Quant::Qspec.conditions_to_ints(conditions)\n header_cats = INIT_HEADER + ints\n rows = @protname_length_pairs.map {|pair| pair.map.to_a }\n @condition_to_count_array.each do |cond,counts|\n rows.zip(counts) {|row,cnt| row << cnt }\n end\n File.open(filename,'w') do |out|\n out.puts header_cats.join(DELIMITER)\n rows.each {|row| out.puts row.join(DELIMITER) }\n end\n end",
"def csv_write(path, rows, cols: nil)\n atomic_write(path) do |tmp|\n CSV.open(tmp.path, \"wb\") { csv_write0(_1, rows, cols:) }\n end\n end",
"def save_to_file\n File.open(@output, 'w+') do |file|\n file.puts HEADER if @additional_html\n file.puts @data_for_output.join(\"\\n\")\n file.puts FOOTER if @additional_html\n end\n end",
"def write_row(row)\n end",
"def output_to_csv\n if (@values[:result] != nil)\n @additions << calculate_worktime\n filename = get_entry(\"Specify output file: \")\n p = Menu.data_handler.find_person_by_id(@values[:id])\n CSVWriter.output(filename, p, @values[:result], @additions)\n else\n puts \"Nothing to write right now.\"\n end\n end",
"def write_content(file_out)\n file_out.puts(@array)\n end",
"def write(data)\n begin\n File.open(@filename, \"wb\") { |file| file.puts data.to_csv }\n rescue \n puts \"Error: \" + $!.to_s\n end \n end",
"def write(arr, file)\n File.open(file, 'w') do |f|\n (0..8).each do |row|\n f.puts arr[row * 9, 9].join \"\\t\"\n end\n end\n end",
"def writeData(f)\n xgrid = getOption(\"xgrid\")\n sigma = getOption(\"sigma\")\n\n @data.length.times { |i|\n\tx = if xgrid then xgrid[i].to_s else i.to_s end\n\tsig = if sigma then sigma[i].to_s else \" \" end\n\t\n\tf.writeln( x + \" \" + @data[i].to_s + \" \" + sig)\n }\n end",
"def write_file(file_name_out, content_array)\n\n\toutput = File.new(file_name_out, 'w')\n\tcontent_array.each { |line| output.write line }\n\toutput.close\nend",
"def create_output_csv(output)\n CSV.open(\"./output.csv\", \"wb\") do |csv|\n output.each do |row|\n csv << row\n end\n end\n end",
"def output_to_file (products_hash, brands_hash)\n\t_sales_report_header\n\t_products_header\n\tproducts_section(products_hash)\n\tend_of_section\n\t_brands_header\n\tbrands_section(brands_hash)\n\tend_of_section\n\t$report_file.puts 'THIS REPORT HAS BEEN CREATED BY MROHDE'\nend",
"def writeFile\n File.open(ARGV[1], \"w+\") do |f|\n $results.each{\n |result|\n f.puts(result)\n }\n end\nend",
"def write_footer(file_out)\n file_out.puts(' </Table>')\n file_out.puts(' </Worksheet>')\n file_out.puts('</Workbook>')\n end",
"def handle_output(transformed_row)\n outgoing.puts(transformed_row)\n end",
"def writeData(filename = \"out.csv\")\n\t\tfile = File.new(filename, \"w\")\n\t\t\n\t\t@dataArray.each do |singleEntry|\n\t\t\tfile.puts \"#{singleEntry[0]},#{singleEntry[1]},#{singleEntry[2]}\"\n\t\tend\n\t\n\t\tfile.close\n\t\t\n\tend",
"def write_to(io, *options); end",
"def csv_writer(rows)\n headers = [\"name\", \"capacity\", \"storage\"]\n CSV.open(\"reservoir_data.csv\", 'w') do |csv|\n csv << headers\n rows.each do |row|\n csv << row\n end\n end\nend",
"def write(data, *args, **kwd); end",
"def write; end",
"def write; end",
"def opx_file_write_spreadsheet(tab, output)\n file = TABULATOR_SPREADSHEET_FILE\n lines = tab.tabulator_spreadsheet()\n if (output)\n outfile = opx_file_open_write(file)\n outfile.puts lines\n opx_file_close(outfile)\n end\n lines\n rescue => e\n opx_err(\"Fatal failure writing to spreadsheet file: #{file}\", e)\n end",
"def handle_output(row)\n\t\t\t@outgoing.write(row) unless @outgoing == nil || row == nil\n\t\tend",
"def writeBed(db, org, fname)\n\tout = File.new(fname, \"w\")\n\tdb.query(\"SELECT contig, start, stop, exon, 0, strand FROM exons where org=? ORDER by contig\", org).each do |row|\n\t\tout.print row.join(\"\\t\") + \"\\n\"\n\tend\n\tout.close\n\tfname\nend",
"def write_row(row, lat)\n file_no = (lat/10).floor + 9\n $ofh_arr[file_no].write(row + \"\\n\")\nend",
"def write(dest); end",
"def write(dest); end",
"def write(dest); end",
"def write_output_file(output_file, body)\n File.open(output_file, 'w:UTF-8') do |file|\n file.puts $HTML_header\n file.puts body\n file.puts $HTML_footer\n end\nend",
"def write_traits(output_file)\n open(output_file, 'a') { |f|\n f.puts \"=========#{@generation}========\"\n @all_persons.each do |person|\n f.puts \"#{person.get_chromosome.get_sequence}\"\n end\n }\n end",
"def perform\n $stdout.write \"Outputting file to #{filepath_string}\\n\"\n CSV.open(filepath_string, \"wb\") do |csv|\n csv << output_header_row\n orders.each do |order|\n csv << order.output_row\n end\n end\n end",
"def writeOutput(outputFile,array)\n Write to file\n File.open(outputFile, 'w') { |file|\n file.write(array.join(\"\"))\n }\n end",
"def write(columns, format = nil)\n columns.size.times do |i|\n write_cell(@line_index, i, columns[i], format)\n end\n\n @line_index += 1\n end",
"def write_acct_file (acct_numbers_array, number_acct_fields)\r\n file_name = \"data/accounts\"\r\n output_file = File.open(file_name,\"w\")\r\n \r\n acct_numbers_array.each {|a| output_file.puts a}\r\n output_file.close\r\nend",
"def write(output, indent); end",
"def write(filename)\n CSV.open(filename, 'w', force_quotes: true) do |csvf|\n csvf << headers\n rows.each { |row| csvf << row }\n end\n end",
"def write(output, indent = T.unsafe(nil)); end",
"def writeLinesToFile(outFile, prefix = \"\")\n #N Without this check, it would attempt to write out a time value when none was available\n if time != nil\n #N Without this, a line for the time value would not be written to the file\n outFile.puts(\"T #{time.strftime(@@dateTimeFormat)}\\n\")\n end\n #N Without this, directory information would not be written to the file (for immediate sub-directories)\n for dir in dirs\n #N Without this, a line for this sub-directory would not be written to the file\n outFile.puts(\"D #{prefix}#{dir.name}\\n\")\n #N Without this, lines for the sub-directories and files contained with this directory would not be written to the file\n dir.writeLinesToFile(outFile, \"#{prefix}#{dir.name}/\")\n end\n #N Without this, information for files directly contained within this directory would not be written to the file\n for file in files\n #N Without this, the line for this file would not be written to the file\n outFile.puts(\"F #{file.hash} #{prefix}#{file.name}\\n\")\n end\n end",
"def export(filename)\n\t\tout = File.open(filename, 'w+')\n\t\t\n\t\t# Write file eader information\n\t\tout.puts '# ' + \"#{@input_file} :: #{@fileinfo}\"\n\t\toutstr = \"\"\n\t\t@output_ary.each { |e| \n\t\t\toutstr += \"#{e[:name]}_#{e[:unit]}\\t\"\n\t\t}\n\t\tout.puts outstr.rstrip\n\n\t\t(0..@output_ary[0][:values].size - 1).each { |i|\n\t\t\toutstr = \"\"\n\t\t\t@output_ary.each { |e| \n\t\t\t\toutstr += \"#{'%.8e' % e[:values][i]}\\t\"\n\t\t\t}\n\t\t\tout.puts outstr.rstrip\n\t\t}\n\n\t\tout.close\n\tend",
"def write_out(file: $OUTFILE)\n puts \"Writing out to #{file}\" if $DEBUGGING\n extension = file.dup #filename with any extension\n file[file.index('.')..-1] = '.ppm'\n #$GRID = create_grid()\n outfile = File.open(file, 'w')\n outfile << \"P3 #$RESOLUTION #$RESOLUTION 255\\n\" #Header in 1 line\n\n #Write PPM data\n for row in @rgb_grid\n for pixel in row\n for rgb in pixel\n outfile << rgb\n outfile << ' '\n end\n outfile << ' '\n end\n outfile << \"\\n\"\n end\n outfile.close()\n\n #Convert filetype\n print %x[convert #{file} #{extension}]\n if not extension[\"ppm\"]\n print %x[rm #{file}] end\n end",
"def to_file(filename, hits, qvalues=[])\n File.open(filename,'w') do |out|\n out.puts HEADER.join(FILE_DELIMITER)\n hits.zip(qvalues) do |hit, qvalue|\n out.puts [hit.search_id, hit.id, hit.aaseq, hit.charge, qvalue || hit.qvalue].join(FILE_DELIMITER)\n end\n end\n filename\n end",
"def file_write\n File.open(@@filename,\"r\") do |file|\n file.each_line do |line|\n rg = /<td.*>([\\w\\s\\.*]*)<\\/td>/i\n str = line.scan(rg)\n\n arr = str.to_a\n if arr.any?\n @temp_arr ||= []\n arr.each{|i| @temp_arr.push(arr) }\n @temp_arr\n end\n\n end\n @temp_arr = @temp_arr.flatten\n p @temp_arr\n CSV.open(\"profiles.csv\", \"w\") do |row|\n @temp_arr.each_slice(4).to_a.each do |temp|\n row << temp\n end\n end\n\n end\n end",
"def write row, index\n # Rails' fixture format has each row be a hash mapping the index\n # to the row data hash\n object = {index => row}\n\n # Convert the index-object to YAML\n data = object.to_yaml\n # Check conformance of the objects if we haven't already\n if !@checked\n detect_slicing_offsets data\n @checked = true\n end\n # Figure out which parts we need to chop off\n data = data.slice(@head_offset, data.length - @tail_offset)\n @io.write data\n end",
"def write_row(*args)\n # Check for a cell reference in A1 notation and substitute row and column\n if args[0] =~ /^\\D/\n args = substitute_cellref(*args)\n end\n\n # Catch non array refs passed by user.\n unless args[2].kind_of?(Array)\n raise \"Not an array ref in call to write_row() #{$!}\";\n end\n\n row, col, tokens, options = args\n error = 0\n unless tokens.nil?\n tokens.each do |token|\n # Check for nested arrays\n if token.kind_of?(Array)\n ret = write_col(row, col, token, options)\n else\n ret = write(row, col, token, options)\n end\n\n # Return only the first error encountered, if any.\n error ||= ret\n col += 1\n end\n end\n return error\n end",
"def write_counts(output)\n File.open(output, 'w') do |output_file|\n @count_array.each do |pair|\n key, value = pair\n output_file << \"#{key}\\t#{value}\\n\"\n end\n end\n end",
"def write_to_csv(outfile=\"result.csv\", use_pbar=@use_pbar)\n CSV.open(outfile, \"w\", {:col_sep => \"\\t\"}) do |csv|\n headerAry = [\"#spec_num\", \"peptide\", \"spec_prob\", \"decoy\", \"prot_ids\", \"start\", \"end\", \"num_prot\"]\n headerAry.delete(\"decoy\") if !@tda_flag\n csv << headerAry\n \n # each PSM\n self.each_psm do |psm|\n pep_seq = psm.get_pep\n spec_num = psm.get_spec_num\n sp_prob = psm.get_spec_prob\n pass_thresh = psm.get_pass_threshold\n pep_ev_ref_lst = psm.get_pep_ev\n # number of proteins with matching peptide\n num_prot = pep_ev_ref_lst.size\n # for each PeptideEvidence, write a different line\n pep_ev_ref_lst.each do |pepev| \n prot_id = self.get_prot_id(pepev) \n start_pos = self.get_pep_start(pepev)\n end_pos = self.get_pep_end(pepev)\n is_decoy = self.get_is_decoy(pepev)\n ary = [spec_num, pep_seq, sp_prob, is_decoy, prot_id, start_pos, end_pos, num_prot]\n ary.delete_at(3) if !@tda_flag\n csv << ary\n end \n end \n end\n end",
"def write_report filename=nil\n\t\toutput_string = ''\t\t\n\t\tself.sort_drivers_by_miles.each do |key,driver|\n\t\t\toutput_string += \"#{driver.trip_report_str} \\n\"\n\t\tend\n\t\tunless filename.nil?\n\t\t\tFile.write(filename, output_string)\n\t\tend\n\t\tputs output_string\n\t\toutput_string\n\tend",
"def write(file_path, query_result)\n line_number = 0\n CSV.open(file_path, \"w\") do |csv|\n query_result.each do |row|\n csv << row.map{ |_,field| field.is_a?(String) ? field.gsub(\"\\n\", \" \") : field }\n line_number+=1\n end\n end\n line_number\n end",
"def write(table, row)\n file = $tables[table]\n\n # By default, set the ID to the last index + 1\n # This can potentially re-use a deleted ID\n # But it cannot (yet) create two rows with the same ID\n id = file.size() == 0 ?\n 1 :\n file.last_line.split(\",\").first.to_i + 1\n\n # Add the id to the beginning of the row\n row.unshift(id)\n\n file.puts(serialize(row))\n\n id\nend",
"def to_file(filename, hits, qvalues=[])\n File.open(filename,'w') do |out|\n out.puts HEADER.join(FILE_DELIMITER)\n hits.zip(qvalues) do |hit, qvalue|\n out.puts [hit.search.id, hit.id, hit.aaseq, hit.charge, qvalue || hit.qvalue].join(FILE_DELIMITER)\n end\n end\n filename\n end",
"def update_csv(rows)\n CSV.open($out_path, \"wb\") do |csv| \n\n csv << rows.first.keys\n\n rows.each do |row| \n csv << row.values\n end\n end\nend",
"def write(io, force)\n # You must use ancestor methods to work with report data:\n # 1) iterator.data_size => returns source data size (calls #count on data\n # retrieved from 'source')\n # 2) iterator.data_each => yields given block for each source data element\n # 3) table.build_header => returns Array of report column names\n # 4) table.build_row(object) => returns Array of report cell\n # values (same order as header)\n # 5) events_handler.progress(progress, total) => call to iterate job progress\n # 6) events_handler.error(error) => call to handle error in job\n #\n # HINT: You may override data_size and data_each, to retrieve them\n # effectively\n fail NotImplementedError\n end",
"def write(*data); end",
"def write(arg0)\n end",
"def export_table_to_file(table)\n export_table.export_one_table(get_case_name(), table)\n end",
"def flush_to_file(hit_list)\n File.open($config[:output], 'a') do |file|\n file.puts(hit_list)\n end\nrescue => e\n puts \"Error writing to output file #{$config[:output]}\"\n raise e\nend",
"def write(mph, minutes, incline=\"\", date: Time.now)\n Dir.mkdir(File.dirname(filepath)) unless Dir.exist?(File.dirname(filepath))\n File.open(filepath, 'a+') do |file|\n unless(file.readlines.include?(header(date.month, date.day)))\n file.puts header(date.month, date.day)\n end\n file.puts query(mph, minutes, incline, date: date)\n end\n end",
"def write_to_output filename, content = nil # :yields: file\n self.create_output_file(filename) do |output_path|\n File.open(output_path, 'w') do |f|\n if content\n f.write(content)\n else\n yield f\n end\n end\n end\n end",
"def writeFastqRecordToFile(outFile, readName, readString, qualName,\n qualString) \n outFile.puts readName\n outFile.puts readString\n outFile.puts qualName\n outFile.puts qualString\n end",
"def write_file(metadata, csv_doc, in_file)\n #outs = File.open(\"temp/#{in_file}\", \"w:iso-8859-1\")\n outs = File.open(\"NEW_#{in_file}\", \"w:iso-8859-1\") #default output filename\n if (!metadata.empty?)\n outs.puts(metadata) # write data to file\n #outs.puts(\"\\r\\n\")\n end\n \n outs.puts(csv_doc) # write data to file\nend",
"def write(file=nil)\n file = file.nil? ? @file : file\n File.open(file, 'w+') {|f|\n @lines.each{|line|\n f.write(\"#{line}\\r\\n\")\n }\n }\n end",
"def execute\n processed_header = false\n\n File.open(outfile, 'w') do |out|\n File.open(infile).each_with_index do |line, index|\n next if line.chomp.empty? || unstring(line).chomp.split(';').empty?\n\n unless processed_header\n header_row = header.process(line.chomp)\n header_row = @write_filter.process(header_row) unless @final_header\n out.puts header_row unless header_row.nil? or header_row.empty?\n processed_header = true\n next\n end\n\n next if row_filter.process(line, row: index).nil?\n\n @columns = unstring(line).chomp.split(';')\n formulae.each do |col, formula|\n @columns[col.to_i] = eval(formula)\n end\n out.puts @write_filter.process(@columns.join(';'))\n\n @columns.each_with_index do |column, index|\n column = 0 unless column.to_s =~ /^[\\d\\.,]*$/\n\n if @sum_row[index]\n @sum_row[index] += to_number column\n else\n @sum_row[index] = to_number column\n end\n end if add_sum_row\n\n end\n\n out.puts @write_filter.process(@sum_row.join(';')) if add_sum_row\n\n end\n end",
"def writeOut\n temp = self.clone\n puts( temp.toF().toString() + \"\\t\" +\n temp.toC().toString() + \"\\t\" +\n\t temp.toR().toString() + \"\\t\" +\n \t temp.toK().toString() + \"\\n\" )\n self\n end",
"def writeCSV(file_name)\n generated_array = transaction(file_name)\n array_from_csv = read_file(file_name)\n final_hash = merge_arrays(array_from_csv, generated_array)\n binding.pry\n\n CSV.open(\"results.csv\", \"w\") do |row|\n final_hash.each do |nested_hash|\n row << [nested_hash[\"SKU\"], nested_hash[\"quantity\"]]\n end #end each nested_hash loop\n end #end csv loop\nend",
"def write_trxn_file(acct_numbers_array, number_trxn_fields)\r\n file_name = \"data/transactions\"\r\n output_file = File.open(file_name,\"w\")\r\n \r\n trxn_start_year = 2015\r\n trxn_end_year= 2015\r\n trxn_start_month = 4\r\n trxn_end_month = 9\r\n trxn_start_day = 01\r\n trxn_end_day = 21\r\n \r\n min_ammt = 0.00\r\n max_ammt = 10000.00\r\n \r\n for i in 1..number_trxn_fields\r\n acct_num = acct_numbers_array.sample\r\n trxn_date = random_date(trxn_start_year,trxn_end_year, trxn_start_month, trxn_end_month, trxn_start_day, trxn_end_day)\r\n deb_cred_indicator = random_debit_credit_indicator()\r\n merch_catg = random_merchant_category()\r\n trxn_amnt = random_ammount(min_ammt,max_ammt)\r\n prch_code = random_purchase_code()\r\n output_file.puts \"#{acct_num}\" + \"\\001\" + \"#{trxn_date}\" + \"\\001\" + \"#{deb_cred_indicator}\" + \"\\001\" + \"#{merch_catg}\" + \"\\001\" + \"#{trxn_amnt}\" + \"\\001\" + \"#{prch_code}\"\r\n end \r\n output_file.close\r\nend",
"def writer; end",
"def write(file_path, query_result)\n line_number = 0\n CSV.open(file_path, \"w\") do |csv|\n query_result.get_result.stream_each do |row|\n csv << row.map{ |_,field| field.is_a?(String) ? field.gsub(\"\\n\", \" \") : field }\n line_number+=1\n end\n end\n line_number\n end",
"def output\n CSV.open(\"test.csv\", \"wb\") do |csv|\n csv << [\"name\",\"type\",\"value\",\"date\"]\n @array_csv.each do |element|\n csv << element\n puts element.inspect\n end\n end\n end",
"def exportfile arr\n begin\n file = File.open(\"result.txt\", \"w\")\n text = showResulf arr\n file.puts text\n file.close\n binding.pry\n rescue IOError => e\n puts \"Can not write file. Please try again after there.\"\n ensure\n file.close unless file.nil?\n end\nend",
"def write\n buffer = create_zip(@entries, @ignore_entries)\n\n puts \"\\nwrite file #{@output_file}\"\n File.open(@output_file, \"wb\") {|f| f.write buffer.string }\n end",
"def write_obj_file output_path\n File.open(output_path, 'w') do |f|\n @vbuffer.each_triple do |a,b,c|\n f.puts \"v #{a} #{b} #{c}\"\n end\n @vnbuffer.each_triple do |a,b,c|\n f.puts \"vn #{a} #{b} #{c}\"\n end\n @fbuffer.each_triple do |a,b,c|\n f.puts \"f #{a+1}//#{a+1} #{b+1}//#{b+1} #{c+1}//#{c+1}\"\n end\n end\n self\n end",
"def csv_write(filename,a)\n csv_str = \"\";\n for i in 0..a.size-1 do\n for j in 0..a[i].size-2 do\n csv_str = csv_str + \"\\\"\" + a[i][j].to_s + \"\\\",\"\n end;\n csv_str = csv_str + \"\\\"\" + a[i][j+1].to_s + \"\\\"\\n\";\n end;\n File.write(filename,csv_str);\nend",
"def write_col(*args)\n # Check for a cell reference in A1 notation and substitute row and column\n if args[0] =~ /^\\D/\n args = substitute_cellref(*args)\n end\n\n # Catch non array refs passed by user.\n unless args[2].kind_of?(Array)\n raise \"Not an array ref in call to write_row()\";\n end\n\n row, col, tokens, options = args\n error = 0\n unless tokens.nil?\n tokens.each do |token|\n # write() will deal with any nested arrays\n ret = write(row, col, token, options)\n\n # Return only the first error encountered, if any.\n error ||= ret\n row += 1\n end\n end\n return error\n end",
"def writeToFile(aCollection, aFilename)\n\trows = aCollection.collect { | sighting |\n\t\tsighting.to_ebird_record_format()\n\t}\n\n\tFile.open(aFilename, 'w') { |file|\n\t\trows.each do | row |\n\t\t\tfile.write(\"%s\\n\" % row.join(','))\n\t\tend\t\n\t}\t\n\n\tputs \"wrote %d sightings to %s\" % [aCollection.count(), aFilename]\nend",
"def write(out, indent = T.unsafe(nil)); end",
"def write(out, indent = T.unsafe(nil)); end",
"def in_file_location(out)\n out << \"#{@row = 1} at #{@column = 1} at #{@length}\"\n end",
"def write_output\n # If an output directory is given, open a file & write to it\n if output = self.output\n @path_decls.each do |path, decls|\n name = snake_case(decls.name.name.to_s.dup)\n file_path = File.join(output, \"#{name}.rbs\")\n File.open(file_path, 'w') do |io|\n stdout.puts \"Writing output to file: #{file_path}\"\n RBS::Writer.new(out: io).write([decls])\n end\n end\n # If no output directory is given write to STDOUT\n else\n RBS::Writer.new(out: stdout).write(@path_decls.values)\n end\n end",
"def write_to_csv(opts = {})\n filename = opts.fetch(:filename) { 'twords_report.csv' }\n write_file(filename, :to_csv, opts)\n end",
"def generate_output\n write_average_fitness('output/average.txt')\n write_best_fitness('output/best.txt')\n write_survivors('output/survivors.txt')\n write_traits('output/traits.txt')\n end"
] |
[
"0.7312231",
"0.65990204",
"0.64542145",
"0.6307653",
"0.6273513",
"0.6248603",
"0.6243873",
"0.6241665",
"0.6222821",
"0.6207732",
"0.61965597",
"0.6190774",
"0.61865544",
"0.6174986",
"0.61245054",
"0.609948",
"0.6091293",
"0.6089851",
"0.6081487",
"0.60417515",
"0.6038694",
"0.5955822",
"0.59513396",
"0.58794093",
"0.5868383",
"0.5859229",
"0.5853193",
"0.58527935",
"0.58237594",
"0.5769737",
"0.5755549",
"0.5739056",
"0.57336336",
"0.57312536",
"0.5720868",
"0.57005703",
"0.56996727",
"0.5694285",
"0.56618875",
"0.56595606",
"0.56595606",
"0.5656086",
"0.56556386",
"0.5650862",
"0.5648623",
"0.5636064",
"0.5636064",
"0.5636064",
"0.5634887",
"0.5633219",
"0.5623229",
"0.5593426",
"0.557561",
"0.55706215",
"0.5562437",
"0.5558142",
"0.55527747",
"0.55516726",
"0.55495864",
"0.5549022",
"0.554825",
"0.5539278",
"0.5535371",
"0.55223024",
"0.5521596",
"0.5502373",
"0.5496788",
"0.5493624",
"0.5492609",
"0.54923666",
"0.5491367",
"0.5488625",
"0.5485322",
"0.5477946",
"0.5460718",
"0.5456785",
"0.54416376",
"0.5441285",
"0.54402167",
"0.5439306",
"0.54363173",
"0.5428273",
"0.5426283",
"0.5425231",
"0.5423922",
"0.5421013",
"0.5410273",
"0.5406877",
"0.54037833",
"0.54021966",
"0.5400731",
"0.5399014",
"0.5392458",
"0.53844774",
"0.5383352",
"0.5383352",
"0.5382424",
"0.53733325",
"0.53706044",
"0.5365963"
] |
0.81498796
|
0
|
Abierta actualizacion de datos por el interlocutor
|
def open_entry?
opened_at <= DateTime.now.to_date && closed_at >= DateTime.now.to_date
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def updated_data; end",
"def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"def updated_data\n\tend",
"def reiniciar\n reset()\n @mapaactual=@mapainicio\n\n end",
"def actualizar_extractos_de_mercaderias\n if fecha_changed?\n detalles.each do |d|\n MercaderiaExtracto.crear_o_actualizar_extracto(d, fecha, d.cantidad, d.cantidad)\n end\n end\n end",
"def refresh_data\n raise NotImplementedError\n end",
"def update_values\n end",
"def update_values\n end",
"def actualizar(identificador, tipo, tamanio, asignacion)\n\t\t@tabla.store(identificador.valor.str, tipo)\n\n\t\tif tamanio != nil then\n\t\t\t@tamanio.store(identificador.valor.str, tamanio)\n\t\tend\n\n\t\tif asignacion != nil then\n\t\t\t@asignacion.store(identificador.valor.str, asignacion)\n\t\tend\n\tend",
"def data\n update_data\n @data\n end",
"def actualizar_extracto_de_cuenta_corriente\n if deleted?\n CuentaCorrienteExtracto.eliminar_movimiento(self.becomes(Boleta), fecha, importe_pendiente * -1)\n else\n if persona_id_changed? && !persona_id_was.nil? # si cambio de cuenta corriente\n old = get_old_boleta\n CuentaCorrienteExtracto.eliminar_movimiento(old.becomes(Boleta), fecha_was, importe_pendiente_was * -1)\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, 0, importe_pendiente)\n else\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, importe_pendiente_was.to_f, importe_pendiente)\n end\n end\n end",
"def reset()\n @actual =@inicio\n end",
"def update() end",
"def update\n handle_orcamento_update\n end",
"def update\n \n end",
"def refresh\n @deserialized_values = {}\n super\n end",
"def actualizar\n #Pasamos el 'id' del registro a actualizar\n @eventos = Evento.find(params[:id])\n @eventos = Evento.where(id: @eventos)\n end",
"def actualiza_atributos_diariodets \n sum_debe = 0\n sum_haber = 0\n sum_debe_sec = 0\n sum_haber_sec = 0\n item_max = 0\n idcuenta_ajuste_dif_cambio = 709 #Catalogo.find_by(id: Catalogo::ID_CTA_AJUSTE_DIF_CAMBIO)\n\n set_datos_segun_conf\n\n if self.origenasiento_id == 1 # si es manual actualiza columnas debe, haber...\n diariodets.each do |child| \n if child.ajuste.blank? or child.ajuste == '0'\n cod_moneda_trasac = Moneda.find_by(id:child.moneda_id).codigo \n child.tcori = self.tc\n child.ajuste = '0' \n if cod_moneda_trasac == Moneda::CODIGO_SYS[:nal]\n child.debe = (child.debeori).round(2) \n child.haber = (child.haberori).round(2) \n child.debesec = (child.debeori/Conta::TCV_CONST).round(2) \n child.habersec = (child.haberori/Conta::TCV_CONST).round(2) \n child.tcsec = child.tcori\n else\n if cod_moneda_trasac == Moneda::CODIGO_SYS[:sec]\n tc_transac = 0\n if Conta::TCV_CONST != child.tcori\n tc_transac = child.tcori\n else\n tc_transac = Conta::TCV_CONST\n end\n child.tcsec = tc_transac\n\n child.debe = (child.debeori*tc_transac).round(2) \n child.haber = (child.haberori*tc_transac).round(2) \n\n child.debesec = (child.debeori).round(2) \n child.habersec = (child.haberori).round(2) \n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:sec]\n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:nal]\n if item_max < child.item\n item_max = child.item\n end \n sum_debe = sum_debe + child.debe\n sum_haber = sum_haber + child.haber\n sum_debe_sec = sum_debe_sec + child.debesec\n sum_haber_sec = sum_haber_sec + child.habersec\n end #if child.ajuste.blank? or child.ajuste == '0'\n end #end diariodets.each do |child|\n\n ###\n ###cuadre global\n if (sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n ajuste = 0\n ajuste_sec = 0 \n ajuste = sum_debe - sum_haber\n ajuste_sec = sum_debe_sec - sum_haber_sec \n if ajuste != 0 \n if ajuste > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => ajuste, :debesec => 0, :habersec => 0, :debeori => 0, :haberori => ajuste, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n else\n ajuste = ajuste * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => ajuste, :haber => 0, :debesec => 0, :habersec => 0, :debeori => ajuste, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n end#end ajuste > 0\n end# end ajuste != 0 \n if ajuste_sec != 0\n if ajuste_sec > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber =>0 , :debesec => 0, :habersec => ajuste_sec, :debeori => 0, :haberori => ajuste_sec, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2)\n else\n ajuste_sec = ajuste_sec * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => 0, :debesec => ajuste_sec, :habersec => 0, :debeori => ajuste_sec, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2) \n end#end ajuste_sec > 0\n end# end ajuste_sec != 0 \n end #(sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n end#if self.tipocomprobante_id != 5 # si es automatico no aplica lo siguiente \n end",
"def actualizar\n if toca_actualizar\n actualizar_privado\n end\n end",
"def refresh\n @data = read_data\n end",
"def refresh\r\n # ゲームデータをロードした直後はアクターオブジェクトが\r\n # $game_actors から分離してしまっている。\r\n # ロードのたびにアクターを再設定することで問題を回避する。\r\n new_actors = []\r\n for i in 0...@actors.size\r\n if $data_actors[@actors[i].id] != nil\r\n new_actors.push($game_actors[@actors[i].id])\r\n end\r\n end\r\n @actors = new_actors\r\n end",
"def set_datos_insumos_reactivo\n @datos_insumos_reactivo = DatosInsumosReactivo.find(params[:id])\n end",
"def reload\n self.data = self.class.load_data\n self\n end",
"def actualizar\n # Pasamos el 'id' del registro a actualizar (método index) \n @quienes_somos = QuienesSomo.find(params[:id])\n @quienes_somos = QuienesSomo.where(id: @quienes_somos)\n\nend",
"def update ; end",
"def actualizar_objetivos\n mes = params[:mes]\n anio = params[:anio] \n @vendedor = Vendedor.find(params[:vendedor][:id])\n cantidad_op = params[:oportunidades]\n cantidad_pm = params[:pruebas_manejo]\n cantidad_v = params[:ventas]\n cantidad_f = params[:financiaciones]\n cantidad_c = params[:calidad] \n tipo_objetivo_id = 7\n objetivo_op = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_op.to_i == 0 and cantidad_pm.to_i == 0 and cantidad_v.to_i == 0 and cantidad_f.to_i == 0 and cantidad_c.to_i == 0\n msj = \"No hay datos para actualizar\"\n else\n msj = 'Se actualizaron los valores de '\n end\n @errores = Hash.new\n if cantidad_op.to_i != 0\n if objetivo_op != nil\n objetivo_op.cantidad_propuesta = cantidad_op\n if objetivo_op.save \n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo_op.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_op\n if objetivo.save\n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 4\n objetivo_pm = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_pm.to_i != 0 \n if objetivo_pm != nil\n objetivo_pm.cantidad_propuesta = cantidad_pm\n if objetivo_pm.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo_pm.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_pm\n if objetivo.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 5\n objetivo_v = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_v.to_i != 0 \n if objetivo_v != nil\n objetivo_v.cantidad_propuesta = cantidad_v\n if objetivo_v.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo_v.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_v\n if objetivo.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 8\n objetivo_f = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_f.to_i != 0 \n if objetivo_f != nil\n objetivo_f.cantidad_propuesta = cantidad_f\n if objetivo_f.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo_f.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_f\n if objetivo.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 3\n objetivo_c = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_c.to_i != 0 \n if objetivo_c != nil\n objetivo_c.cantidad_propuesta = cantidad_c\n if objetivo_c.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo_c.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_c\n if objetivo.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo.errors.full_messages.first\n end\n end\n end\n\n respond_to do |format|\n if @errores.blank?\n format.html { redirect_to @vendedor, notice: msj }\n format.json { head :no_content }\n else\n @bg_gray = true\n format.html { render :show }\n format.json { render json: @errores, status: :unprocessable_entity }\n end\n end \n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def _save_refresh\n super\n recalculate_values_hashes\n end",
"def on_data_changed\n store_data(data_class.all_columns)\n end",
"def update\n @orden_cobro = OrdenCobro.find(params[:id])\n estadoAnterior = @orden_cobro.estado_cobro.Nombre\n respond_to do |format|\n if @orden_cobro.update_attributes(params[:orden_cobro])\n\tlog = Log.new(:NombreTable => \"orden_cobros\", :Fecha => Date.today, :Hora => Time.now, :Usuario => current_user.username, :AccionRealizada => \"Update\")\n\tlog.save\n hist = HistorialOdc.new(:orden_cobro_id => @orden_cobro.id, :EstadoOdcSiguiente => @orden_cobro.estado_cobro.Nombre, :EstadoOdcAnterior => estadoAnterior, :fecha=> Date.today , :hora => Time.now, :NumRecibo => @orden_cobro.NumRecibo)\n hist.save\n\n format.html { redirect_to @orden_cobro, notice: 'Orden cobro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_cobro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t\n\t\tend",
"def _refresh(dataset)\n super\n recalculate_values_hashes\n end",
"def update\n authorize! :update, Cargo\n respond_to do |format|\n # if !@cargo.sueldos.where(created_at: Time.now.beginning_of_month..Time.now.end_of_month).empty?\n nuevo = false\n if $quincena == 0\n nuevo = @cargo.sueldos.where(created_at: Time.now.beginning_of_month..(Time.now.beginning_of_month + 14.days)).empty?\n else\n nuevo = @cargo.sueldos.where(created_at: (Time.now.beginning_of_month + 15.days)..Time.now.end_of_month).empty?\n end\n key, value = params[:cargo][:sueldos_attributes].first\n\n if nuevo\n\n viejo = @cargo.sueldos.where(activo: true).last\n\n @cargo.sueldos.update_all(activo: false)\n crear = @cargo.sueldos.new\n crear.monto = params[:cargo][:sueldos_attributes][key][:monto]\n crear.sueldo_integral = params[:cargo][:sueldos_attributes][key][:sueldo_integral]\n\n params[:cargo][:sueldos_attributes][key][:monto] = viejo.monto\n params[:cargo][:sueldos_attributes][key][:sueldo_integral] = viejo.sueldo_integral\n\n end\n if @cargo.update(cargo_params)\n log(\"Se ha actualizado el cargo: #{@lt}\", 1)\n\n format.html { redirect_to @cargo, notice: 'Los datos del cargo fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @cargo }\n else\n format.html { render :edit }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(parms)\n dn = parms.delete(:naissance)\n self.naissance = Date.civil(dn[:year].to_i, dn[:month].to_i, dn[:day].to_i)\n saveActivites(parms.delete(:activites))\n saveParticipations(parms.delete(:participations))\n \n # s'assurer que les informations pour les lecons de natation ne sont pas presente\n # si pas de lecons. On efface l'input puisque plus valide.\n unless abonneCoursDeNatation?\n parms[:cours_de_natation] = parms[:session_de_natation] = ''\n end\n \n # Finir l'update des autres parametres du membre.\n return super\n end",
"def update\n\n @empresa_registrada = EmpresaRegistrada.find(params[:id])\n\n if params[:activar].nil? # El parametro activar indica que no se esta actualñizando datos sino activando empresa\n\n @empresa_registrada.fecha_ultima_modificacion = Time.now # Se registra la fecha en que se edita la empresa\n \n # DATOS BASICOS EMPRESA SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:nombre_empresa] = params[:empresa_registrada][:nombre_empresa].upcase if params[:empresa_registrada][:nombre_empresa]\n params[:empresa_registrada][:nombre_comercial] = params[:empresa_registrada][:nombre_comercial].upcase if params[:empresa_registrada][:nombre_comercial]\n params[:empresa_registrada][:direccion_empresa] = params[:empresa_registrada][:direccion_empresa].upcase if params[:empresa_registrada][:direccion_empresa]\n params[:empresa_registrada][:circunscripcion_judicial] = params[:empresa_registrada][:circunscripcion_judicial].upcase if params[:empresa_registrada][:circunscripcion_judicial]\n params[:empresa_registrada][:rep_legal] = params[:empresa_registrada][:rep_legal].upcase if params[:empresa_registrada][:rep_legal]\n params[:empresa_registrada][:cargo_rep_legal] = params[:empresa_registrada][:cargo_rep_legal].upcase if params[:empresa_registrada][:cargo_rep_legal]\n params[:empresa_registrada][:nacionalidad_responsable_legal] = params[:empresa_registrada][:nacionalidad_responsable_legal].upcase if params[:empresa_registrada][:nacionalidad_responsable_legal]\n params[:empresa_registrada][:domicilio_responsable_legal] = params[:empresa_registrada][:domicilio_responsable_legal].upcase if params[:empresa_registrada][:domicilio_responsable_legal]\n\n\n # DATOS EAN SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_ean] = params[:empresa_registrada][:rep_ean].upcase if params[:empresa_registrada][:rep_ean]\n params[:empresa_registrada][:rep_ean_cargo] = params[:empresa_registrada][:rep_ean_cargo].upcase if params[:empresa_registrada][:rep_ean_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta] = params[:empresa_registrada][:galpon_edificio_quinta].upcase if params[:empresa_registrada][:galpon_edificio_quinta]\n params[:empresa_registrada][:oficina_apartamento] = params[:empresa_registrada][:oficina_apartamento].upcase if params[:empresa_registrada][:oficina_apartamento]\n params[:empresa_registrada][:avenida_calle] = params[:empresa_registrada][:avenida_calle].upcase if params[:empresa_registrada][:avenida_calle]\n params[:empresa_registrada][:urbanizacion_barrio_sector] = params[:empresa_registrada][:urbanizacion_barrio_sector].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector]\n params[:empresa_registrada][:parroquia_ean] = params[:empresa_registrada][:parroquia_ean].upcase if params[:empresa_registrada][:parroquia_ean]\n params[:empresa_registrada][:punto_ref_ean] = params[:empresa_registrada][:punto_ref_ean].upcase if params[:empresa_registrada][:punto_ref_ean]\n\n\n # DATOS CORREO ELECTRONICO Y SINCRONET SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_edi] = params[:empresa_registrada][:rep_edi].upcase if params[:empresa_registrada][:rep_edi]\n params[:empresa_registrada][:rep_edi_cargo] = params[:empresa_registrada][:rep_edi_cargo].upcase if params[:empresa_registrada][:rep_edi_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta_sincronet] = params[:empresa_registrada][:galpon_edificio_quinta_sincronet].upcase if params[:empresa_registrada][:galpon_edificio_quinta_sincronet]\n params[:empresa_registrada][:piso_numero_sincronet] = params[:empresa_registrada][:piso_numero_sincronet].upcase if params[:empresa_registrada][:piso_numero_sincronet]\n params[:empresa_registrada][:oficina_apartamento_sincronet] = params[:empresa_registrada][:oficina_apartamento_sincronet].upcase if params[:empresa_registrada][:oficina_apartamento_sincronet]\n params[:empresa_registrada][:avenida_calle_sincronet] = params[:empresa_registrada][:avenida_calle_sincronet].upcase if params[:empresa_registrada][:avenida_calle_sincronet]\n params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet] = params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet]\n params[:empresa_registrada][:parroquia_edi] = params[:empresa_registrada][:parroquia_edi].upcase if params[:empresa_registrada][:parroquia_edi]\n params[:empresa_registrada][:punto_ref_edi] = params[:empresa_registrada][:punto_ref_edi].upcase if params[:empresa_registrada][:punto_ref_edi]\n\n \n # DATOS RECURSOS SE LLEVAN A MAYUSCULA \n \n params[:empresa_registrada][:rep_recursos] = params[:empresa_registrada][:rep_recursos].upcase if params[:empresa_registrada][:rep_recursos]\n params[:empresa_registrada][:rep_recursos_cargo] = params[:empresa_registrada][:rep_recursos_cargo].upcase if params[:empresa_registrada][:rep_recursos_cargo]\n\n # DATOS MERCADEO SE LLEVAN A MAYUSCULA\n\n params[:empresa_registrada][:rep_mercadeo] = params[:empresa_registrada][:rep_mercadeo].upcase if params[:empresa_registrada][:rep_mercadeo]\n params[:empresa_registrada][:rep_mercadeo_cargo] = params[:empresa_registrada][:rep_mercadeo_cargo].upcase if params[:empresa_registrada][:rep_mercadeo_cargo]\n \n # Se obtienen los numeros completos\n\n params[:empresa_registrada][:contacto_tlf1_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf1] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf1] if params[:empresa_registrada][:cod_contacto_tlf1] != \"\"\n params[:empresa_registrada][:contacto_tlf2_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf2] + \")\"+ \" \" + params[:empresa_registrada][:contacto_tlf2] if params[:empresa_registrada][:cod_contacto_tlf2] != \"\"\n params[:empresa_registrada][:contacto_tlf3_completo] =\"(\"+ params[:empresa_registrada][:cod_contacto_tlf3] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf3] if params[:empresa_registrada][:cod_contacto_tlf3] != \"\"\n params[:empresa_registrada][:contacto_fax_completo] = \"(\"+params[:empresa_registrada][:cod_contacto_fax] + \")\" +\" \"+ params[:empresa_registrada][:contacto_fax] if params[:empresa_registrada][:cod_contacto_fax] != \"\"\n params[:empresa_registrada][:direccion_ean] = params[:empresa_registrada][:tipo_urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:tipo_avenida_calle] + \" \" + params[:empresa_registrada][:avenida_calle] + \" \" + params[:empresa_registrada][:tipo_galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:tipo_piso_numero] + \" \" + params[:empresa_registrada][:piso_numero] + \" \" + params[:empresa_registrada][:tipo_oficina_apartamento] + \" \" + params[:empresa_registrada][:oficina_apartamento] \n params[:empresa_registrada][:telefono1_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf1_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono1_ean] if params[:empresa_registrada][:cod_tlf1_ean] != \"\"\n params[:empresa_registrada][:telefono2_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf2_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono2_ean] if params[:empresa_registrada][:cod_tlf2_ean] != \"\"\n params[:empresa_registrada][:telefono3_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf3_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono3_ean] if params[:empresa_registrada][:cod_tlf3_ean] != \"\"\n params[:empresa_registrada][:fax_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_fax_ean] + \")\" +\" \"+ params[:empresa_registrada][:fax_ean] if params[:empresa_registrada][:cod_fax_ean] != \"\" \n\n # SE OBTIENE EL RIF COMPLETO\n\n params[:empresa_registrada][:rif_completo] = params[:empresa_registrada][:tipo_rif] + \"-\" + params[:empresa_registrada][:rif]\n\n end\n \n\n respond_to do |format|\n \n if params[:activar] # Si se esta activando la empresa no se aactualiza los datos porque ese usuario no tiene el privilegio\n\n Empresa.activar(@empresa_registrada, params[:empresa_registrada][:prefijo])\n Auditoria.registrar_evento(session[:usuario],\"\", \"Activar\", Time.now, \"EMPRESA ACTIVADA. PREFIJO:#{@empresa_registrada.prefijo}\")\n format.html { redirect_to \"/empresa_registradas?activar_empresa=true\", notice: \"EMPRESA ACTIVADA. PREFIJO #{@empresa_registrada.prefijo} NOMBRE EMPRESA #{@empresa_registrada.nombre_empresa} RIF #{@empresa_registrada.rif_completo}\" and return }\n\n else # Se actualizan los datos de la empresa privilegio asociado a Administracion - VEntas\n\n if @empresa_registrada.update_attributes(params[:empresa_registrada])\n \n Auditoria.registrar_evento(session[:usuario],\"empresa_registradas\", \"Editar\", Time.now, params[:empresa_registrada])\n format.html { redirect_to \"/empresa_registradas\", notice: \"Los datos de la Empresa:#{@empresa_registrada.nombre_empresa} RIF:#{@empresa_registrada.rif_completo} fueron actualizados satisfactoriamente.\" and return}\n \n \n else\n format.html { render action: \"edit\" }\n \n end\n\n end\n\n\n\n end\n end",
"def _refresh_set_values(hash)\n @deserialized_values.clear if @deserialized_values\n super\n end",
"def update\n buenosFrascos = obtener_frascos_string(params[:id])\n indice = buenosFrascos.index(\"#\", buenosFrascos.index(\"#\", buenosFrascos.index(\"$\"+params[:idFra]+\"#\"))+1)+1\n puts indice\n \n\n if(Integer(params[:noRet]) == 0)\n actualizar = Time.new\n puts actualizar.strftime(\"%Y-%m-%d\")\n actualizar = actualizar.strftime(\"%Y-%m-%d\")\n mensaje = 'Se ha entregado el frasco'\n else\n actualizar = 'NO RETIRO'\n mensaje = 'Se ha cambiado el estado del frasco a NO RETIRADO'\n end\n buenosFrascos.insert(indice,actualizar)\n puts buenosFrascos\n @frasco.frascos = buenosFrascos\n @frasco.saltar_validacion_usuario = true\n @frasco.validar_usuario_nuevo = false\n respond_to do |format|\n if @frasco.save\n format.html { redirect_to frasco_path(params[:id]), notice: mensaje }\n format.json { render :show, status: :ok, location: @frasco }\n else\n format.html { render :show }\n format.json { render json: @frasco.errors, status: :unprocessable_entity }\n end\n end\n puts \"Ando actualizando\"\n end",
"def resale\n\n end",
"def update\n \n end",
"def update_values(*args)\n cache_delete\n super\n end",
"def imprimir_parciales1\n\n #aqui guardo todos los datos que necesito para imprimirlos en las variable\n\n @width_layout = '955'\n @form_title = ''\n @imprimo='1'\n\n @factura_orden_despacho_otra= FacturaOrdenDespacho.find(:all, :conditions=>\"id in #{params[:parciales_id]}\")\n\n factura_orden_despacho_count=FacturaOrdenDespacho.count(:all, :conditions=>\"id in #{params[:parciales_id]}\")\n\n @factura_orden_despacho=FacturaOrdenDespacho.find(:first, :conditions=>\"id in #{params[:parciales_id]}\")\n\n contw=0\n \n while contw < factura_orden_despacho_count\n @factura_orden_despacho_otra[contw].update_column(:emitida, true)\n #@factura_orden_despacho_otra[contw].emitida=true\n #@factura_orden_despacho_otra[contw].send(:update_without_callbacks)\n contw+=1\n\n end\n\n solicitu=OrdenDespacho.find(OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id).solicitud_id\n\n @solicitudes = Solicitud.find(:all,:conditions => ['id = ?', solicitu])\n\n unless @solicitudes[0].nil?\n if !@solicitudes[0].cliente.persona_id.nil? \n \t@es_no=1\n \t@datos_cliente=Persona.find(@solicitudes[0].cliente.persona_id) unless @solicitudes[0].nil?\n else\n \t@es_no=2\n \t@datos_cliente=Empresa.find(@solicitudes[0].cliente.empresa_id) unless @solicitudes[0].nil?\n end\n end\n @numero_desembolso=OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id\n\n @orden_despacho= OrdenDespacho.find(:all,:conditions => ['solicitud_id = ?', solicitu])\n\n\n @oficina= Oficina.find(:all,:conditions => ['id = ?', @solicitudes[0].oficina_id]) unless @solicitudes[0].nil?\n\n\n @parametros_general=ParametroGeneral.find(:first)\n\n @condition = \" orden_despacho_id = #{@factura_orden_despacho.orden_despacho_detalle.orden_despacho_id} and cantidad > 0\"\n @total = OrdenDespachoDetalle.count(:conditions=>@condition)\n @list = OrdenDespachoDetalle.find(:all, :conditions => ['orden_despacho_id = ? and cantidad > 0', @factura_orden_despacho.orden_despacho_detalle.orden_despacho_id])\n\n @total_saldo_entregar=0\n @total_precio_total=0\n cont=0\n diferencia=0.00\n @total_monto_confirmado=0.00\n \n while cont< @total\n\n #if OrdenDespacho.find(@numero_desembolso).estatus_id==20000 || OrdenDespacho.find(@numero_desembolso).estatus_id==20010 || OrdenDespacho.find(@numero_desembolso).estatus_id==20020\n \t \n # codigo nuevo al 3/9/2013 \n if ( ((@list[cont].cantidad * @list[cont].costo_real)!=@list[cont].monto_financiamiento) and (@list[cont].monto_recomendado!=0))\n @total_saldo_entregar+=@list[cont].monto_recomendado\n diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n else\n @total_saldo_entregar+=@list[cont].monto_financiamiento\n diferencia=@list[cont].monto_financiamiento - @list[cont].monto_facturacion\n end\n #codigo nuevo al 3/9/2013 \n \n \n #else\n \t #@total_saldo_entregar+=@list[cont].monto_recomendado\n #diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n #end\n @total_monto_confirmado+=@list[cont].monto_facturacion\n \n logger.debug \"monto financiamiento = \" << @list[cont].monto_financiamiento.to_s\n logger.debug \"monto facturacion = \" << @list[cont].monto_facturacion.to_s\n logger.debug \"diferencia = \" << diferencia.to_s\n if diferencia < 0\n diferencia=diferencia * -1 \n\n end\n \n @total_precio_total+=diferencia\n\n #@total_precio_total+=@list[cont].monto_facturacion\n \tcont+=1\t\n end\n @vista = 'view_factura_orden_despacho_parciales'\n\nend",
"def update\r\n \r\n @valor_oferta = sivic_relatorioscelula_params[:VALR_Oferta] \r\n \r\n @valor_oferta = @valor_oferta.gsub('.', '')\r\n @valor_oferta = @valor_oferta.gsub(',', '.').to_f\r\n \r\n @sivic_relatorioscelula.data_reuniao = sivic_relatorioscelula_params[:data_reuniao]\r\n @sivic_relatorioscelula.DATA_Horainicio = sivic_relatorioscelula_params[:DATA_Horainicio]\r\n @sivic_relatorioscelula.DATA_HoraTermino = sivic_relatorioscelula_params[:DATA_HoraTermino]\r\n @sivic_relatorioscelula.NUMR_NumVisitante = sivic_relatorioscelula_params[:NUMR_NumVisitante]\r\n @sivic_relatorioscelula.NUMR_NumParticipante = sivic_relatorioscelula_params[:NUMR_NumParticipante]\r\n @sivic_relatorioscelula.DESC_AssuntoEstudo = sivic_relatorioscelula_params[:DESC_AssuntoEstudo]\r\n @sivic_relatorioscelula.DESC_TextoBiblico = sivic_relatorioscelula_params[:DESC_TextoBiblico]\r\n @sivic_relatorioscelula.VALR_Oferta = @valor_oferta\r\n @sivic_relatorioscelula.NUMR_Decisoes = sivic_relatorioscelula_params[:NUMR_Decisoes]\r\n @sivic_relatorioscelula.DESC_OutrasInformacoes = sivic_relatorioscelula_params[:DESC_OutrasInformacoes]\r\n @sivic_relatorioscelula.DATA_HoraTermino = sivic_relatorioscelula_params[:DATA_HoraTermino]\r\n @sivic_relatorioscelula.sivic_situacoesrelatorio_id = sivic_relatorioscelula_params[:sivic_situacoesrelatorio_id]\r\n @sivic_relatorioscelula.NUMR_QtdNovoConvertido = sivic_relatorioscelula_params[:NUMR_QtdNovoConvertido]\r\n @sivic_relatorioscelula.NUMR_QtdResgate = sivic_relatorioscelula_params[:NUMR_QtdResgate]\r\n @sivic_relatorioscelula.NUMR_QtdPreEncontro = sivic_relatorioscelula_params[:NUMR_QtdPreEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdEncontro = sivic_relatorioscelula_params[:NUMR_QtdEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdPosEncontro = sivic_relatorioscelula_params[:NUMR_QtdPosEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdEscoLid1 = sivic_relatorioscelula_params[:NUMR_QtdEscoLid1]\r\n @sivic_relatorioscelula.NUMR_EscoLid2 = sivic_relatorioscelula_params[:NUMR_EscoLid2]\r\n @sivic_relatorioscelula.NUMR_EscoLid3 = sivic_relatorioscelula_params[:NUMR_EscoLid3]\r\n @sivic_relatorioscelula.NUMR_QtdLidCelula = sivic_relatorioscelula_params[:NUMR_QtdLidCelula]\r\n \r\n \r\n respond_to do |format|\r\n if @sivic_relatorioscelula.save\r\n format.html { redirect_to @sivic_relatorioscelula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_relatorioscelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n\n if not params[:treino][:atividade_ids].present?\n params[:treino][:atividade_ids] = []\n end\n\n #Recuperar os valores do array de array.\n #Tratamento para evitar o erro na atualizacao do treinos.Estava excluindo as atividades do treino Muscular.\n @result = Atividadetreino.joins('JOIN atividades on atividadetreinos.atividade_id = atividades.id').where('atividades.tipo' => 'A')\n @result.each do |res|\n params[:treino][:atividade_ids].push(res.atividade_id)\n end\n\n #********************************************\n #Gravando as ordens para os Treinos Aerobicos\n #********************************************\n setOrdensTreinos(:aerobico)\n\n #********************************************\n #Gravando as ordens para os Treinos Neurologicos\n #********************************************\n setOrdensTreinos(:neuro)\n\n respond_to do |format|\n if @treino.update(treino_params)\n format.html { redirect_to @treino, notice: 'Treino atualizado!' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"def actualizar_intermedio\n quedan = @registro.caracterizacionpersona.where(\n \"respuestafor_id IN (SELECT id \" +\n \"FROM mr519_gen_respuestafor AS rf \" +\n \"JOIN cor1440_gen_caracterizacionpf AS cpf ON \" +\n \"rf.formulario_id=cpf.formulario_id JOIN \" +\n \"cor1440_gen_beneficiariopf AS bpf ON \" +\n \"bpf.proyectofinanciero_id=cpf.proyectofinanciero_id \" +\n \"WHERE bpf.persona_id=?)\",\n @registro.id,\n ).pluck(:id)\n elim = @registro.caracterizacionpersona_ids - quedan\n if elim != []\n Cor1440Gen::Caracterizacionpersona.where(id: elim).delete_all\n end\n true\n end",
"def update\n @calificacion = Calificacion.find(params[:id])\n calificacion_antigua = @calificacion.calificacion\n materia_antigua = @calificacion.materia_materia\n puntos_correctos_antiguo = @calificacion.puntos_correctos\n total_puntos_antiguo = @calificacion.total_puntos\n etapa_antigua = @calificacion.etapa\n\n respond_to do |format|\n if @calificacion.update_attributes(params[:calificacion])\n calificacion_nueva = @calificacion.calificacion\n materia_nueva = @calificacion.materia_materia\n puntos_correctos_nueva = @calificacion.puntos_correctos\n total_puntos_nueva = @calificacion.total_puntos\n etapa_nueva = @calificacion.etapa\n CustomLogger.info(\"Los datos antes de ser actualizados son: calificacion: #{calificacion_antigua.inspect} ,Materia: #{materia_antigua.inspect} ,Puntos Correctos: #{puntos_correctos_antiguo.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Etapa: #{etapa_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: calificacion: #{calificacion_nueva.inspect} ,Materia: #{materia_nueva.inspect} ,Puntos Correctos: #{puntos_correctos_nueva.inspect} ,Total de Puntos: #{total_puntos_nueva.inspect} ,Etapa: #{etapa_nueva.inspect}, #{Time.now} \")\n format.html { redirect_to @calificacion, notice: 'La calificacion ha sido actualizado con exito. ' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calificacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def refresh\n # logger.debug(\"refreshing registration #{to_param}\")\n self.last_all_fetch = nil\n self.last_day_fetch = nil\n self.save!\n end",
"def clear\n\t\t@data_base = {}\n\t\tupdate_database\n\tend",
"def actualizar_duracion\n @trayecto = Trayecto.find(params[:id])\n puts @trayecto.id\n @reserva= Reserva.find(@trayecto.reserva_id)\n @hora_inicial= @reserva.fecha.strftime(\"%H\").to_f\n @hora_inicial1= @reserva.fecha.strftime(\"%M\").to_f\n @hora_inicial_um= @hora_inicial1/60\n @hora_inicial2= @hora_inicial_um+@hora_inicial\n\n @hora= DateTime.parse(params[:hora])\n @hora_final= @hora.strftime(\"%H\").to_f\n puts @hora_final\n @hora_final1= @hora.strftime(\"%M\").to_f\n @hora_final_um=@hora_final1/60\n puts @hora_final_um\n @hora_final2=@hora_final_um +@hora_final\n\n @duracion=@hora_final2- @hora_inicial2\n puts @duracion\n @trayecto.update_attributes(duracion: @duracion)\n\n\n @id= @reserva.mobibus_id\n @conductor= Conductor.where(\"mobibus_id = ?\",@id)\n @conductor_real= @conductor.first.id\n\n @distancia= @trayecto.distancia\n @duracion= @trayecto.duracion\n @velocidad=(@distancia/@duracion).to_f\n @puntaje=9,0\n\n puts @velocidad\n\n # TODO esto se puede escribir como un método aparte en un helper\n if @velocidad >= 35.0\n @puntaje=5.0\n else if @velocidad >=25.0 && @velocidad < 35.0\n @puntaje=4.0\n else if @velocidad >= 20.0 && @velocidad < 25.0\n @puntaje=3.0\n else if @velocidad >= 10.0 && @velocidad < 20.0\n @puntaje=4.0\n else\n @puntaje=1.0\n end\n end\n end\n\n end\n\n # noinspection RailsParamDefResolve\n redirect_to controller:'conductores' ,action:'calcular_puntaje', id:@conductor_real, puntaje:@puntaje\n end",
"def reload!\n fetch_data!\n end",
"def update_data\n @store.get_data true\n end",
"def reload_data\n self.class.new reinit_endpoint.do_get\n end",
"def update\r\n end",
"def update\r\n\r\n end",
"def after_update(trabajo)\n # Si se cambia a estado de finalizado\n if trabajo.finalizado?\n Solicitante.increment_counter(:trabajos_recibidos,trabajo.solicitante_id)\n Proveedor.increment_counter(:trabajos_realizados,trabajo.contratado_id)\n end\n end",
"def save\n update_dc\n super \n end",
"def _save_refresh\n _save_set_values(_refresh_get(this.server?(:default)) || raise(NoExistingObject, \"Record not found\"))\n changed_columns.clear\n end",
"def _save_refresh\n _save_set_values(_refresh_get(this.server?(:default)) || raise(NoExistingObject, \"Record not found\"))\n changed_columns.clear\n end",
"def reload_data\n reset_collection_data\n reload_collection_data\n end",
"def despachar\n self.estado_id = 2 # en ruta\n self.buzon_id = self.destinatario_id\n self.add_traza(current_user.id ,1, current_user.puesto.buzon_id)\n self.recepcion = Time.now\n self.save!\n end",
"def actualizar_plan_general(solicitud_id,params,oficina_id)\n\n oficina = Oficina.find(oficina_id)\n logger.debug \"Actualizando Plan general ===============> #{solicitud_id.to_s}\"\n #logger.debug \"PARAMETROS ===============> \" << params.inspect\n\n @errores = ''\n @plan_inversion = PlanInversion.find(:all,:conditions=>\"solicitud_id = #{solicitud_id}\",\n :order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\",\n :include=>[:unidad_medida])\n\n @errores = ''\n\n begin\n\n # Creación del arreglo de los id del plan de inversion\n \n lista_id = Array.new\n params.each do |k,v|\n \n sep = k.split(\"_\")\n \n if sep[0] == 'cantidad' or sep[0] == 'monto'\n \n if v.to_f > 0 \n \n lista_id << sep[1]\n end\n \n end\n \n end\n \n lista_id.uniq!\n \n #Validación de cantidades y montos que se actualizarán en el plan de inversión\n \n @errores = ''\n \n if !lista_id.empty?\n \n lista_id.each do |id|\n \n\n if params[:\"cantidad_#{id}\"].to_f > 0 and params[:\"monto_#{id}\"].to_f == 0\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.cantidad_mayor_que_cero_costo_no_puede_ser_cero')} #{PlanInversion.find(id).item_nombre}\" << '|'\n\n end\n \n logger.info \"id #{id.to_s})\"\n logger.info \"Params monto #{params[:\"monto_#{id}\"].to_d.to_s} format: #{format_fm(params[:\"monto_#{id}\"])}\"\n logger.info \"Monto plan #{PlanInversion.find(id).costo_maximo.to_s} format: #{PlanInversion.find(id).costo_maximo.to_d.to_s}\"\n if params[:\"monto_#{id}\"].to_d > PlanInversion.find(id).costo_maximo\n\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.monto_asignado_mayor_que_costo_maximo')} #{PlanInversion.find(id).item_nombre}\" << '|'\n end\n \n end\n else\n @errores << I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.debe_tener_al_menos_un_item_con_cantidad_monto')\n end\n \n if !@errores.empty?\n \n return @errores\n end\n \n #Se crea el arreglo de cantidades y montos para pasarlo a la función\n #que actualiza el plan de inversion\n \n if !params.nil?\n \n items_plan = '{'\n primero = true\n if lista_id.empty?\n items_plan = nil\n end\n if !lista_id.empty?\n lista_id.each { |x| items_plan += ( primero ? '' : ',' ) + '{\"' + x.to_s +\n '\",\"' + params[\"cantidad_#{x}\".to_s] +\n '\",\"' + params[\"monto_#{x}\".to_s] + '\"}'; primero = false }\n end\n hay_items = true\n items_plan += \"}\"\n else\n items_plan = '{'\n items_plan += \"}\"\n hay_items = false\n end\n \n logger.info \"Items Plan: ================> #{items_plan.inspect}\"\n \n PlanInversion.transaction do\n\n #Se invoca la función de actualización del plan de inversión\n \n params = {\n :p_solicitud_id=>solicitud_id,\n :p_items_plan =>items_plan,\n :p_hay_items =>hay_items\n }\n \n ejecutar = execute_sp('actualizar_plan_inversion_costo_variable', params.values_at(\n :p_solicitud_id,\n :p_items_plan,\n :p_hay_items))\n\n #@plan_inversion.each do |plan|\n\n #if params[:\"cantidad_#{plan.id}\"].to_f > 0 and params[:\"monto_#{plan.id}\"].to_f == 0\n\n #@errores << \"Si la cantidad es mayor que cero el costo no puede ser cero #{plan.item_nombre}\" << '|'\n\n #end\n\n #if params[:\"monto_#{plan.id}\"].to_f <= plan.costo_maximo.to_f\n\n ##logger.debug \"CANTIDAD #{plan.id} =======> \" << params[:\"cantidad_#{plan.id}\"].to_s\n #logger.debug \"MONTO #{plan.id} =======> \" << params[:\"monto_#{plan.id}\"].to_f.to_s\n #logger.debug \"MONTO CONFIGURADOR =======> \" << plan.costo_maximo.to_f.to_s\n\n #plan.cantidad = params[:\"cantidad_#{plan.id}\"].to_f\n #plan.costo_real = params[:\"monto_#{plan.id}\"].to_f\n #plan.monto_financiamiento = plan.cantidad.to_f * plan.costo_real.to_f\n #plan.save!\n\n #else\n #logger.debug \"Monto mayor que máximo establecido #{plan.item_nombre}\"\n #@errores << \"Monto asignado mayor que costo máximo en #{plan.item_nombre}\" << '|'\n #end #===> Fin if params[\"monto_\"]\n\n #end\n \n #======================================\n # Actualización/Creación del préstamo\n #======================================\n \n # #Prestamo.transaction do\n\n # @solicitud = Solicitud.find(solicitud_id)\n # @prestamo = Prestamo.find_by_solicitud_id(@solicitud.id)\n # logger.info \"Prestamo Leido ==============> #{@prestamo.inspect}\"\n # @plan_inversion = PlanInversion.find_by_solicitud_id(@solicitud.id)\n\n # #Buscando condiciones de financiamiento\n\n # @condiciones = CondicionesFinanciamiento.find_by_programa_id_and_sector_id_and_sub_sector_id_and_rubro_id(@solicitud.programa_id,\n # @solicitud.sector_id,\n # @solicitud.sub_sector_id,\n # @solicitud.rubro_id)\n # #Buscando tasa beneficiario\n\n # #tasa = Tasa.find_by_tipo_cliente_id(solicitud.cliente.tipo_cliente_id)\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n # tasa = Tasa.find_by_sub_rubro_id(@solicitud.sub_rubro_id)\n # @tasa_valor = TasaValor.find_by_sql(\"Select * from tasa_valor where tasa_id = #{tasa.id} order by id desc LIMIT 1\")\n # @tasa_valor = @tasa_valor[0]\n\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # @plan_inversion = PlanInversion.find(:all, :conditions=>\"solicitud_id = #{@solicitud.id}\",:order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\")\n\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n\n # if @solicitud.actividad.paquetizado\n\n # @solicitud.hectareas_recomendadas = 0\n # @solicitud.semovientes_recomendados = 0.00\n # else\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.semovientes_recomendados = 0.00\n\n # @solicitud.semovientes_recomendados = PlanInversion.sum(:cantidad, :conditions=>\"(partida_nombre like \\'\\%SEMOVIENTES\\%\\' or partida_nombre like \\'\\%TORO REPRODUCTOR\\%\\') and solicitud_id = #{@solicitud.id.to_s}\")\n # if @solicitud.semovientes_recomendados.nil?\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.save\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # if @prestamo.nil?\n\n # logger.info \"Entro por prestamo nil ===========================>\"\n # @producto = Producto.find_by_programa_id_and_sector_id_and_sub_sector_id(@solicitud.programa_id, @solicitud.sector_id, @solicitud.sub_sector_id)\n\n # prestamo = Prestamo.new(:solicitud=>@solicitud, :producto=>@producto, :oficina=>oficina, :destinatario=>\"E\")\n\n # prestamo.monto_solicitado = monto_prestamo.to_f\n \n # # -----------------------------------------\n # # Calculo del sras\n # # ---------------------rubro---------------\n\n # parametro = ParametroGeneral.find(1)\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # plazo_total = prestamo.plazo + prestamo.meses_gracia\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # prestamo.monto_sras_primer_ano = sras_primer_ano\n # prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # prestamo.monto_sras_total = sras_total\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # prestamo.tasa_inicial = @tasa_valor.valor\n # prestamo.tasa_vigente = @tasa_valor.valor\n # prestamo.tasa_valor = @tasa_valor.valor\n # prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # prestamo.tasa_id = tasa.id\n\n # prestamo.monto_banco = monto_banco.to_f\n # prestamo.monto_insumos = monto_insumo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # logger.debug \"Rutina de Gastos al crear el prestamo\"\n # gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # logger.debug \"GASTOS==============> \"<<@gastos.inspect\n\n # total_gasto = 0.00\n # unless (gastos.nil?)\n # if gastos.porcentaje > 0\n # monto = ((prestamo.monto_banco + prestamo.monto_insumos)*(gastos.porcentaje/100))\n # else\n # monto = gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n\n # @solicitud.monto_solicitado = prestamo.monto_banco + prestamo.monto_insumos + prestamo.monto_sras_total + prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n\n # prestamo.save\n # logger.info \"Save despues de insert #{prestamo.errors.full_messages.to_s}\"\n\n # if prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # else\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # logger.info \"Entro por else =======> #{@prestamo.inspect}\"\n # @prestamo.tasa_inicial = @tasa_valor.valor\n # @prestamo.tasa_vigente = @tasa_valor.valor\n # @prestamo.tasa_valor = @tasa_valor.valor\n # @prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # @prestamo.tasa_id = tasa.id\n\n\n # # ------------------------------------\n # # Calculo del sras\n # # ------------------------------------\n\n # parametro = ParametroGeneral.find(1)\n # logger.info \"Parametro General =======> #{parametro.inspect}\"\n # logger.info \"Prestamo ================> #{prestamo.inspect}\"\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # plazo_total = @prestamo.plazo + @prestamo.meses_gracia\n\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo.to_f * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # @prestamo.monto_sras_primer_ano = sras_primer_ano\n # @prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # @prestamo.monto_sras_total = sras_total\n # @prestamo.monto_banco = monto_banco.to_f\n # @prestamo.monto_insumos = monto_insumo.to_f\n # @prestamo.monto_solicitado = monto_prestamo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # #logger.debug \"Rutina de Gastos al modificar el prestamo\"\n # @gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # #logger.debug \"GASTOS==============> \"<<@gastos.inspect\n # total_gasto = 0.00\n\n # unless (@gastos.nil?)\n # if @gastos.porcentaje > 0\n # monto = ((@prestamo.monto_banco + @prestamo.monto_insumos)*(@gastos.porcentaje/100))\n # else\n # monto = @gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # @prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n # @solicitud.monto_solicitado = @prestamo.monto_banco + @prestamo.monto_insumos + @prestamo.monto_sras_total + @prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n # @prestamo.save\n # logger.info \"Save despues de actualizacion #{@prestamo.errors.full_messages.to_s}\"\n # if @prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # end\n\n #end # ----> Fin Prestamo.transaction do\n \n end #===> Fin PlanInversion.transaction do\n\n rescue => detail\n\n logger.info \"Errorressssssss ====> #{@errores.to_s + detail.message + detail.backtrace.to_s}\"\n return @errores + detail.message\n end\n\n if @errores.empty?\n @errores = true\n end\n return @errores\n end",
"def refresh\n set_attributes\n end",
"def update\n @achadoperdido.data_entrega = @achadoperdido.morador_id != nil ? Time.zone.now : nil\n respond_to do |format|\n if @achadoperdido.update(achadoperdido_params)\n format.html { redirect_to @achadoperdido, notice: 'Alteração realizada com sucesso.' }\n format.json { render :show, status: :ok, location: @achadoperdido }\n else\n format.html { render :edit }\n format.json { render json: @achadoperdido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar_stock\n delta = (cantidad_was.nil? ? 0 : cantidad_was) - cantidad\n logger.debug(\"delta #{delta} = cantidad_was #{cantidad_was} - cantidad #{cantidad}\")\n modificar_stock delta\n end",
"def update\n # TODO: implement update\n end",
"def update\n @cegonha = Cegonha.find(params[:id])\n @cegonha.carros = @cegonha.cars.count\n\n if defined?(params[:cegonha][:pagamento_attributes])\n if !(params[:cegonha][:pagamento_attributes]).nil?\n converter_string_to_bigdecimal(@cegonha, params[:cegonha][:pagamento_attributes])\n end\n end\n if params[:salvar_localizacao]\n\n @cegonha.estado_id = params[:estado_id]\n @cegonha.estado_origem = params[:estado_origem]\n @cegonha.estado_destino = params[:estado_destino]\n\n # atençao! Ele vai pegar a cidade pelo nome, e nao separa por estado - pode ser\n # que se futuramente queira-se comprar a cidade pelo ID, pode dar erro (pegar cidade com mesmo nome mas\n # de estados diferentes )\n cidade_atual = Cidade.find_by_text(params[:cidade_id]).id\n cidade_origem = Cidade.find_by_text(params[:cidade_origem]).id\n cidade_destino = Cidade.find_by_text(params[:cidade_destino]).id\n\n @cegonha.cidade_id = cidade_atual\n @cegonha.cidade_origem = cidade_origem\n @cegonha.cidade_destino = cidade_destino\n\n\n\n # altera a localizacao de todos os carros que estao na cegonha\n unless @cegonha.cars.nil?\n @cegonha.cars.each do |car|\n car.estado_id = @cegonha.estado_id\n car.cidade_id = @cegonha.cidade_id\n car.localizacao = \"#{params[:cidade_id]}, #{Estado.find(params[:estado_id]).sigla}\"\n car.save\n end\n end\n\n @cegonha.localizacao = \"#{params[:cidade_id]}, #{Estado.find(params[:estado_id]).sigla}\"\n end\n\n respond_to do |format|\n if @cegonha.update_attributes(params[:cegonha])\n # se chegou no destino, todos os carros saem da cegonha e o status deles muda para descarregados.\n #if\n\n # redirect_to logistica_cegonha_path(@cegonha) and return\n chegou_no_destino?(@cegonha)\n ativar_status_de_carro_com_terceiros(@cegonha.id, @cegonha.class.to_s)\n if params[:salvar_localizacao]\n if checar_logistica_carros(@cegonha.id)\n redirect_to logistica_cegonha_path(@cegonha) and return\n else\n format.html { redirect_to @cegonha, notice: 'Dados da cegonha atualizados com sucesso.' }\n end\n elsif params[:editar_localizacao]\n flash[:notice] = 'Dados atualizados com sucesso!'\n redirect_to :action => :edit, :cegonha => @cegonha, :editar_localizacao => true and return\n else\n format.html { redirect_to @cegonha, notice: 'Dados da cegonha atualizados com sucesso.' }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cegonha.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @morador.data_alteracao = DateTime.now\n respond_to do |format|\n if @morador.update(morador_params)\n format.html { redirect_to @morador, notice: 'Morador foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @morador }\n else\n format.html { render :edit }\n format.json { render json: @morador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reload\n old_data = @data.dup\n self.load\n @data = old_data.merge! @data\n end",
"def update\n\t\tend",
"def update\n\t\tend",
"def reload\n clear_memoizations!\n remove = data.keys.find_all do |k|\n ![:id, :name].include?(k.to_sym)\n end\n remove.each do |k|\n data.delete(k)\n end\n super\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def update\r\n end",
"def actualizar\n \n @puntaje.tipo = params_puntaje[:tipo]\n @puntaje.save\n redirect_to puntajes_path\n end",
"def clear\n\t\t@data.clear\n\t\t@modified = true\n\tend",
"def update\n @planificacion = Planificacion.find(params[:id])\n tarea_antigua = @planificacion.tarea\n etapa_antigua = @planificacion.etapa\n fecha_entrega_antigua = @planificacion.fecha_entrega\n total_puntos_antiguo = @planificacion.total_puntos\n descripcion_antigua = @planificacion.descripcion\n\n respond_to do |format|\n if @planificacion.update_attributes(params[:planificacion])\n tarea_nueva = @planificacion.tarea\n etapa_nueva = @planificacion.etapa\n fecha_entrega_nueva = @planificacion.fecha_entrega\n total_puntos_nuevo = @planificacion.total_puntos\n descripcion_nueva = @planificacion.descripcion\n\n format.html { redirect_to @planificacion, notice: 'La planificacion ha sido actualizada con exito.' }\n CustomLogger.info(\"Los datos antes de ser actualizados son: tarea: #{tarea_antigua.inspect}, Etapa: #{etapa_antigua.inspect}, Fecha de Entrega: #{fecha_entrega_antigua.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Descripcion: #{descripcion_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: Tarea: #{tarea_nueva.inspect}, Etapa: #{etapa_nueva.inspect}, Fecha de Entrega: #{fecha_entrega_nueva.inspect} ,Total de Puntos: #{total_puntos_nuevo.inspect} ,Descripcion: #{descripcion_nueva.inspect}, #{Time.now}\")\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @planificacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n\t\t#creo una clase juego con la matriz que ya cree\r\n\t\t@Juego=Juego.new(@a.tablero,@x1,@y1)\r\n\t\t@Juego.turno!\r\n\t\t@NoTurno += 1\r\n\t\tputs \"numero de turno: #{@NoTurno}\"\t\t\r\n\t\t\r\n\tend",
"def actualizarElementosContenido\n\n\n contenido_id = params[:contenido][:id]\n \n # Se borran elementos originales del contenido\n @elementos_asociados = Elemento.find(:all, :conditions => \"contenido_id = #{params[:contenido][:id]}\")\n \n for elemento in @elementos_asociados\n elemento.destroy\n end\n \n\n @elementos = params[:elemento]\n logger.debug(\"Esta es la cantidad de elementos para grabar nuevos: #{@elementos.size()}\" )\n if (!@elementos.nil? && @elementos.size() > 0 )\n \n # Guardando los nuevos elementos\n @elementos.each do |elemento|\n\n campos = elemento[1] # 1 corresponde al hash de campos / 0 es el id del elemento actual\n \n elemento_nuevo = Elemento.new()\n elemento_nuevo.id = campos[:id]\n elemento_nuevo.ubicacion = campos[:ubicacion] \n elemento_nuevo.contenido_id = contenido_id\n elemento_nuevo.valor = campos[:valor]\n elemento_nuevo.tipo_id = campos[:tipo_id]\n \n # Salvo\n elemento_nuevo.save!\n \n end\n end \n end",
"def update\n # Se actualiza el calculo con los valores del formulario\n @calculo.update(calculo_params)\n # Variables auxiliares en el calculo del tubo\n a = @calculo.diametro_cilindro\n b = @calculo.velocidad_cilindro\n diam_cil = [8.1, 12.16, 20, 25, 32, 40, 50, 63, 80, 100, 125, 140, 160]\n vel_cil = [50, 100, 150, 200, 250, 300, 400, 500, 750, 1000]\n # Hash con los valores de la primer tabla\n total = {[8.1,50]=>0.1, [8.1,100]=>0.1, [8.1,150]=>0.15, [8.1,200]=>0.2, [8.1,250]=>0.25, [8.1,300]=>0.3, [8.1,400]=>0.4, [8.1,500]=>0.5, [8.1,750]=>0.75, [8.1,1000]=>1, \n [12.16,50]=>0.12, [12.16,100]=>0.23, [12.16,150]=>0.36, [12.16,200]=>0.46, [12.16,250]=>0.6, [12.16,300]=>0.72, [12.16,400]=>1, [12.16,500]=>1.2, [12.16,750]=>1.8, [12.16,1000]=>2.4, \n [20,50]=>0.2, [20,100]=>0.4, [20,150]=>0.6, [20,200]=>0.8, [20,250]=>1, [20,300]=>1.2, [20,400]=>1.6, [20,500]=>2, [20,750]=>3, [20,1000]=>4, \n [25,50]=>0.35, [25,100]=>0.67, [25,150]=>1, [25,200]=>1.3, [25,250]=>1.7, [25,300]=>2, [25,400]=>2.7, [25,500]=>3.4, [25,750]=>5, [25,1000]=>6.7, \n [32,50]=>0.55, [32,100]=>1.1, [32,150]=>1.7, [32,200]=>2.2, [32,250]=>2.8, [32,300]=>3.7, [32,400]=>4.4, [32,500]=>5.5, [32,750]=>8.5, [32,1000]=>11, \n [40,50]=>0.85, [40,100]=>1.7, [40,150]=>2.6, [40,200]=>3.4, [40,250]=>4.3, [40,300]=>5, [40,400]=>6.8, [40,500]=>8.5, [40,750]=>12.8, [40,1000]=>17, \n [50,50]=>1.4, [50,100]=>2.7, [50,150]=>4, [50,200]=>5.4, [50,250]=>6.8, [50,300]=>8.1, [50,400]=>10.8, [50,500]=>13.5, [50,750]=>20.3, [50,1000]=>27, \n [63,50]=>2.1, [63,100]=>4.2, [63,150]=>6.3, [63,200]=>8.4, [63,250]=>10.5, [63,300]=>12.6, [63,400]=>16.8, [63,500]=>21, [63,750]=>31.5, [63,1000]=>42, \n [80,50]=>3.4, [80,100]=>6.8, [80,150]=>10.2, [80,200]=>13.6, [80,250]=>17, [80,300]=>20.4, [80,400]=>27.2, [80,500]=>34, [80,750]=>51, [80,1000]=>68, \n [100,50]=>5.4, [100,100]=>10.8, [100,150]=>16.2, [100,200]=>21.6, [100,250]=>27, [100,300]=>32.4, [100,400]=>43.2, [100,500]=>54, [100,750]=>81, [100,1000]=>108, \n [125,50]=>8.4, [125,100]=>16.8, [125,150]=>25.2, [125,200]=>33.6, [125,250]=>42, [125,300]=>50.4, [125,400]=>67.2, [125,500]=>84, [125,750]=>126, [125,1000]=>168, \n [140,50]=>10.6, [140,100]=>21.1, [140,150]=>31.7, [140,200]=>42.2, [140,250]=>52.8, [140,300]=>62, [140,400]=>84.4, [140,500]=>106, [140,750]=>158, [140,1000]=>211, \n [160,50]=>13.8, [160,100]=>27.6, [160,150]=>41.4, [160,200]=>55.2, [160,250]=>69, [160,300]=>82.8, [160,400]=>110, [160,500]=>138, [160,750]=>207, [160,1000]=>276}\n # Hash con sus respectivos valores para el tubo\n tubo = {1.48 => '4 x 2.5', 3.72 => '6 x 4', 6.73 => '8 x 5', 10.00 => '8 x 6', 12.70 => '10 x 6.5', 19.97 => '10 x 7.5', 20.92 => '12 x 8', 29.45 => '12 x 9'}\n \n respond_to do |format|\n if @calculo.save\n # Adaptar a valoreas admitibles\n i = 0\n while i <= diam_cil.size - 1\n if a > diam_cil[-1]\n a = diam_cil[-1]\n break\n elsif a < diam_cil[0]\n a = diam_cil[0]\n break\n elsif a >= diam_cil[i] && a < diam_cil[i+1]\n a = diam_cil[i]\n end\n i += 1\n end\n\n i = 0\n while i <= vel_cil.size - 1\n if b > vel_cil[-1]\n b = vel_cil[-1]\n break\n elsif b < vel_cil[0]\n b = vel_cil[0]\n break\n elsif b >= vel_cil[i] && b < vel_cil[i+1]\n b = vel_cil[i]\n end\n i += 1\n end\n \n # Usando los valores se encuentra el diametro del tubo\n c = total[[a,b]] \n i = 0\n while i <= tubo.keys.size - 1\n if c < tubo.keys[0]\n c = tubo.keys[0]\n break\n elsif c > tubo.keys[-1]\n c = tubo.keys[-1]\n break\n elsif c >= tubo.keys[i] && c < tubo.keys[i+1]\n c = tubo.keys[i]\n end\n i += 1\n end\n\n @calculo.diametro_tubo = tubo[c]\n @calculo.save\n \n format.html { redirect_to @calculo, notice: 'Los datos han sido actualizados.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @calculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar_privado\n diasUltimaAct = (Time.now.to_date - self.historiales.last.fecha).to_i\n acts = diasUltimaAct / 30\n fechaquery = \"\"\n resultado = 0.0\n acts.times do\n fechaquery = \"BETWEEN '#{self.historiales.last.fecha}' AND '#{(self.historiales.last.fecha + 30.days)}'\"\n resultado = self.connection().execute(query(fechaquery)).first.first # [[value]] -> value\n if resultado == nil\n resultado = 0.0\n end\n self.historiales.create(:fecha => (self.historiales.last.fecha + 30.days), :valor => resultado, :estatus => \"A\")\n end\n end",
"def update\n @crianca = Crianca.find(params[:id])\n @atualiza_log = Log.new\n @atualiza_log.user_id = current_user.id\n @atualiza_log.obs = \"Atualizado\"\n @atualiza_log.data = (Time.now().strftime(\"%d/%m/%y %H:%M\")).to_s\n @atualiza_log.crianca_id = @crianca.id\n @atualiza_log.save\n\n respond_to do |format|\n if @crianca.update_attributes(params[:crianca])\n flash[:notice] = 'Criança atualizada com sucesso.'\n if @crianca.desistiu == true then\n format.html { redirect_to desistencia_crianca_path(:id => @crianca.id) }\n else\n format.html { redirect_to(@crianca) }\n end\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @crianca.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_datos_estudiante\n @datos_estudiante = DatosEstudiante.find(params[:id])\n end",
"def update\n respond_to do |format|\n Compra.transaction do\n if @compra.guardar(compra_params, params[:guardar_si_o_si].present?)\n format.html { redirect_to @compra, notice: t('mensajes.save_success', recurso: 'la compra') }\n format.json { render :show, status: :created, location: @compra }\n else\n @pago = @compra.recibos_detalles.first.recibo if @compra.recibos_detalles.first\n @pago.rebuild_detalles if @pago\n format.html { render :form }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def preenche_parcelas_recorrencia\n return unless recorrencia\n \n if recorrencia.tipo == 'por'\n recorrencia.data_inicial = data\n recorrencia.parcelas = recorrencia.descobre_parcelas\n else\n recorrencia.parcelas = nil\n end\n end",
"def _refresh_set_values(hash)\n reset_initial_values\n super\n end",
"def update \n end",
"def salvar\n @pagamento = Pagamento.find(params[:id])\n # valores recebidos por parâmetro\n @pagamento.id_transacao_moip = params[:idmoip]\n @pagamento.data_pag_moip = params[:datapag]\n @pagamento.data_pag_inss = params[:datapaginss]\n # seta os valores\n @pagamento.update_attributes(params[:pagamento])\n\n respond_to do |format|\n format.html { redirect_to action: :index }\n end\n end",
"def update\r\n @solicitudlabexa = Solicitudlabexa.find(params[:id])\r\n saveObject(params)\r\n getViewModel\r\n\r\n respond_to do |format|\r\n if @solicitudlabexa.save\r\n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"Solicitud cursada por admin\",\"Cambios en \").deliver_later \r\n @solicitudlabexas = Solicitudlabexa.all\r\n format.html { redirect_to :action => \"index\" }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\"}\r\n format.xml { render :xml => @solicitudlabexa.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\nend",
"def update\n\n @aviso.atualizadoPor = \"Gustavo Soares\" #adicionar gem devise\n @aviso.dataDeAtualizacao = Time.now\n\n respond_to do |format|\n if @aviso.update(aviso_params)\n format.html { redirect_to @aviso, notice: 'Aviso was successfully updated.' }\n format.json { render :show, status: :ok, location: @aviso }\n else\n format.html { render :edit }\n format.json { render json: @aviso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # Evitar que se cambie el estado si todos los precios son 0\n precios_actualizados = false\n pedido_cotizacion_params[:pedido_cotizacion_detalles_attributes].each do |d|\n unless precios_actualizados\n precios_actualizados = true if d[1]['costo_unitario'].to_i > 0\n end\n end\n\n if @pedido_cotizacion.estado == PedidosEstados::PENDIENTE && precios_actualizados\n @pedido_cotizacion.estado = PedidosEstados::COTIZADO\n @pedido_cotizacion.fecha_cotizado = DateTime.now\n end\n if @pedido_cotizacion.update(pedido_cotizacion_params)\n CustomLogging.create(item_type: 'PedidoCotizacion', item_id: @pedido_cotizacion.id, event: 'update', whodunnit: current_user.id, object: YAML::dump(@pedido_cotizacion.attributes), created_at: DateTime.now)\n\n flash.notice = \"Se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n index\n else\n flash.alert = \"No se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n usuario_temp = Usuario.new(params[:usuario])\n \n if !usuario_temp.senha_atual.blank?\n @usuario.atualizar_senha = true\n if @usuario.senha_segura != encrypt(usuario_temp.senha_atual,nil)\n @usuario.errors.add :senha_atual, \"Senha inválida\"\n flash[:error] = \"Senha inválida\"\n render :action => \"edit\"\n return\n end\n @usuario.senha_segura = encrypt(usuario_temp.senha_flag,nil)\n end\n \n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:usuario=>@usuario,:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n \n end\n end\n #UsuarioMailer.cadastro_ok(@usuario).deliver\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario].reject{|k,v| v.blank?})\n usuario_logged_refresh\n flash[:success] = \"Dados atualizados com sucesso\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully updated.') }\n format.xml { head :ok }\n else\n flash[:error] = \"Erro ao atualizar dados\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def refresh\n @mtus = nil\n end"
] |
[
"0.6564907",
"0.65211755",
"0.63907367",
"0.6385923",
"0.6359656",
"0.61805063",
"0.6162918",
"0.6162918",
"0.61603683",
"0.6144519",
"0.61349416",
"0.61294454",
"0.60968935",
"0.60604745",
"0.603641",
"0.6032311",
"0.6019897",
"0.60102487",
"0.59705305",
"0.59436005",
"0.59422064",
"0.5941042",
"0.59149235",
"0.59054244",
"0.58860165",
"0.5870144",
"0.5841598",
"0.5837168",
"0.5837168",
"0.5837168",
"0.5837168",
"0.5837168",
"0.5837168",
"0.5837168",
"0.5837168",
"0.58319294",
"0.5829369",
"0.5821811",
"0.5812411",
"0.579387",
"0.57937205",
"0.5791263",
"0.5781244",
"0.5774752",
"0.57605827",
"0.57585865",
"0.57495755",
"0.5741425",
"0.5739302",
"0.57356864",
"0.5733985",
"0.57217175",
"0.57138103",
"0.57108",
"0.5704567",
"0.5663959",
"0.5661216",
"0.565435",
"0.5648939",
"0.5647256",
"0.5639649",
"0.56383324",
"0.5624224",
"0.56240237",
"0.56240237",
"0.5619005",
"0.5615561",
"0.56000125",
"0.5599344",
"0.55976087",
"0.5590783",
"0.5589036",
"0.5586618",
"0.5583512",
"0.5582993",
"0.55767256",
"0.55767256",
"0.557662",
"0.5573319",
"0.5573319",
"0.5573319",
"0.5573319",
"0.5569805",
"0.55694795",
"0.55638945",
"0.55614555",
"0.55533844",
"0.5551999",
"0.55515623",
"0.55511487",
"0.55419487",
"0.55305684",
"0.55246425",
"0.55233586",
"0.5523253",
"0.55232126",
"0.5521225",
"0.5520228",
"0.55049896",
"0.5496372",
"0.5495843"
] |
0.0
|
-1
|
Cerrada actualizacion de datos por el interlocutor
|
def close_entry?
closed_at < DateTime.now
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def updated_data; end",
"def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"def updated_data\n\tend",
"def actualizar_objetivos\n mes = params[:mes]\n anio = params[:anio] \n @vendedor = Vendedor.find(params[:vendedor][:id])\n cantidad_op = params[:oportunidades]\n cantidad_pm = params[:pruebas_manejo]\n cantidad_v = params[:ventas]\n cantidad_f = params[:financiaciones]\n cantidad_c = params[:calidad] \n tipo_objetivo_id = 7\n objetivo_op = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_op.to_i == 0 and cantidad_pm.to_i == 0 and cantidad_v.to_i == 0 and cantidad_f.to_i == 0 and cantidad_c.to_i == 0\n msj = \"No hay datos para actualizar\"\n else\n msj = 'Se actualizaron los valores de '\n end\n @errores = Hash.new\n if cantidad_op.to_i != 0\n if objetivo_op != nil\n objetivo_op.cantidad_propuesta = cantidad_op\n if objetivo_op.save \n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo_op.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_op\n if objetivo.save\n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 4\n objetivo_pm = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_pm.to_i != 0 \n if objetivo_pm != nil\n objetivo_pm.cantidad_propuesta = cantidad_pm\n if objetivo_pm.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo_pm.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_pm\n if objetivo.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 5\n objetivo_v = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_v.to_i != 0 \n if objetivo_v != nil\n objetivo_v.cantidad_propuesta = cantidad_v\n if objetivo_v.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo_v.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_v\n if objetivo.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 8\n objetivo_f = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_f.to_i != 0 \n if objetivo_f != nil\n objetivo_f.cantidad_propuesta = cantidad_f\n if objetivo_f.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo_f.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_f\n if objetivo.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 3\n objetivo_c = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_c.to_i != 0 \n if objetivo_c != nil\n objetivo_c.cantidad_propuesta = cantidad_c\n if objetivo_c.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo_c.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_c\n if objetivo.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo.errors.full_messages.first\n end\n end\n end\n\n respond_to do |format|\n if @errores.blank?\n format.html { redirect_to @vendedor, notice: msj }\n format.json { head :no_content }\n else\n @bg_gray = true\n format.html { render :show }\n format.json { render json: @errores, status: :unprocessable_entity }\n end\n end \n end",
"def refresh_data\n raise NotImplementedError\n end",
"def reiniciar\n reset()\n @mapaactual=@mapainicio\n\n end",
"def actualizar_extractos_de_mercaderias\n if fecha_changed?\n detalles.each do |d|\n MercaderiaExtracto.crear_o_actualizar_extracto(d, fecha, d.cantidad, d.cantidad)\n end\n end\n end",
"def actualizar(identificador, tipo, tamanio, asignacion)\n\t\t@tabla.store(identificador.valor.str, tipo)\n\n\t\tif tamanio != nil then\n\t\t\t@tamanio.store(identificador.valor.str, tamanio)\n\t\tend\n\n\t\tif asignacion != nil then\n\t\t\t@asignacion.store(identificador.valor.str, asignacion)\n\t\tend\n\tend",
"def update\n\n @empresa_registrada = EmpresaRegistrada.find(params[:id])\n\n if params[:activar].nil? # El parametro activar indica que no se esta actualñizando datos sino activando empresa\n\n @empresa_registrada.fecha_ultima_modificacion = Time.now # Se registra la fecha en que se edita la empresa\n \n # DATOS BASICOS EMPRESA SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:nombre_empresa] = params[:empresa_registrada][:nombre_empresa].upcase if params[:empresa_registrada][:nombre_empresa]\n params[:empresa_registrada][:nombre_comercial] = params[:empresa_registrada][:nombre_comercial].upcase if params[:empresa_registrada][:nombre_comercial]\n params[:empresa_registrada][:direccion_empresa] = params[:empresa_registrada][:direccion_empresa].upcase if params[:empresa_registrada][:direccion_empresa]\n params[:empresa_registrada][:circunscripcion_judicial] = params[:empresa_registrada][:circunscripcion_judicial].upcase if params[:empresa_registrada][:circunscripcion_judicial]\n params[:empresa_registrada][:rep_legal] = params[:empresa_registrada][:rep_legal].upcase if params[:empresa_registrada][:rep_legal]\n params[:empresa_registrada][:cargo_rep_legal] = params[:empresa_registrada][:cargo_rep_legal].upcase if params[:empresa_registrada][:cargo_rep_legal]\n params[:empresa_registrada][:nacionalidad_responsable_legal] = params[:empresa_registrada][:nacionalidad_responsable_legal].upcase if params[:empresa_registrada][:nacionalidad_responsable_legal]\n params[:empresa_registrada][:domicilio_responsable_legal] = params[:empresa_registrada][:domicilio_responsable_legal].upcase if params[:empresa_registrada][:domicilio_responsable_legal]\n\n\n # DATOS EAN SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_ean] = params[:empresa_registrada][:rep_ean].upcase if params[:empresa_registrada][:rep_ean]\n params[:empresa_registrada][:rep_ean_cargo] = params[:empresa_registrada][:rep_ean_cargo].upcase if params[:empresa_registrada][:rep_ean_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta] = params[:empresa_registrada][:galpon_edificio_quinta].upcase if params[:empresa_registrada][:galpon_edificio_quinta]\n params[:empresa_registrada][:oficina_apartamento] = params[:empresa_registrada][:oficina_apartamento].upcase if params[:empresa_registrada][:oficina_apartamento]\n params[:empresa_registrada][:avenida_calle] = params[:empresa_registrada][:avenida_calle].upcase if params[:empresa_registrada][:avenida_calle]\n params[:empresa_registrada][:urbanizacion_barrio_sector] = params[:empresa_registrada][:urbanizacion_barrio_sector].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector]\n params[:empresa_registrada][:parroquia_ean] = params[:empresa_registrada][:parroquia_ean].upcase if params[:empresa_registrada][:parroquia_ean]\n params[:empresa_registrada][:punto_ref_ean] = params[:empresa_registrada][:punto_ref_ean].upcase if params[:empresa_registrada][:punto_ref_ean]\n\n\n # DATOS CORREO ELECTRONICO Y SINCRONET SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_edi] = params[:empresa_registrada][:rep_edi].upcase if params[:empresa_registrada][:rep_edi]\n params[:empresa_registrada][:rep_edi_cargo] = params[:empresa_registrada][:rep_edi_cargo].upcase if params[:empresa_registrada][:rep_edi_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta_sincronet] = params[:empresa_registrada][:galpon_edificio_quinta_sincronet].upcase if params[:empresa_registrada][:galpon_edificio_quinta_sincronet]\n params[:empresa_registrada][:piso_numero_sincronet] = params[:empresa_registrada][:piso_numero_sincronet].upcase if params[:empresa_registrada][:piso_numero_sincronet]\n params[:empresa_registrada][:oficina_apartamento_sincronet] = params[:empresa_registrada][:oficina_apartamento_sincronet].upcase if params[:empresa_registrada][:oficina_apartamento_sincronet]\n params[:empresa_registrada][:avenida_calle_sincronet] = params[:empresa_registrada][:avenida_calle_sincronet].upcase if params[:empresa_registrada][:avenida_calle_sincronet]\n params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet] = params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet]\n params[:empresa_registrada][:parroquia_edi] = params[:empresa_registrada][:parroquia_edi].upcase if params[:empresa_registrada][:parroquia_edi]\n params[:empresa_registrada][:punto_ref_edi] = params[:empresa_registrada][:punto_ref_edi].upcase if params[:empresa_registrada][:punto_ref_edi]\n\n \n # DATOS RECURSOS SE LLEVAN A MAYUSCULA \n \n params[:empresa_registrada][:rep_recursos] = params[:empresa_registrada][:rep_recursos].upcase if params[:empresa_registrada][:rep_recursos]\n params[:empresa_registrada][:rep_recursos_cargo] = params[:empresa_registrada][:rep_recursos_cargo].upcase if params[:empresa_registrada][:rep_recursos_cargo]\n\n # DATOS MERCADEO SE LLEVAN A MAYUSCULA\n\n params[:empresa_registrada][:rep_mercadeo] = params[:empresa_registrada][:rep_mercadeo].upcase if params[:empresa_registrada][:rep_mercadeo]\n params[:empresa_registrada][:rep_mercadeo_cargo] = params[:empresa_registrada][:rep_mercadeo_cargo].upcase if params[:empresa_registrada][:rep_mercadeo_cargo]\n \n # Se obtienen los numeros completos\n\n params[:empresa_registrada][:contacto_tlf1_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf1] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf1] if params[:empresa_registrada][:cod_contacto_tlf1] != \"\"\n params[:empresa_registrada][:contacto_tlf2_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf2] + \")\"+ \" \" + params[:empresa_registrada][:contacto_tlf2] if params[:empresa_registrada][:cod_contacto_tlf2] != \"\"\n params[:empresa_registrada][:contacto_tlf3_completo] =\"(\"+ params[:empresa_registrada][:cod_contacto_tlf3] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf3] if params[:empresa_registrada][:cod_contacto_tlf3] != \"\"\n params[:empresa_registrada][:contacto_fax_completo] = \"(\"+params[:empresa_registrada][:cod_contacto_fax] + \")\" +\" \"+ params[:empresa_registrada][:contacto_fax] if params[:empresa_registrada][:cod_contacto_fax] != \"\"\n params[:empresa_registrada][:direccion_ean] = params[:empresa_registrada][:tipo_urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:tipo_avenida_calle] + \" \" + params[:empresa_registrada][:avenida_calle] + \" \" + params[:empresa_registrada][:tipo_galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:tipo_piso_numero] + \" \" + params[:empresa_registrada][:piso_numero] + \" \" + params[:empresa_registrada][:tipo_oficina_apartamento] + \" \" + params[:empresa_registrada][:oficina_apartamento] \n params[:empresa_registrada][:telefono1_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf1_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono1_ean] if params[:empresa_registrada][:cod_tlf1_ean] != \"\"\n params[:empresa_registrada][:telefono2_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf2_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono2_ean] if params[:empresa_registrada][:cod_tlf2_ean] != \"\"\n params[:empresa_registrada][:telefono3_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf3_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono3_ean] if params[:empresa_registrada][:cod_tlf3_ean] != \"\"\n params[:empresa_registrada][:fax_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_fax_ean] + \")\" +\" \"+ params[:empresa_registrada][:fax_ean] if params[:empresa_registrada][:cod_fax_ean] != \"\" \n\n # SE OBTIENE EL RIF COMPLETO\n\n params[:empresa_registrada][:rif_completo] = params[:empresa_registrada][:tipo_rif] + \"-\" + params[:empresa_registrada][:rif]\n\n end\n \n\n respond_to do |format|\n \n if params[:activar] # Si se esta activando la empresa no se aactualiza los datos porque ese usuario no tiene el privilegio\n\n Empresa.activar(@empresa_registrada, params[:empresa_registrada][:prefijo])\n Auditoria.registrar_evento(session[:usuario],\"\", \"Activar\", Time.now, \"EMPRESA ACTIVADA. PREFIJO:#{@empresa_registrada.prefijo}\")\n format.html { redirect_to \"/empresa_registradas?activar_empresa=true\", notice: \"EMPRESA ACTIVADA. PREFIJO #{@empresa_registrada.prefijo} NOMBRE EMPRESA #{@empresa_registrada.nombre_empresa} RIF #{@empresa_registrada.rif_completo}\" and return }\n\n else # Se actualizan los datos de la empresa privilegio asociado a Administracion - VEntas\n\n if @empresa_registrada.update_attributes(params[:empresa_registrada])\n \n Auditoria.registrar_evento(session[:usuario],\"empresa_registradas\", \"Editar\", Time.now, params[:empresa_registrada])\n format.html { redirect_to \"/empresa_registradas\", notice: \"Los datos de la Empresa:#{@empresa_registrada.nombre_empresa} RIF:#{@empresa_registrada.rif_completo} fueron actualizados satisfactoriamente.\" and return}\n \n \n else\n format.html { render action: \"edit\" }\n \n end\n\n end\n\n\n\n end\n end",
"def update\n buenosFrascos = obtener_frascos_string(params[:id])\n indice = buenosFrascos.index(\"#\", buenosFrascos.index(\"#\", buenosFrascos.index(\"$\"+params[:idFra]+\"#\"))+1)+1\n puts indice\n \n\n if(Integer(params[:noRet]) == 0)\n actualizar = Time.new\n puts actualizar.strftime(\"%Y-%m-%d\")\n actualizar = actualizar.strftime(\"%Y-%m-%d\")\n mensaje = 'Se ha entregado el frasco'\n else\n actualizar = 'NO RETIRO'\n mensaje = 'Se ha cambiado el estado del frasco a NO RETIRADO'\n end\n buenosFrascos.insert(indice,actualizar)\n puts buenosFrascos\n @frasco.frascos = buenosFrascos\n @frasco.saltar_validacion_usuario = true\n @frasco.validar_usuario_nuevo = false\n respond_to do |format|\n if @frasco.save\n format.html { redirect_to frasco_path(params[:id]), notice: mensaje }\n format.json { render :show, status: :ok, location: @frasco }\n else\n format.html { render :show }\n format.json { render json: @frasco.errors, status: :unprocessable_entity }\n end\n end\n puts \"Ando actualizando\"\n end",
"def update\r\n \r\n @valor_oferta = sivic_relatorioscelula_params[:VALR_Oferta] \r\n \r\n @valor_oferta = @valor_oferta.gsub('.', '')\r\n @valor_oferta = @valor_oferta.gsub(',', '.').to_f\r\n \r\n @sivic_relatorioscelula.data_reuniao = sivic_relatorioscelula_params[:data_reuniao]\r\n @sivic_relatorioscelula.DATA_Horainicio = sivic_relatorioscelula_params[:DATA_Horainicio]\r\n @sivic_relatorioscelula.DATA_HoraTermino = sivic_relatorioscelula_params[:DATA_HoraTermino]\r\n @sivic_relatorioscelula.NUMR_NumVisitante = sivic_relatorioscelula_params[:NUMR_NumVisitante]\r\n @sivic_relatorioscelula.NUMR_NumParticipante = sivic_relatorioscelula_params[:NUMR_NumParticipante]\r\n @sivic_relatorioscelula.DESC_AssuntoEstudo = sivic_relatorioscelula_params[:DESC_AssuntoEstudo]\r\n @sivic_relatorioscelula.DESC_TextoBiblico = sivic_relatorioscelula_params[:DESC_TextoBiblico]\r\n @sivic_relatorioscelula.VALR_Oferta = @valor_oferta\r\n @sivic_relatorioscelula.NUMR_Decisoes = sivic_relatorioscelula_params[:NUMR_Decisoes]\r\n @sivic_relatorioscelula.DESC_OutrasInformacoes = sivic_relatorioscelula_params[:DESC_OutrasInformacoes]\r\n @sivic_relatorioscelula.DATA_HoraTermino = sivic_relatorioscelula_params[:DATA_HoraTermino]\r\n @sivic_relatorioscelula.sivic_situacoesrelatorio_id = sivic_relatorioscelula_params[:sivic_situacoesrelatorio_id]\r\n @sivic_relatorioscelula.NUMR_QtdNovoConvertido = sivic_relatorioscelula_params[:NUMR_QtdNovoConvertido]\r\n @sivic_relatorioscelula.NUMR_QtdResgate = sivic_relatorioscelula_params[:NUMR_QtdResgate]\r\n @sivic_relatorioscelula.NUMR_QtdPreEncontro = sivic_relatorioscelula_params[:NUMR_QtdPreEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdEncontro = sivic_relatorioscelula_params[:NUMR_QtdEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdPosEncontro = sivic_relatorioscelula_params[:NUMR_QtdPosEncontro]\r\n @sivic_relatorioscelula.NUMR_QtdEscoLid1 = sivic_relatorioscelula_params[:NUMR_QtdEscoLid1]\r\n @sivic_relatorioscelula.NUMR_EscoLid2 = sivic_relatorioscelula_params[:NUMR_EscoLid2]\r\n @sivic_relatorioscelula.NUMR_EscoLid3 = sivic_relatorioscelula_params[:NUMR_EscoLid3]\r\n @sivic_relatorioscelula.NUMR_QtdLidCelula = sivic_relatorioscelula_params[:NUMR_QtdLidCelula]\r\n \r\n \r\n respond_to do |format|\r\n if @sivic_relatorioscelula.save\r\n format.html { redirect_to @sivic_relatorioscelula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_relatorioscelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @calificacion = Calificacion.find(params[:id])\n calificacion_antigua = @calificacion.calificacion\n materia_antigua = @calificacion.materia_materia\n puntos_correctos_antiguo = @calificacion.puntos_correctos\n total_puntos_antiguo = @calificacion.total_puntos\n etapa_antigua = @calificacion.etapa\n\n respond_to do |format|\n if @calificacion.update_attributes(params[:calificacion])\n calificacion_nueva = @calificacion.calificacion\n materia_nueva = @calificacion.materia_materia\n puntos_correctos_nueva = @calificacion.puntos_correctos\n total_puntos_nueva = @calificacion.total_puntos\n etapa_nueva = @calificacion.etapa\n CustomLogger.info(\"Los datos antes de ser actualizados son: calificacion: #{calificacion_antigua.inspect} ,Materia: #{materia_antigua.inspect} ,Puntos Correctos: #{puntos_correctos_antiguo.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Etapa: #{etapa_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: calificacion: #{calificacion_nueva.inspect} ,Materia: #{materia_nueva.inspect} ,Puntos Correctos: #{puntos_correctos_nueva.inspect} ,Total de Puntos: #{total_puntos_nueva.inspect} ,Etapa: #{etapa_nueva.inspect}, #{Time.now} \")\n format.html { redirect_to @calificacion, notice: 'La calificacion ha sido actualizado con exito. ' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calificacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reset()\n @actual =@inicio\n end",
"def data\n update_data\n @data\n end",
"def imprimir_parciales1\n\n #aqui guardo todos los datos que necesito para imprimirlos en las variable\n\n @width_layout = '955'\n @form_title = ''\n @imprimo='1'\n\n @factura_orden_despacho_otra= FacturaOrdenDespacho.find(:all, :conditions=>\"id in #{params[:parciales_id]}\")\n\n factura_orden_despacho_count=FacturaOrdenDespacho.count(:all, :conditions=>\"id in #{params[:parciales_id]}\")\n\n @factura_orden_despacho=FacturaOrdenDespacho.find(:first, :conditions=>\"id in #{params[:parciales_id]}\")\n\n contw=0\n \n while contw < factura_orden_despacho_count\n @factura_orden_despacho_otra[contw].update_column(:emitida, true)\n #@factura_orden_despacho_otra[contw].emitida=true\n #@factura_orden_despacho_otra[contw].send(:update_without_callbacks)\n contw+=1\n\n end\n\n solicitu=OrdenDespacho.find(OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id).solicitud_id\n\n @solicitudes = Solicitud.find(:all,:conditions => ['id = ?', solicitu])\n\n unless @solicitudes[0].nil?\n if !@solicitudes[0].cliente.persona_id.nil? \n \t@es_no=1\n \t@datos_cliente=Persona.find(@solicitudes[0].cliente.persona_id) unless @solicitudes[0].nil?\n else\n \t@es_no=2\n \t@datos_cliente=Empresa.find(@solicitudes[0].cliente.empresa_id) unless @solicitudes[0].nil?\n end\n end\n @numero_desembolso=OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id\n\n @orden_despacho= OrdenDespacho.find(:all,:conditions => ['solicitud_id = ?', solicitu])\n\n\n @oficina= Oficina.find(:all,:conditions => ['id = ?', @solicitudes[0].oficina_id]) unless @solicitudes[0].nil?\n\n\n @parametros_general=ParametroGeneral.find(:first)\n\n @condition = \" orden_despacho_id = #{@factura_orden_despacho.orden_despacho_detalle.orden_despacho_id} and cantidad > 0\"\n @total = OrdenDespachoDetalle.count(:conditions=>@condition)\n @list = OrdenDespachoDetalle.find(:all, :conditions => ['orden_despacho_id = ? and cantidad > 0', @factura_orden_despacho.orden_despacho_detalle.orden_despacho_id])\n\n @total_saldo_entregar=0\n @total_precio_total=0\n cont=0\n diferencia=0.00\n @total_monto_confirmado=0.00\n \n while cont< @total\n\n #if OrdenDespacho.find(@numero_desembolso).estatus_id==20000 || OrdenDespacho.find(@numero_desembolso).estatus_id==20010 || OrdenDespacho.find(@numero_desembolso).estatus_id==20020\n \t \n # codigo nuevo al 3/9/2013 \n if ( ((@list[cont].cantidad * @list[cont].costo_real)!=@list[cont].monto_financiamiento) and (@list[cont].monto_recomendado!=0))\n @total_saldo_entregar+=@list[cont].monto_recomendado\n diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n else\n @total_saldo_entregar+=@list[cont].monto_financiamiento\n diferencia=@list[cont].monto_financiamiento - @list[cont].monto_facturacion\n end\n #codigo nuevo al 3/9/2013 \n \n \n #else\n \t #@total_saldo_entregar+=@list[cont].monto_recomendado\n #diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n #end\n @total_monto_confirmado+=@list[cont].monto_facturacion\n \n logger.debug \"monto financiamiento = \" << @list[cont].monto_financiamiento.to_s\n logger.debug \"monto facturacion = \" << @list[cont].monto_facturacion.to_s\n logger.debug \"diferencia = \" << diferencia.to_s\n if diferencia < 0\n diferencia=diferencia * -1 \n\n end\n \n @total_precio_total+=diferencia\n\n #@total_precio_total+=@list[cont].monto_facturacion\n \tcont+=1\t\n end\n @vista = 'view_factura_orden_despacho_parciales'\n\nend",
"def update\n @orden_cobro = OrdenCobro.find(params[:id])\n estadoAnterior = @orden_cobro.estado_cobro.Nombre\n respond_to do |format|\n if @orden_cobro.update_attributes(params[:orden_cobro])\n\tlog = Log.new(:NombreTable => \"orden_cobros\", :Fecha => Date.today, :Hora => Time.now, :Usuario => current_user.username, :AccionRealizada => \"Update\")\n\tlog.save\n hist = HistorialOdc.new(:orden_cobro_id => @orden_cobro.id, :EstadoOdcSiguiente => @orden_cobro.estado_cobro.Nombre, :EstadoOdcAnterior => estadoAnterior, :fecha=> Date.today , :hora => Time.now, :NumRecibo => @orden_cobro.NumRecibo)\n hist.save\n\n format.html { redirect_to @orden_cobro, notice: 'Orden cobro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_cobro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n usuario_temp = Usuario.new(params[:usuario])\n \n if !usuario_temp.senha_atual.blank?\n @usuario.atualizar_senha = true\n if @usuario.senha_segura != encrypt(usuario_temp.senha_atual,nil)\n @usuario.errors.add :senha_atual, \"Senha inválida\"\n flash[:error] = \"Senha inválida\"\n render :action => \"edit\"\n return\n end\n @usuario.senha_segura = encrypt(usuario_temp.senha_flag,nil)\n end\n \n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:usuario=>@usuario,:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n \n end\n end\n #UsuarioMailer.cadastro_ok(@usuario).deliver\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario].reject{|k,v| v.blank?})\n usuario_logged_refresh\n flash[:success] = \"Dados atualizados com sucesso\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully updated.') }\n format.xml { head :ok }\n else\n flash[:error] = \"Erro ao atualizar dados\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def actualiza_atributos_diariodets \n sum_debe = 0\n sum_haber = 0\n sum_debe_sec = 0\n sum_haber_sec = 0\n item_max = 0\n idcuenta_ajuste_dif_cambio = 709 #Catalogo.find_by(id: Catalogo::ID_CTA_AJUSTE_DIF_CAMBIO)\n\n set_datos_segun_conf\n\n if self.origenasiento_id == 1 # si es manual actualiza columnas debe, haber...\n diariodets.each do |child| \n if child.ajuste.blank? or child.ajuste == '0'\n cod_moneda_trasac = Moneda.find_by(id:child.moneda_id).codigo \n child.tcori = self.tc\n child.ajuste = '0' \n if cod_moneda_trasac == Moneda::CODIGO_SYS[:nal]\n child.debe = (child.debeori).round(2) \n child.haber = (child.haberori).round(2) \n child.debesec = (child.debeori/Conta::TCV_CONST).round(2) \n child.habersec = (child.haberori/Conta::TCV_CONST).round(2) \n child.tcsec = child.tcori\n else\n if cod_moneda_trasac == Moneda::CODIGO_SYS[:sec]\n tc_transac = 0\n if Conta::TCV_CONST != child.tcori\n tc_transac = child.tcori\n else\n tc_transac = Conta::TCV_CONST\n end\n child.tcsec = tc_transac\n\n child.debe = (child.debeori*tc_transac).round(2) \n child.haber = (child.haberori*tc_transac).round(2) \n\n child.debesec = (child.debeori).round(2) \n child.habersec = (child.haberori).round(2) \n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:sec]\n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:nal]\n if item_max < child.item\n item_max = child.item\n end \n sum_debe = sum_debe + child.debe\n sum_haber = sum_haber + child.haber\n sum_debe_sec = sum_debe_sec + child.debesec\n sum_haber_sec = sum_haber_sec + child.habersec\n end #if child.ajuste.blank? or child.ajuste == '0'\n end #end diariodets.each do |child|\n\n ###\n ###cuadre global\n if (sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n ajuste = 0\n ajuste_sec = 0 \n ajuste = sum_debe - sum_haber\n ajuste_sec = sum_debe_sec - sum_haber_sec \n if ajuste != 0 \n if ajuste > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => ajuste, :debesec => 0, :habersec => 0, :debeori => 0, :haberori => ajuste, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n else\n ajuste = ajuste * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => ajuste, :haber => 0, :debesec => 0, :habersec => 0, :debeori => ajuste, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n end#end ajuste > 0\n end# end ajuste != 0 \n if ajuste_sec != 0\n if ajuste_sec > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber =>0 , :debesec => 0, :habersec => ajuste_sec, :debeori => 0, :haberori => ajuste_sec, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2)\n else\n ajuste_sec = ajuste_sec * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => 0, :debesec => ajuste_sec, :habersec => 0, :debeori => ajuste_sec, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2) \n end#end ajuste_sec > 0\n end# end ajuste_sec != 0 \n end #(sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n end#if self.tipocomprobante_id != 5 # si es automatico no aplica lo siguiente \n end",
"def update\n \n end",
"def actualizar\n #Pasamos el 'id' del registro a actualizar\n @eventos = Evento.find(params[:id])\n @eventos = Evento.where(id: @eventos)\n end",
"def actualizar_extracto_de_cuenta_corriente\n if deleted?\n CuentaCorrienteExtracto.eliminar_movimiento(self.becomes(Boleta), fecha, importe_pendiente * -1)\n else\n if persona_id_changed? && !persona_id_was.nil? # si cambio de cuenta corriente\n old = get_old_boleta\n CuentaCorrienteExtracto.eliminar_movimiento(old.becomes(Boleta), fecha_was, importe_pendiente_was * -1)\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, 0, importe_pendiente)\n else\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, importe_pendiente_was.to_f, importe_pendiente)\n end\n end\n end",
"def refresh\r\n # ゲームデータをロードした直後はアクターオブジェクトが\r\n # $game_actors から分離してしまっている。\r\n # ロードのたびにアクターを再設定することで問題を回避する。\r\n new_actors = []\r\n for i in 0...@actors.size\r\n if $data_actors[@actors[i].id] != nil\r\n new_actors.push($game_actors[@actors[i].id])\r\n end\r\n end\r\n @actors = new_actors\r\n end",
"def update\n @teste=Reuniao.new(reuniao_params)\n if @reuniao.status ==\"finalizada\" \n redirect_to @reuniao , notice: 'Desculpe mas,reuniao finalizada não pode ser auterada.'\n \n else\n respond_to do |format|\n\n if @reuniao.update(reuniao_params)\n @pautum=Pautum.search(@reuniao.pautum)\n @pautum[0].status=@reuniao.status\n @pautum[0].titulo=@reuniao.titulo\n\n @pautum[0].save\n\n @atum=Atum.search(@reuniao.atum)\n @atum[0].status=@reuniao.status\n @atum[0].save\n format.html { redirect_to @reuniao, notice: 'Reuniao was successfully updated.' }\n format.json { render :show, status: :ok, location: @reuniao }\n else\n format.html { render :edit }\n format.json { render json: @reuniao.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def clear\n\t\t@data_base = {}\n\t\tupdate_database\n\tend",
"def update\n authorize! :update, Cargo\n respond_to do |format|\n # if !@cargo.sueldos.where(created_at: Time.now.beginning_of_month..Time.now.end_of_month).empty?\n nuevo = false\n if $quincena == 0\n nuevo = @cargo.sueldos.where(created_at: Time.now.beginning_of_month..(Time.now.beginning_of_month + 14.days)).empty?\n else\n nuevo = @cargo.sueldos.where(created_at: (Time.now.beginning_of_month + 15.days)..Time.now.end_of_month).empty?\n end\n key, value = params[:cargo][:sueldos_attributes].first\n\n if nuevo\n\n viejo = @cargo.sueldos.where(activo: true).last\n\n @cargo.sueldos.update_all(activo: false)\n crear = @cargo.sueldos.new\n crear.monto = params[:cargo][:sueldos_attributes][key][:monto]\n crear.sueldo_integral = params[:cargo][:sueldos_attributes][key][:sueldo_integral]\n\n params[:cargo][:sueldos_attributes][key][:monto] = viejo.monto\n params[:cargo][:sueldos_attributes][key][:sueldo_integral] = viejo.sueldo_integral\n\n end\n if @cargo.update(cargo_params)\n log(\"Se ha actualizado el cargo: #{@lt}\", 1)\n\n format.html { redirect_to @cargo, notice: 'Los datos del cargo fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @cargo }\n else\n format.html { render :edit }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar_plan_general(solicitud_id,params,oficina_id)\n\n oficina = Oficina.find(oficina_id)\n logger.debug \"Actualizando Plan general ===============> #{solicitud_id.to_s}\"\n #logger.debug \"PARAMETROS ===============> \" << params.inspect\n\n @errores = ''\n @plan_inversion = PlanInversion.find(:all,:conditions=>\"solicitud_id = #{solicitud_id}\",\n :order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\",\n :include=>[:unidad_medida])\n\n @errores = ''\n\n begin\n\n # Creación del arreglo de los id del plan de inversion\n \n lista_id = Array.new\n params.each do |k,v|\n \n sep = k.split(\"_\")\n \n if sep[0] == 'cantidad' or sep[0] == 'monto'\n \n if v.to_f > 0 \n \n lista_id << sep[1]\n end\n \n end\n \n end\n \n lista_id.uniq!\n \n #Validación de cantidades y montos que se actualizarán en el plan de inversión\n \n @errores = ''\n \n if !lista_id.empty?\n \n lista_id.each do |id|\n \n\n if params[:\"cantidad_#{id}\"].to_f > 0 and params[:\"monto_#{id}\"].to_f == 0\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.cantidad_mayor_que_cero_costo_no_puede_ser_cero')} #{PlanInversion.find(id).item_nombre}\" << '|'\n\n end\n \n logger.info \"id #{id.to_s})\"\n logger.info \"Params monto #{params[:\"monto_#{id}\"].to_d.to_s} format: #{format_fm(params[:\"monto_#{id}\"])}\"\n logger.info \"Monto plan #{PlanInversion.find(id).costo_maximo.to_s} format: #{PlanInversion.find(id).costo_maximo.to_d.to_s}\"\n if params[:\"monto_#{id}\"].to_d > PlanInversion.find(id).costo_maximo\n\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.monto_asignado_mayor_que_costo_maximo')} #{PlanInversion.find(id).item_nombre}\" << '|'\n end\n \n end\n else\n @errores << I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.debe_tener_al_menos_un_item_con_cantidad_monto')\n end\n \n if !@errores.empty?\n \n return @errores\n end\n \n #Se crea el arreglo de cantidades y montos para pasarlo a la función\n #que actualiza el plan de inversion\n \n if !params.nil?\n \n items_plan = '{'\n primero = true\n if lista_id.empty?\n items_plan = nil\n end\n if !lista_id.empty?\n lista_id.each { |x| items_plan += ( primero ? '' : ',' ) + '{\"' + x.to_s +\n '\",\"' + params[\"cantidad_#{x}\".to_s] +\n '\",\"' + params[\"monto_#{x}\".to_s] + '\"}'; primero = false }\n end\n hay_items = true\n items_plan += \"}\"\n else\n items_plan = '{'\n items_plan += \"}\"\n hay_items = false\n end\n \n logger.info \"Items Plan: ================> #{items_plan.inspect}\"\n \n PlanInversion.transaction do\n\n #Se invoca la función de actualización del plan de inversión\n \n params = {\n :p_solicitud_id=>solicitud_id,\n :p_items_plan =>items_plan,\n :p_hay_items =>hay_items\n }\n \n ejecutar = execute_sp('actualizar_plan_inversion_costo_variable', params.values_at(\n :p_solicitud_id,\n :p_items_plan,\n :p_hay_items))\n\n #@plan_inversion.each do |plan|\n\n #if params[:\"cantidad_#{plan.id}\"].to_f > 0 and params[:\"monto_#{plan.id}\"].to_f == 0\n\n #@errores << \"Si la cantidad es mayor que cero el costo no puede ser cero #{plan.item_nombre}\" << '|'\n\n #end\n\n #if params[:\"monto_#{plan.id}\"].to_f <= plan.costo_maximo.to_f\n\n ##logger.debug \"CANTIDAD #{plan.id} =======> \" << params[:\"cantidad_#{plan.id}\"].to_s\n #logger.debug \"MONTO #{plan.id} =======> \" << params[:\"monto_#{plan.id}\"].to_f.to_s\n #logger.debug \"MONTO CONFIGURADOR =======> \" << plan.costo_maximo.to_f.to_s\n\n #plan.cantidad = params[:\"cantidad_#{plan.id}\"].to_f\n #plan.costo_real = params[:\"monto_#{plan.id}\"].to_f\n #plan.monto_financiamiento = plan.cantidad.to_f * plan.costo_real.to_f\n #plan.save!\n\n #else\n #logger.debug \"Monto mayor que máximo establecido #{plan.item_nombre}\"\n #@errores << \"Monto asignado mayor que costo máximo en #{plan.item_nombre}\" << '|'\n #end #===> Fin if params[\"monto_\"]\n\n #end\n \n #======================================\n # Actualización/Creación del préstamo\n #======================================\n \n # #Prestamo.transaction do\n\n # @solicitud = Solicitud.find(solicitud_id)\n # @prestamo = Prestamo.find_by_solicitud_id(@solicitud.id)\n # logger.info \"Prestamo Leido ==============> #{@prestamo.inspect}\"\n # @plan_inversion = PlanInversion.find_by_solicitud_id(@solicitud.id)\n\n # #Buscando condiciones de financiamiento\n\n # @condiciones = CondicionesFinanciamiento.find_by_programa_id_and_sector_id_and_sub_sector_id_and_rubro_id(@solicitud.programa_id,\n # @solicitud.sector_id,\n # @solicitud.sub_sector_id,\n # @solicitud.rubro_id)\n # #Buscando tasa beneficiario\n\n # #tasa = Tasa.find_by_tipo_cliente_id(solicitud.cliente.tipo_cliente_id)\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n # tasa = Tasa.find_by_sub_rubro_id(@solicitud.sub_rubro_id)\n # @tasa_valor = TasaValor.find_by_sql(\"Select * from tasa_valor where tasa_id = #{tasa.id} order by id desc LIMIT 1\")\n # @tasa_valor = @tasa_valor[0]\n\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # @plan_inversion = PlanInversion.find(:all, :conditions=>\"solicitud_id = #{@solicitud.id}\",:order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\")\n\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n\n # if @solicitud.actividad.paquetizado\n\n # @solicitud.hectareas_recomendadas = 0\n # @solicitud.semovientes_recomendados = 0.00\n # else\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.semovientes_recomendados = 0.00\n\n # @solicitud.semovientes_recomendados = PlanInversion.sum(:cantidad, :conditions=>\"(partida_nombre like \\'\\%SEMOVIENTES\\%\\' or partida_nombre like \\'\\%TORO REPRODUCTOR\\%\\') and solicitud_id = #{@solicitud.id.to_s}\")\n # if @solicitud.semovientes_recomendados.nil?\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.save\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # if @prestamo.nil?\n\n # logger.info \"Entro por prestamo nil ===========================>\"\n # @producto = Producto.find_by_programa_id_and_sector_id_and_sub_sector_id(@solicitud.programa_id, @solicitud.sector_id, @solicitud.sub_sector_id)\n\n # prestamo = Prestamo.new(:solicitud=>@solicitud, :producto=>@producto, :oficina=>oficina, :destinatario=>\"E\")\n\n # prestamo.monto_solicitado = monto_prestamo.to_f\n \n # # -----------------------------------------\n # # Calculo del sras\n # # ---------------------rubro---------------\n\n # parametro = ParametroGeneral.find(1)\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # plazo_total = prestamo.plazo + prestamo.meses_gracia\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # prestamo.monto_sras_primer_ano = sras_primer_ano\n # prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # prestamo.monto_sras_total = sras_total\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # prestamo.tasa_inicial = @tasa_valor.valor\n # prestamo.tasa_vigente = @tasa_valor.valor\n # prestamo.tasa_valor = @tasa_valor.valor\n # prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # prestamo.tasa_id = tasa.id\n\n # prestamo.monto_banco = monto_banco.to_f\n # prestamo.monto_insumos = monto_insumo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # logger.debug \"Rutina de Gastos al crear el prestamo\"\n # gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # logger.debug \"GASTOS==============> \"<<@gastos.inspect\n\n # total_gasto = 0.00\n # unless (gastos.nil?)\n # if gastos.porcentaje > 0\n # monto = ((prestamo.monto_banco + prestamo.monto_insumos)*(gastos.porcentaje/100))\n # else\n # monto = gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n\n # @solicitud.monto_solicitado = prestamo.monto_banco + prestamo.monto_insumos + prestamo.monto_sras_total + prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n\n # prestamo.save\n # logger.info \"Save despues de insert #{prestamo.errors.full_messages.to_s}\"\n\n # if prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # else\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # logger.info \"Entro por else =======> #{@prestamo.inspect}\"\n # @prestamo.tasa_inicial = @tasa_valor.valor\n # @prestamo.tasa_vigente = @tasa_valor.valor\n # @prestamo.tasa_valor = @tasa_valor.valor\n # @prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # @prestamo.tasa_id = tasa.id\n\n\n # # ------------------------------------\n # # Calculo del sras\n # # ------------------------------------\n\n # parametro = ParametroGeneral.find(1)\n # logger.info \"Parametro General =======> #{parametro.inspect}\"\n # logger.info \"Prestamo ================> #{prestamo.inspect}\"\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # plazo_total = @prestamo.plazo + @prestamo.meses_gracia\n\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo.to_f * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # @prestamo.monto_sras_primer_ano = sras_primer_ano\n # @prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # @prestamo.monto_sras_total = sras_total\n # @prestamo.monto_banco = monto_banco.to_f\n # @prestamo.monto_insumos = monto_insumo.to_f\n # @prestamo.monto_solicitado = monto_prestamo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # #logger.debug \"Rutina de Gastos al modificar el prestamo\"\n # @gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # #logger.debug \"GASTOS==============> \"<<@gastos.inspect\n # total_gasto = 0.00\n\n # unless (@gastos.nil?)\n # if @gastos.porcentaje > 0\n # monto = ((@prestamo.monto_banco + @prestamo.monto_insumos)*(@gastos.porcentaje/100))\n # else\n # monto = @gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # @prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n # @solicitud.monto_solicitado = @prestamo.monto_banco + @prestamo.monto_insumos + @prestamo.monto_sras_total + @prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n # @prestamo.save\n # logger.info \"Save despues de actualizacion #{@prestamo.errors.full_messages.to_s}\"\n # if @prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # end\n\n #end # ----> Fin Prestamo.transaction do\n \n end #===> Fin PlanInversion.transaction do\n\n rescue => detail\n\n logger.info \"Errorressssssss ====> #{@errores.to_s + detail.message + detail.backtrace.to_s}\"\n return @errores + detail.message\n end\n\n if @errores.empty?\n @errores = true\n end\n return @errores\n end",
"def actualizar\n # Pasamos el 'id' del registro a actualizar (método index) \n @quienes_somos = QuienesSomo.find(params[:id])\n @quienes_somos = QuienesSomo.where(id: @quienes_somos)\n\nend",
"def update_values\n end",
"def update_values\n end",
"def update\n @alumno = Alumno.find(params[:id])\n nombre_antiguo = @alumno.user_nombre\n apellido_antiguo = @alumno.user_apellido\n cedula_antiguo = @alumno.user_CINro\n sexo_antiguo = @alumno.user_sexo\n telefono_antiguo = @alumno.user_telefono\n correo_antiguo = @alumno.user_email\n fechaNac_antiguo = @alumno.user_fecha_nacimiento\n lugarNac_antiguo = @alumno.user_lugar_nacimiento\n direccion_antiguo = @alumno.user.address.direccion\n responsable_antiguo = @alumno.responsable\n telefonoRespon_antiguo = @alumno.telefono_responsable\n doc_cedula_antiguo = @alumno.doc_cedula\n doc_cert_estudios_antiguo = @alumno.doc_cert_estudios\n doc_cert_nacimiento_antiguo = @alumno.doc_cert_nacimiento\n doc_foto_antiguo = @alumno.doc_foto\n nombreUsuario_antiguo = @alumno.user_username\n curso_anterior = @alumno.curso\n \n respond_to do |format|\n if @alumno.update_attributes(params[:alumno])\n nombre_nuevo = @alumno.user_nombre\n apellido_nuevo = @alumno.user_apellido\n cedula_nuevo = @alumno.user_CINro\n sexo_nuevo = @alumno.user_sexo\n telefono_nuevo = @alumno.user_telefono\n correo_nuevo = @alumno.user_email\n fechaNac_nuevo = @alumno.user_fecha_nacimiento\n lugarNac_nuevo = @alumno.user_lugar_nacimiento\n direccion_nuevo = @alumno.user.address.direccion\n responsable_nuevo = @alumno.responsable\n telefonoRespon_nuevo = @alumno.telefono_responsable\n doc_cedula_nuevo = @alumno.doc_cedula\n doc_cert_estudios_nuevo = @alumno.doc_cert_estudios\n doc_cert_nacimiento_nuevo = @alumno.doc_cert_nacimiento\n doc_foto_nuevo = @alumno.doc_foto\n nombreUsuario_nuevo = @alumno.user_username\n curso_nuevo = @alumno.curso\n unless @alumno.cursos.exists? curso_nuevo\n @alumno.cursos << curso_nuevo\n end\n user = @alumno.user\n if user.is_docente\n unless user.docente\n d = Docente.new\n d.user_id = user.id\n d.titulo = params[:titulo]\n d.matricula = params[:matricula]\n unless d.save\n user.update_attribute(:is_docente, false);\n format.html { redirect_to edit_docente_path(@docente), notice: 'No se pudo colocar el rol de Docente al Alumno, verifique sus datos.' }\n end\n end\n end\n if user.is_administrativo\n unless user.administrativo\n a = Administrativo.new\n a.user_id = user.id\n a.cargo = params[:cargo]\n a.titulo = params[:titulo]\n unless a.save\n user.update_attribute(:is_administrativo, false)\n format.html { redirect_to edit_docente_path(@docente), notice: 'No se pudo colocar el rol de Administrativo al Alumno, verifique sus datos.' }\n end\n end\n end\n\n CustomLogger.info(\"Los datos antes de ser actualizados son: Nombre del alumno: #{nombre_antiguo.inspect} ,Apellido: #{apellido_antiguo.inspect} ,Cedula de Identidad: #{cedula_antiguo.inspect} ,Sexo: #{sexo_antiguo.inspect} ,Telefono:#{telefono_antiguo.inspect} ,Correo Electronico: #{correo_antiguo.inspect} ,Fecha de Nacimiento:#{fechaNac_antiguo.inspect} ,Lugar de Nacimiento: #{lugarNac_antiguo.inspect} ,Nombre del Responsable: #{responsable_antiguo.inspect} ,Telefono del Responsable: #{telefonoRespon_antiguo.inspect} ,Direccion: #{direccion_antiguo.inspect} ,Documentos Personales: Foto Tipo Carnet: #{doc_foto_antiguo.inspect} ,Cedula: #{doc_cedula_antiguo.inspect} ,Certificado de Nacimiento: #{doc_cert_nacimiento_antiguo.inspect} ,Certificado de Estudio: #{doc_cert_estudios_antiguo.inspect} ,Nombre de Usuario: #{nombreUsuario_antiguo.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: Nombre del alumno: #{nombre_nuevo.inspect} ,Apellido: #{apellido_nuevo.inspect} ,Cedula de Identidad: #{cedula_nuevo.inspect} ,Sexo: #{sexo_nuevo.inspect} ,Telefono:#{telefono_nuevo.inspect} ,Correo Electronico: #{correo_nuevo.inspect} ,Fecha de Nacimiento:#{fechaNac_nuevo.inspect} ,Lugar de Nacimiento: #{lugarNac_nuevo.inspect} ,Nombre del Responsable: #{responsable_nuevo.inspect} ,Telefono del Responsable: #{telefonoRespon_nuevo.inspect} ,Direccion: #{direccion_nuevo.inspect} ,Documentos Personales: Foto Tipo Carnet: #{doc_foto_nuevo.inspect} ,Cedula: #{doc_cedula_nuevo.inspect} ,Certificado de Nacimiento: #{doc_cert_nacimiento_nuevo.inspect} ,Certificado de Estudio: #{doc_cert_estudios_nuevo.inspect} ,Nombre de Usuario: #{nombreUsuario_nuevo.inspect} ,#{Time.now} \")\n format.html { redirect_to @alumno, notice: 'El alumno ha sido actualizado.' }\n format.json { head :no_content }\n else\n @new = false\n atributos\n @endereco = @alumno.user.address\n format.html { render action: \"edit\" }\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @crianca = Crianca.find(params[:id])\n @atualiza_log = Log.new\n @atualiza_log.user_id = current_user.id\n @atualiza_log.obs = \"Atualizado\"\n @atualiza_log.data = (Time.now().strftime(\"%d/%m/%y %H:%M\")).to_s\n @atualiza_log.crianca_id = @crianca.id\n @atualiza_log.save\n\n respond_to do |format|\n if @crianca.update_attributes(params[:crianca])\n flash[:notice] = 'Criança atualizada com sucesso.'\n if @crianca.desistiu == true then\n format.html { redirect_to desistencia_crianca_path(:id => @crianca.id) }\n else\n format.html { redirect_to(@crianca) }\n end\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @crianca.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @dataset\n old_publication_state = @dataset.publication_state\n old_creator_state = @dataset.org_creators || false\n @dataset.release_date ||= Date.current\n\n respond_to do |format|\n if @dataset.update(dataset_params)\n if dataset_params[:org_creators] == \"true\" && old_creator_state == false\n # convert individual creators to additional contacts (contributors)\n @dataset.ind_creators_to_contributors\n params[\"context\"] = \"continue_edit\"\n elsif dataset_params[:org_creators] == \"false\" && old_creator_state == true\n # delete all institutional creators\n @dataset.institutional_creators.delete_all\n # convert all additional contacts (contributors) to individual authors\n @dataset.contributors_to_ind_creators\n params[\"context\"] = \"continue_edit\"\n end\n if params.has_key?(\"context\") && params[\"context\"] == \"exit\"\n if @dataset.publication_state == Databank::PublicationState::DRAFT\n format.html {\n redirect_to \"/datasets?q=&#{CGI.escape('editor')}=#{current_user.username}&context=exit_draft\"\n }\n else\n format.html {\n redirect_to \"/datasets?q=&#{CGI.escape('editor')}=#{current_user.username}&context=exit_doi\"\n }\n end\n elsif params.has_key?(\"context\") && params[\"context\"] == \"publish\"\n if Databank::PublicationState::DRAFT == @dataset.publication_state\n raise \"invalid publication state for update-and-publish\"\n # only update complete datasets\n elsif Dataset.completion_check(@dataset) == \"ok\"\n # set publication_state\n @dataset.publication_state = if @dataset.embargo && [Databank::PublicationState::Embargo::FILE,\n Databank::PublicationState::Embargo::METADATA].include?(@dataset.embargo)\n @dataset.embargo\n else\n Databank::PublicationState::RELEASED\n end\n if old_publication_state != Databank::PublicationState::RELEASED && @dataset.publication_state == Databank::PublicationState::RELEASED\n @dataset.release_date ||= Date.current\n end\n @dataset.save\n # send_dataset_to_medusa only sends metadata files unless old_publication_state is draft\n MedusaIngest.send_dataset_to_medusa(@dataset)\n if @dataset.is_test? || @dataset.update_doi\n format.html { redirect_to dataset_path(@dataset.key) }\n format.json { render :show, status: :ok, location: dataset_path(@dataset.key) }\n else\n format.html {\n redirect_to dataset_path(@dataset.key),\n notice: \"Error updating DataCite Metadata, details have been logged.\"\n }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n else # this else means completion_check was not ok within publish context\n Rails.logger.warn Dataset.completion_check(@dataset)\n raise \"Error: Cannot update published dataset with incomplete information.\"\n end\n elsif params.has_key?(\"context\") && params[\"context\"] == \"continue_edit\"\n format.html { redirect_to edit_dataset_path(@dataset) }\n format.json { render :edit, status: :ok, location: edit_dataset_path(@dataset) }\n else # this else means context was not set to exit or publish - this is the normal draft update\n format.html { redirect_to dataset_path(@dataset.key) }\n format.json { render :show, status: :ok, location: dataset_path(@dataset.key) }\n end\n else # this else means update failed\n format.html { render :edit }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_params\n raise 'Sovrascrivi in figli'\n end",
"def update() end",
"def update\n handle_orcamento_update\n end",
"def update\n @planificacion = Planificacion.find(params[:id])\n tarea_antigua = @planificacion.tarea\n etapa_antigua = @planificacion.etapa\n fecha_entrega_antigua = @planificacion.fecha_entrega\n total_puntos_antiguo = @planificacion.total_puntos\n descripcion_antigua = @planificacion.descripcion\n\n respond_to do |format|\n if @planificacion.update_attributes(params[:planificacion])\n tarea_nueva = @planificacion.tarea\n etapa_nueva = @planificacion.etapa\n fecha_entrega_nueva = @planificacion.fecha_entrega\n total_puntos_nuevo = @planificacion.total_puntos\n descripcion_nueva = @planificacion.descripcion\n\n format.html { redirect_to @planificacion, notice: 'La planificacion ha sido actualizada con exito.' }\n CustomLogger.info(\"Los datos antes de ser actualizados son: tarea: #{tarea_antigua.inspect}, Etapa: #{etapa_antigua.inspect}, Fecha de Entrega: #{fecha_entrega_antigua.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Descripcion: #{descripcion_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: Tarea: #{tarea_nueva.inspect}, Etapa: #{etapa_nueva.inspect}, Fecha de Entrega: #{fecha_entrega_nueva.inspect} ,Total de Puntos: #{total_puntos_nuevo.inspect} ,Descripcion: #{descripcion_nueva.inspect}, #{Time.now}\")\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @planificacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @dataset\n old_publication_state = @dataset.publication_state\n old_creator_state = @dataset.org_creators || false\n @dataset.release_date ||= Date.current\n\n respond_to do |format|\n if @dataset.update(dataset_params)\n if dataset_params[:org_creators] == 'true' && old_creator_state == false\n # convert individual creators to additional contacts (contributors)\n @dataset.ind_creators_to_contributors\n params['context'] = 'continue_edit'\n elsif dataset_params[:org_creators] == 'false' && old_creator_state == true\n # delete all institutional creators\n @dataset.institutional_creators.delete_all\n # convert all additional contacts (contributors) to individual authors\n @dataset.contributors_to_ind_creators\n params['context'] = 'continue_edit'\n end\n if params.has_key?('context') && params['context'] == 'exit'\n if @dataset.publication_state == Databank::PublicationState::DRAFT\n format.html {redirect_to \"/datasets?q=&#{URI.encode('depositors[]')}=#{current_user.name}&context=exit_draft\"}\n else\n format.html {redirect_to \"/datasets?q=&#{URI.encode('depositors[]')}=#{current_user.name}&context=exit_doi\"}\n end\n elsif params.has_key?('context') && params['context'] == 'publish'\n if Databank::PublicationState::DRAFT == @dataset.publication_state\n raise \"invalid publication state for update-and-publish\"\n # only update complete datasets\n elsif Dataset.completion_check(@dataset, current_user) == 'ok'\n # set publication_state\n if @dataset.embargo && [Databank::PublicationState::Embargo::FILE, Databank::PublicationState::Embargo::METADATA].include?(@dataset.embargo)\n @dataset.publication_state = @dataset.embargo\n else\n @dataset.publication_state = Databank::PublicationState::RELEASED\n end\n if old_publication_state != Databank::PublicationState::RELEASED && @dataset.publication_state == Databank::PublicationState::RELEASED\n @dataset.release_date ||= Date.current\n end\n @dataset.save\n # send_dataset_to_medusa only sends metadata files unless old_publication_state is draft\n MedusaIngest.send_dataset_to_medusa(@dataset)\n if @dataset.is_test? || @dataset.update_doi\n format.html {redirect_to dataset_path(@dataset.key)}\n format.json {render :show, status: :ok, location: dataset_path(@dataset.key)}\n else\n format.html {redirect_to dataset_path(@dataset.key), notice: 'Error updating DataCite Metadata, details have been logged.'}\n format.json {render json: @dataset.errors, status: :unprocessable_entity}\n end\n else #this else means completion_check was not ok within publish context\n Rails.logger.warn Dataset.completion_check(@dataset, current_user)\n raise \"Error: Cannot update published dataset with incomplete information.\"\n end\n elsif params.has_key?('context') && params['context'] == 'continue_edit'\n format.html {redirect_to edit_dataset_path(@dataset)}\n format.json {render :edit, status: :ok, location: edit_dataset_path(@dataset)}\n else #this else means context was not set to exit or publish - this is the normal draft update\n format.html {redirect_to dataset_path(@dataset.key)}\n format.json {render :show, status: :ok, location: dataset_path(@dataset.key)}\n end\n else #this else means update failed\n format.html {render :edit}\n format.json {render json: @dataset.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n # Evitar que se cambie el estado si todos los precios son 0\n precios_actualizados = false\n pedido_cotizacion_params[:pedido_cotizacion_detalles_attributes].each do |d|\n unless precios_actualizados\n precios_actualizados = true if d[1]['costo_unitario'].to_i > 0\n end\n end\n\n if @pedido_cotizacion.estado == PedidosEstados::PENDIENTE && precios_actualizados\n @pedido_cotizacion.estado = PedidosEstados::COTIZADO\n @pedido_cotizacion.fecha_cotizado = DateTime.now\n end\n if @pedido_cotizacion.update(pedido_cotizacion_params)\n CustomLogging.create(item_type: 'PedidoCotizacion', item_id: @pedido_cotizacion.id, event: 'update', whodunnit: current_user.id, object: YAML::dump(@pedido_cotizacion.attributes), created_at: DateTime.now)\n\n flash.notice = \"Se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n index\n else\n flash.alert = \"No se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n end\n end",
"def update\n @puntaje = Puntaje.find(params[:id])\n puntaje_antiguo = @puntaje.puntaje\n descripcion_antigua = @puntaje.descripcion\n\n respond_to do |format|\n if @puntaje.update_attributes(params[:puntaje])\n puntaje_nuevo = @puntaje.puntaje\n descripcion_nuevo = @puntaje.descripcion\n\n CustomLogger.info(\"Los datos antes de actualizar son: Puntaje: #{puntaje_antiguo.to_i.inspect} con la descripcion: #{descripcion_antigua.inspect} .Los datos actualizados por el usuario #{current_user.full_name.inspect} son el nuevo puntaje: #{puntaje_nuevo.to_i.inspect} con la descripcion: #{descripcion_nuevo.inspect} ,#{Time.now}\")\n format.html { redirect_to @puntaje, notice: 'El puntaje ha sido actualizado con exito. ' }\n format.json { head :no_content }\n else\n atributos\n format.html { render action: \"edit\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar\n if toca_actualizar\n actualizar_privado\n end\n end",
"def update(parms)\n dn = parms.delete(:naissance)\n self.naissance = Date.civil(dn[:year].to_i, dn[:month].to_i, dn[:day].to_i)\n saveActivites(parms.delete(:activites))\n saveParticipations(parms.delete(:participations))\n \n # s'assurer que les informations pour les lecons de natation ne sont pas presente\n # si pas de lecons. On efface l'input puisque plus valide.\n unless abonneCoursDeNatation?\n parms[:cours_de_natation] = parms[:session_de_natation] = ''\n end\n \n # Finir l'update des autres parametres du membre.\n return super\n end",
"def actualiza_atributos_con(hash, estado)\n # Validación de atributos de plaza, estado y rol.\n if hash[:rol_id].blank?\n self.errors.add(:rol, \"Rol no puede ir vacío\")\n elsif Rol.find(hash[:rol_id]).nombre.eql?(\"Encargado\")\n if hash[:plaza_id].blank?\n self.errors.add(:plaza, \"Plaza no puede ir vacía\")\n end\n if estado.blank?\n self.errors.add(:estado, \"Estado no puede ir vacío\")\n end\n end\n \n return false unless self.errors.empty?\n self.update_attributes(hash.merge({:password => \"cablecom_#{hash[:login]}\", :password_confirmation => \"cablecom_#{hash[:login]}\"}))\n end",
"def update\n @morador.data_alteracao = DateTime.now\n respond_to do |format|\n if @morador.update(morador_params)\n format.html { redirect_to @morador, notice: 'Morador foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @morador }\n else\n format.html { render :edit }\n format.json { render json: @morador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @achadoperdido.data_entrega = @achadoperdido.morador_id != nil ? Time.zone.now : nil\n respond_to do |format|\n if @achadoperdido.update(achadoperdido_params)\n format.html { redirect_to @achadoperdido, notice: 'Alteração realizada com sucesso.' }\n format.json { render :show, status: :ok, location: @achadoperdido }\n else\n format.html { render :edit }\n format.json { render json: @achadoperdido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n File.open(\"log/abschnitt.log\",\"w\"){|f| f.puts \"starte create transportabschnitt\"}\n File.open(\"log/abschnitt.log\",\"a\"){|f| f.puts \"params #{params}\"}\n File.open(\"log/abschnitt.log\",\"a\"){|f| f.puts \"alter ort #{params[:start_ort_ident] != \"\"}\"}\n # Wenn Ort sich geandert hat\n unless params[:start_ort_ident].nil? || params[:start_ort_ident] == \"\"\n if @transportabschnitt.start_ort.nil? || (params[:start_ort_ident].to_i != @transportabschnitt.start_ort.id ) \n @transportabschnitt.start_ort = Ort.find(params[:start_ort_ident].to_i)\n end\n end\n unless params[:end_ort_ident].nil? || params[:end_ort_ident] == \"\" \n if @transportabschnitt.end_ort.nil? || params[:end_ort_ident] != @transportabschnitt.end_ort.id\n @transportabschnitt.end_ort = Ort.find(params[:end_ort_ident].to_i)\n end\n end\n\n @transport = @transportabschnitt.transport \n redirection_path = @transport.nil? ? @transportabschnitt : @transport\n respond_to do |format|\n if @transportabschnitt.update(transportabschnitt_params)\n flash[:success] = \"Transportabschnitt aktualisiert.\"\n format.html { redirect_to redirection_path }\n format.json { render :show, status: :ok, location: @transport }\n else\n init_ort_and_firma\n firma = @transportabschnitt.firma if @transportabschnitt.firma\n format.html { render :edit }\n format.json { render json: @transportabschnitt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n DebugLog('Lancamento - params: ' + params.inspect)\n params[:lancamento][:valor] = params[:lancamento][:valor].gsub('.', '').gsub(',', '.')\n @lancamento = Lancamento.find(params[:id])\n\n @lancamento.category = Category.find_or_create_by_descricao(params[:category]) unless params[:category].blank?\n @lancamento.centrodecusto = Centrodecusto.find_or_create_by_descricao(params[:centrodecusto]) unless params[:centrodecusto].blank?\n\n\n @quitado = params[:quitado]\n @freqParcelas = params[:freqParcelas] unless params[:freqParcelas].blank?\n @numParcelas = Integer(params[:numParcelas]) unless params[:numParcelas].blank?\n\n @freqAgendamentos = params[:freqAgendamentos] unless params[:freqAgendamentos].blank?\n @numAgendamentos = Integer(params[:numAgendamentos]) unless params[:numAgendamentos].blank?\n\n #Validações padrão\n @lancamento.tipo = :receita if @lancamento.tipo.blank?\n @lancamento.valor = 0 if @lancamento.valor.blank?\n\n @numParcelas = 1 if @numParcelas.blank?\n @numAgendamentos = 1 if @numAgendamentos.blank?\n\n @freqParcelas = 'Mensal' if @freqParcelas.blank?\n @freqAgendamentos = 'Mensal' if @freqAgendamentos.blank?\n\n\n if @quitado == 'true'\n @lancamento.status = :quitado\n @lancamento.dataacao = Date.today.strftime('%d-%m-%Y')\n end\n\n #Verifica se o registro ja possui parcela, caso contrário não será permitido parcelamento\n # 2013-05-02: Quando editando o primeiro registro deve ser transformado em um registro parcelado\n\n if @numParcelas > 1 and !@lancamento.has_parcelamento?\n # Cria o registro de parcela\n @parcela = Parcela.new\n @parcela.num_parcelas = @numParcelas\n\n if @parcela.save then\n @lancamento_original = @lancamento.dup\n @lancamento.valor = @lancamento.valor/@numParcelas\n\n @lancamento.descricao = \"#{@lancamento.descricao} - #{@freqParcelas} - (#{1}/#{@numParcelas})\"\n @lancamento.parcela = @parcela\n\n @lancamento.save\n (2..@numParcelas).each do |i|\n @lancamento_parcela = Lancamento.new\n @lancamento_parcela = @lancamento_original.dup\n @lancamento_parcela.valor = @lancamento_original.valor/@numParcelas\n\n @lancamento_parcela.datavencimento = case @freqParcelas\n when 'Semanal' then\n @lancamento_parcela.datavencimento + (i-1).weeks\n when 'Mensal' then\n @lancamento_parcela.datavencimento + (i-1).months\n when 'Semestral' then\n @lancamento_parcela.datavencimento + ((i-1)*6).months\n when 'Anual' then\n @lancamento_parcela.datavencimento + (i-1).years\n else\n @lancamento_parcela.datavencimento\n end\n\n @lancamento_parcela.descricao = \"#{@lancamento_original.descricao} - #{@freqParcelas} - (#{i}/#{@numParcelas})\"\n @lancamento_parcela.parcela = @parcela\n\n @lancamento_parcela.save\n end #do\n end # if @parcela.save\n end # @numParcelas > 1\n\n #Verifica se o registro ja possui agendamento, caso contrário não será permitido agendamento\n if @numAgendamentos > 1 and !@lancamento.has_agendamento?\n # Cria o registro de agendamento\n @agendamento = Agendamento.new\n @agendamento.num_agendamentos = @numAgendamentos\n\n if @agendamento.save\n (2..@numAgendamentos).each do |i|\n @lancamento_agendamento = Lancamento.new\n @lancamento_agendamento = @lancamento.dup\n\n @lancamento_agendamento.datavencimento = case @freqAgendamentos\n when 'Semanal' then\n @lancamento_agendamento.datavencimento + (i-1).weeks\n when 'Mensal' then\n @lancamento_agendamento.datavencimento + (i-1).months\n when 'Semestral' then\n @lancamento_agendamento.datavencimento + ((i-1)*6).months\n when 'Anual' then\n @lancamento_agendamento.datavencimento + (i-1).years\n else\n @lancamento_agendamento.datavencimento\n end\n @lancamento_agendamento.agendamento = @agendamento\n\n @lancamento_agendamento.save\n end #do\n end #@agendamento.save\n end\n\n if (!(@numParcelas > 1 and @lancamento.has_parcelamento?) and !(@numAgendamentos > 1 and @lancamento.has_agendamento?))\n if @lancamento.update_attributes(params[:lancamento])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar o lancamento'\n end\n end\n @lancamentos = Lancamento.unscoped.all\n @lancamento = Lancamento.new\n end",
"def refresh\n @data = read_data\n end",
"def update\n respond_to do |format|\n Compra.transaction do\n if @compra.guardar(compra_params, params[:guardar_si_o_si].present?)\n format.html { redirect_to @compra, notice: t('mensajes.save_success', recurso: 'la compra') }\n format.json { render :show, status: :created, location: @compra }\n else\n @pago = @compra.recibos_detalles.first.recibo if @compra.recibos_detalles.first\n @pago.rebuild_detalles if @pago\n format.html { render :form }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def update ; end",
"def update\n @gastos = Gasto.order(:codigo)\n @company = Company.find(1)\n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @documents = @company.get_documents()\n @employees = @company.get_employees()\n \n @cajas = Caja.all \n\n @destinos = Destino.all\n \n @egresos = Egreso.order(:code)\n\n @viatico_detail = ViaticoDetail.find(params[:id]) \n @viatico_detail.viatico_id = @viatico.id \n @viatico_detail.fecha = params[:viatico_detail][:fecha]\n @viatico_detail.employee_id = params[:ac_employee_id]\n\n \n respond_to do |format|\n if @viatico_detail.update_attributes(employee_id: params[:viatico_detail][:employee_id],fecha: params[:viatico_detail][:fecha],importe: params[:viatico_detail][:importe],\n gasto_id: params[:viatico_detail][:gasto_id],destino_id: params[:viatico_detail][:destino_id],tm:params[:viatico_detail][:tm],numero: params[:viatico_detail][:numero],detalle: params[:viatico_detail][:detalle],document_id: params[:viatico_detail][:tm],egreso_id: params[:viatico_detail][:egreso_id])\n begin\n @viatico[:inicial] = @viatico.get_total_inicial\n rescue\n @viatico[:inicial] = 0\n end \n \n begin\n @viatico[:total_ing] = @viatico.get_total_ing\n rescue \n @viatico[:total_ing] = 0\n end \n begin \n @viatico[:total_egreso]= @viatico.get_total_sal\n rescue \n @viatico[:total_egreso]= 0 \n end \n @viatico[:saldo] = @viatico[:inicial] + @viatico[:total_ing] - @viatico[:total_egreso]\n @viatico.save\n \n if @viatico.caja_id == 1 \n a = @cajas.find(1)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 2\n a = @cajas.find(2)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 3 \n a = @cajas.find(3)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 4 \n a = @cajas.find(4)\n a.inicial = @viatico[:saldo]\n a.save\n end \n format.html { redirect_to @viatico, notice: 'Viatico detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @viatico }\n else\n format.html { render :edit }\n format.json { render json: @viatico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_datos_insumos_reactivo\n @datos_insumos_reactivo = DatosInsumosReactivo.find(params[:id])\n end",
"def reload\n self.data = self.class.load_data\n self\n end",
"def update\n\t\traise CanCan::AccessDenied if !DetalleGasto.accessible_by(current_ability, :update).include?(@detalle_gasto)\n respond_to do |format|\n if @detalle_gasto.update(detalle_gasto_params)\n sesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(descripcion: \"Actualización del detalle gasto #{@detalle_gasto.titulo}, descripcion: #{@detalle_gasto.descripcion}, con monto #{@detalle_gasto.monto}, concepto_gasto: #{@detalle_gasto.concepto_gasto.titulo}, voluntario: #{@detalle_gasto.voluntario.nombre}, comprobante: #{@detalle_gasto.comprobante.numero}\",\n sesion_id: sesion.id, \n proyecto_id: @detalle_gasto.informe_gasto.proyecto.id)\n format.html { redirect_to gestionar_informe_gastos_path(@detalle_gasto.informe_gasto)} #@detalle_gasto, notice: 'Detalle gasto fue actualizado satisfactoriamente.' }\n #format.json { render :show, status: :ok, location: @detalle_gasto }\n else\n format.html { render :edit }\n format.json { render json: @detalle_gasto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update; end",
"def update\n @gastos = Gasto.order(:codigo)\n @company = Company.find(1)\n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @documents = @company.get_documents()\n @employees = @company.get_employees()\n @suppliers = @company.get_suppliers \n @tipomov = Tipomov.all \n @cajas = Caja.all \n @destinos = Destino.all\n \n @viatico_detail = ViaticoDetail.find(params[:id]) \n @viatico_detail.viatico_id = @viatico.id \n @viatico_detail.fecha = params[:viatico_detail][:fecha]\n \n \n \n \n respond_to do |format|\n if @viatico_detail.update_attributes(employee_id: 51 ,\n fecha: params[:viatico_detail][:fecha],\n importe: params[:viatico_detail][:importe],\n gasto_id: params[:viatico_detail][:gasto_id],\n destino_id: params[:viatico_detail][:destino_id],\n tm:params[:viatico_detail][:tm],\n numero: params[:viatico_detail][:numero],\n detalle: params[:viatico_detail][:detalle],\n document_id: params[:viatico_detail][:document_id],\n descrip: params[:viatico_detail][:descrip],\n supplier_id: params[:viatico_detail][:supplier_id])\n begin\n @viatico[:inicial] = @viatico.get_total_inicial\n rescue\n @viatico[:inicial] = 0\n end \n \n begin\n @viatico[:total_ing] = @viatico.get_total_ingreso\n rescue \n @viatico[:total_ing] = 0\n end \n begin \n @viatico[:total_egreso]= @viatico.get_total_egreso\n rescue \n @viatico[:total_egreso]= 0 \n end \n @viatico[:saldo] = @viatico[:inicial] + @viatico[:total_ing] - @viatico[:total_egreso]\n @viatico.save\n \n if @viatico.caja_id == 1 \n a = @cajas.find(1)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 2\n a = @cajas.find(2)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 3 \n a = @cajas.find(3)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 4 \n a = @cajas.find(4)\n a.inicial = @viatico[:saldo]\n a.save\n end \n format.html { redirect_to @viatico, notice: 'Viatico detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @viatico }\n else\n format.html { render :edit }\n format.json { render json: @viatico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n begin\n @usuario.transaction do\n @usuario.update_attributes(params[:usuario])\n @usuario.update_dias_usuario(params[:data_inicio])\n end\n all_saved = true\n rescue ActiveRecord::StatementInvalid\n all_save = false\n end\n\n if all_saved\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _save_refresh\n _save_set_values(_refresh_get(this.server?(:default)) || raise(NoExistingObject, \"Record not found\"))\n changed_columns.clear\n end",
"def _save_refresh\n _save_set_values(_refresh_get(this.server?(:default)) || raise(NoExistingObject, \"Record not found\"))\n changed_columns.clear\n end",
"def resale\n\n end",
"def update\n obtener_datos()\n @status = params[:statusproyect]\n @cliente = params[:cliente] + \" \" +params[:cliente_apellido]\n respond_to do |format|\n if @ventum.update(cliente: @cliente, clave:@clave, fecha:@fecha, iva:@iva,subtotal:@preciofinal ,total:@totalcosto, descuentogeneral: @descglobal , distribuidor: @distribuidor, status: @status)\n @detail.each do |x|\n x.destroy\n end\n salvar()\n format.html { redirect_to @ventum, notice: 'Venta actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @ventum }\n else\n format.html { render :edit }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @solicitudlabexa = Solicitudlabexa.find(params[:id])\r\n saveObject(params)\r\n getViewModel\r\n\r\n respond_to do |format|\r\n if @solicitudlabexa.save\r\n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"Solicitud cursada por admin\",\"Cambios en \").deliver_later \r\n @solicitudlabexas = Solicitudlabexa.all\r\n format.html { redirect_to :action => \"index\" }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\"}\r\n format.xml { render :xml => @solicitudlabexa.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\nend",
"def update\n\t\tauthorize! :update, AsignacionRol\n @asignacion_rol_viejo = AsignacionRol.find(@asignacion_rol.id)\n @asignacion_rol_viejo.esActual=false\n @asignacion_rol_new = AsignacionRol.new\n @asignacion_rol_new.proyecto = @asignacion_rol_viejo.proyecto\n @asignacion_rol_new.rol_id = params[:asignacion_rol][:rol_id]\n @asignacion_rol_new.esActual=true\n @asignacion_rol_new.usuario=@asignacion_rol.usuario\n if unica(@asignacion_rol_new.usuario_id,@asignacion_rol_new.proyecto_id, @asignacion_rol_new.rol_id) == true\n @asignacion_rol_new.save\n\t respond_to do |format|\n\t if @asignacion_rol_viejo.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Actualizar asociación rol #{@asignacion_rol.rol.nombre} al usuario #{@asignacion_rol.usuario.nombreUsuario} del proyecto #{@asignacion_rol.proyecto.nombre} : actual = #{ t @asignacion_rol.esActual.to_s}\",\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @asignacion_rol.proyecto.id)\n\t\tformat.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id \n\t\tflash[:success] = 'Asignacion rol fue actualizado satisfactoriamente.' }\n\t\tformat.json { render :show, status: :ok, location: @asignacion_rol }\n\t else\n\t\tformat.html { render :edit }\n\t\tformat.json { render json: @asignacion_rol.errors, status: :unprocessable_entity }\n\t end\n\t end\n else\n\t respond_to do |format|\n\n\t\t format.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id\n\t\t flash[:danger] = 'El usuario ya se encuentra asignado' } \n\t end\n end\n end",
"def update\n @egreso_interno = EgresoInterno.find(params[:id])\n @total=dinero_actual\n if @egreso_interno.monto>@total\n flash[:warning] = 'El monto de egreso no puede ser mayor al monto actual'\n render action: \"edit\"\n else\n if @egreso_interno.update(egreso_interno_params)\n flash[:success] = \"Egreso Interno actualizado exitosamente\"\n redirect_to @egreso_interno\n else\n render action: \"edit\"\n end\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n @usuario.rol_list = params[:rols_buffer].split(\",\").map { |s| s.to_i }\n dummy = @usuario.rol_list.pop #El ultimo elemento siempre es cero por un defecto...\n\n error_flag = 0\n begin\n @usuario.update_attributes!(params[:usuario])\n rescue\n error_flag = 1\n @usuario.errors.add_to_base \"Error guardando el registro!!!\"\n @rols_disp = Rol.find(:all, :conditions => \"id NOT IN (#{@usuario.rol_list.join(\",\")})\")\n @rols_selec = Rol.find(@usuario.rol_list)\n end\n\n respond_to do |format|\n if error_flag == 0\n flash[:notice] = nil\n format.html { redirect_to(usuarios_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @receita_a_receber.data_alteracao = DateTime.now\n respond_to do |format|\n if @receita_a_receber.update(receita_a_receber_params)\n format.html { redirect_to @receita_a_receber, notice: 'Receita a receber foi atualizada com sucesso!' }\n format.json { render :show, status: :ok, location: @receita_a_receber }\n else\n format.html { render :edit }\n format.json { render json: @receita_a_receber.errors, status: :unprocessable_entity }\n end\n end\n end",
"def on_data_changed\n store_data(data_class.all_columns)\n end",
"def update\n begin\n @cargo_manifest = CargoManifest.find(params[:id])\n CargoManifest.transaction do\n # MEJORAR!\n @cargo_manifest.update_attribute('manifest_num', params[:cargo_manifest][:manifest_num].to_i)\n @cargo_manifest.update_attribute('total_weight', params[:data][:total_weight])\n @cargo_manifest.update_attribute('total_products', params[:data][:total_products])\n @cargo_manifest.update_attribute('total_guides', params[:data][:total_guides])\n #se crea el detalle\n old_cargo_manifest_details= CargoManifestDetail.where(cargo_manifest_id: @cargo_manifest.id)\n old_cargo_manifest_details.each do |e|\n e.transport_guide.update_attribute('transport_guide_state_id', TransportGuideState.find_by_name_state('En Proceso').id)\n e.destroy\n end\n cargo_manifest_details= params[:transport_guides_list]\n cargo_manifest_details.each do |k,v|\n cargo_manifest_detail = CargoManifestDetail.new\n cargo_manifest_detail.cargo_manifest_id=@cargo_manifest.id\n cargo_manifest_detail.transport_guide_id=v.to_i\n transport_guide = TransportGuide.find(v.to_i)\n transport_guide.update_attribute('transport_guide_state_id', TransportGuideState.find_by_name_state('Procesado').id )\n cargo_manifest_detail.save\n end\n\n end\n respond_to do |format|\n format.html { redirect_to new_cargo_manifest_path, notice: \"Actualizado Correctamente!\"}\n format.json { head :no_content}\n end\n\n rescue ActiveRecord::StatementInvalid\n CustomLogger.error(\"Error al actualizar manifiesto de carga: #{@cargo_manifest.inspect}, usuario: #{current_user.inspect}, #{Time.now}\")\n manejo_error_pg(@cargo_manifest)\n\n rescue\n respond_to do |format|\n format.html { redirect_to new_cargo_manifest_path, notice: \"Error en al actualizar el manifiesto de carga!\"}\n format.json { head :no_content}\n end\n \n end\n \n end",
"def _refresh(dataset)\n super\n recalculate_values_hashes\n end",
"def refresh\n @deserialized_values = {}\n super\n end",
"def actualizar_intermedio\n quedan = @registro.caracterizacionpersona.where(\n \"respuestafor_id IN (SELECT id \" +\n \"FROM mr519_gen_respuestafor AS rf \" +\n \"JOIN cor1440_gen_caracterizacionpf AS cpf ON \" +\n \"rf.formulario_id=cpf.formulario_id JOIN \" +\n \"cor1440_gen_beneficiariopf AS bpf ON \" +\n \"bpf.proyectofinanciero_id=cpf.proyectofinanciero_id \" +\n \"WHERE bpf.persona_id=?)\",\n @registro.id,\n ).pluck(:id)\n elim = @registro.caracterizacionpersona_ids - quedan\n if elim != []\n Cor1440Gen::Caracterizacionpersona.where(id: elim).delete_all\n end\n true\n end",
"def update_gen\n respond_to do |format|\n # En etiquetas pone usuario actual por omision\n if (!params[:caso][:caso_etiqueta_attributes].nil?)\n params[:caso][:caso_etiqueta_attributes].each do |k,v|\n if (v[:usuario_id].nil? || v[:usuario_id] == \"\")\n v[:usuario_id] = current_usuario.id\n end\n end\n end\n\n # En familiares si falta crear trelacion_persona para personas\n # autocompletadas los crea\n if caso_params[:victima_attributes]\n caso_params[:victima_attributes].each do |iv, v|\n if v[:persona_attributes] &&\n v[:persona_attributes][:persona_trelacion1_attributes]\n v[:persona_attributes][:persona_trelacion1_attributes].each do |it, t|\n if t && (!t[:id] || t[:id] == '') &&\n t[:personados_attributes] &&\n t[:personados_attributes][:id] &&\n t[:personados_attributes][:id].to_i > 0 &&\n Msip::Persona.where(\n id: t[:personados_attributes][:id].to_i).count == 1\n pt_e = Msip::PersonaTrelacion.where(\n persona1: v[:persona_attributes][:id],\n persona2: t[:personados_attributes][:id]\n )\n if !pt_e\n pt = Msip::PersonaTrelacion.create({\n persona1: v[:persona_attributes][:id],\n persona2: t[:personados_attributes][:id]\n })\n pt.save!(validate: false)\n params[:caso][:victima_attributes][iv][:persona_attributes][:persona_trelacion1_attributes][it][:id] = pt.id\n else\n params[:caso][:victima_attributes][iv][:persona_attributes][:persona_trelacion1_attributes][it][:id] = pt_e[0].id\n end\n end\n end\n end\n end\n end\n\n if params[:_msip_enviarautomatico] == \"1\"\n params_finales = caso_params.except(\n :caso_etiqueta_attributes,\n :caso_anexo_attributes,\n :caso_fuenteprensa_attributes,\n :caso_fotra_attributes,\n :caso_presponsable_attributes\n )\n else\n params_finales = caso_params\n end\n\n if @caso.update(params_finales)\n\n\n if registrar_en_bitacora\n Msip::Bitacora.agregar_actualizar(\n request, :caso, :bitacora_cambio, \n current_usuario.id, params, 'Sivel2Gen::Caso',\n @caso.id\n )\n end\n\n #if request.params[:enviarFichaCaso] == '1'\n # head :no_content\n # return\n #end\n\n notificacion = 'Caso actualizado.'\n if Sivel2Gen::Caso.count > MAX_CASOS_REFRESCA_AUTOMATICO\n notificacion += \" Por la cantidad de casos \"+\n \" debe Refrescar para notar \" +\n \" el cambio en el listado de casos\"\n end\n format.html {\n redirect_to @caso,\n notice: notificacion\n }\n format.json { head :no_content }\n format.js { head :no_content }\n else\n format.html {\n if session[:capturacaso_acordeon]\n render 'editv', layout: 'application'\n else\n render 'edit', layout: 'application'\n end\n }\n format.json { render json: @caso.errors,\n status: :unprocessable_entity }\n format.js { render json: @caso.errors,\n status: :unprocessable_entity }\n end\n end\n begin\n @conscasocount = Conscaso.count\n if @conscasocount <= MAX_CASOS_REFRESCA_AUTOMATICO\n puts Conscaso.refresca_conscaso\n end\n rescue\n puts Conscaso.refresca_conscaso\n @conscasocount = Conscaso.count\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update\n Listaprecio.transaction do\n @listaprecio = Listaprecio.find(params[:id])\n @listaprecio.lpre_ultmod = DateTime.now\n @listaprecio.lpre_usuario = session[:user].usur_nombre\n respond_to do |format|\n if @listaprecio.update_attributes(params[:listaprecio])\n flash[:notice] = 'La lista de precios ha sido actualizada.'\n format.html { redirect_to(:controller => 'listaprecios', :action => 'index', :maestrolistaid => @listaprecio.maestrolista_id, :marcacod => @listaprecio.articulo.marca.marc_codigo, :rubrocod => @listaprecio.articulo.rubro.rubr_codigo, :idmodificado => @listaprecio.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @listaprecio.errors, :status => :unprocessable_entity }\n end\n end\n actualizaprecio()\n end #transaction\n end",
"def pai_modificado\n \tif (self.changed.include? 'pai_id') & (self.pai == nil) \t\t\n \t\tself.errors.add(:pai, \"Não é possível tornar Matriz uma conta Filial\")\n \tend\n \tend",
"def update\n @gastos = Gasto.order(:codigo)\n @company = Company.find(1)\n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @documents = @company.get_documents()\n @employees = @company.get_employees()\n \n @cajas = Caja.all \n\n @destinos = Destino.all\n \n @egresos = Egreso.where([\"extension = ? or extension = ?\", \"TBK\",\"ALL\"]).order(:code)\n \n\n @viaticotbk_detail = ViaticotbkDetail.find(params[:id]) \n @viaticotbk_detail.viaticotbk_id = @viaticotbk.id \n @viaticotbk_detail.fecha = params[:viaticotbk_detail][:fecha]\n @viaticotbk_detail.employee_id = params[:ac_employee_id]\n\n \n respond_to do |format|\n if @viaticotbk_detail.update_attributes(employee_id: params[:viaticotbk_detail][:employee_id],fecha: params[:viaticotbk_detail][:fecha],importe: params[:viaticotbk_detail][:importe],\n gasto_id: params[:viaticotbk_detail][:gasto_id],destino_id: params[:viaticotbk_detail][:destino_id],tm:params[:viaticotbk_detail][:tm],numero: params[:viaticotbk_detail][:numero],detalle: params[:viaticotbk_detail][:detalle],document_id: params[:viaticotbk_detail][:tm],egreso_id: params[:viaticotbk_detail][:egreso_id])\n begin\n @viaticotbk[:inicial] = @viaticotbk.get_total_inicial\n rescue\n @viaticotbk[:inicial] = 0\n end \n \n begin\n @viaticotbk[:total_ing] = @viaticotbk.get_total_ing\n rescue \n @viaticotbk[:total_ing] = 0\n end \n begin \n @viaticotbk[:total_egreso]= @viaticotbk.get_total_sal\n rescue \n @viaticotbk[:total_egreso]= 0 \n end \n \n\n \n @viaticotbk[:saldo] = @viaticotbk[:inicial] + @viaticotbk[:total_ing] - @viaticotbk[:total_egreso]\n @viaticotbk.save\n \n if @viaticotbk.caja_id == 1 \n a = @cajas.find(1)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n if @viaticotbk.caja_id == 2\n a = @cajas.find(2)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n if @viaticotbk.caja_id == 3 \n a = @cajas.find(3)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n if @viaticotbk.caja_id == 4 \n a = @cajas.find(4)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n if @viaticotbk.caja_id == 5\n a = @cajas.find(5)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n\n if @viaticotbk.caja_id == 6\n a = @cajas.find(6)\n a.inicial = @viaticotbk[:saldo]\n a.save\n end \n\n \n format.html { redirect_to @viaticotbk, notice: 'viaticotbk detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @viaticotbk }\n else\n format.html { render :edit }\n format.json { render json: @viaticotbk.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reload_data\n self.class.new reinit_endpoint.do_get\n end",
"def imprimir_todo\n\n # aqui guardo todos los datos que necesito para imprimirlos en las variable\n\n @width_layout = '955'\n @form_title = ''\n @imprimo='1'\n \n #@ordenes_de_despacho_aux=OrdenDespachoDetalle.find(:all, :conditions=>\"id in #{params[:ordenes_despachos_id]}\")\n\n\n @factura_orden_despacho_otra= FacturaOrdenDespacho.find(:all, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n factura_orden_despacho_count=FacturaOrdenDespacho.count(:all, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n@factura_orden_despacho=FacturaOrdenDespacho.find(:first, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n\nsolicitu=OrdenDespacho.find(OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id).solicitud_id\n\n@solicitudes = Solicitud.find(:all,:conditions => ['id = ?', solicitu])\n\n unless @solicitudes[0].nil?\n if !@solicitudes[0].cliente.persona_id.nil?\n \n\t@es_no=1\n\t@datos_cliente=Persona.find(@solicitudes[0].cliente.persona_id) unless @solicitudes[0].nil?\n else\n\t@es_no=2\n\t@datos_cliente=Empresa.find(@solicitudes[0].cliente.empresa_id) unless @solicitudes[0].nil?\n end\n end\n@numero_desembolso=OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id\n\n@orden_despacho= OrdenDespacho.find(:all,:conditions => ['id = ?', @numero_desembolso])\n\n\n@oficina= Oficina.find(:all,:conditions => ['id = ?', @solicitudes[0].oficina_id]) unless @solicitudes[0].nil?\n\n\n@parametros_general=ParametroGeneral.find(:first)\n\n @condition = \" orden_despacho_id = #{@factura_orden_despacho.orden_despacho_detalle.orden_despacho_id} and cantidad > 0\"\n\n @total = OrdenDespachoDetalle.count(:conditions=>@condition)\n @list = OrdenDespachoDetalle.find(:all, :conditions => ['orden_despacho_id = ? and cantidad > 0', @factura_orden_despacho.orden_despacho_detalle.orden_despacho_id])\n\n\t@total_saldo_entregar=0\n\t@total_precio_total=0\n\tcont=0\n diferencia=0.00\n @total_monto_confirmado=0.00\n\twhile cont< @total\n #if OrdenDespacho.find(@numero_desembolso).estatus_id==20000 || OrdenDespacho.find(@numero_desembolso).estatus_id==20010 || OrdenDespacho.find(@numero_desembolso).estatus_id==20020\n\t \n # codigo nuevo al 3/9/2013 \n if ( ((@list[cont].cantidad * @list[cont].costo_real)!=@list[cont].monto_financiamiento) and (@list[cont].monto_recomendado!=0))\n \n @total_saldo_entregar+=@list[cont].monto_recomendado\n diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n \n else\n \n @total_saldo_entregar+=@list[cont].monto_financiamiento\n diferencia=@list[cont].monto_financiamiento - @list[cont].monto_facturacion\n end\n #codigo nuevo al 3/9/2013 \n \n \n #else\n\t #@total_saldo_entregar+=@list[cont].monto_recomendado\n #diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion\n #end\n\n @total_monto_confirmado+=@list[cont].monto_facturacion\n\n logger.debug \"monto financiamiento = \" << @list[cont].monto_financiamiento.to_s\n logger.debug \"monto facturacion = \" << @list[cont].monto_facturacion.to_s\n logger.debug \"diferencia = \" << diferencia.to_s\n if diferencia < 0\n diferencia=diferencia * -1 \n\n end\n \n\t@total_precio_total+=diferencia\n\n #@total_precio_total+=@list[cont].monto_facturacion\n\tcont+=1\t\n\tend\n\n\n@marca=params[:marca]\n\n#@vista = 'view_factura_orden_despacho_parciales'\n\n end",
"def update\n respond_to do |format|\n @clientes = Cliente.all\n @contactos = Contacto.where(\"cliente_id = ?\", Cliente.first.id)\n @horarios = Horario.where(\"cliente_id = ?\", Cliente.first.id)\n\n if @datosgenerale.update(datosgenerale_params)\n @datosgenerale.cliente_id = params[:datosgenerale][:cliente_id]\n\n @datosgenerale.contacto1_id = nil\n @datosgenerale.contacto2_id = nil\n @datosgenerale.contacto3_id = nil\n @datosgenerale.contacto4_id = nil\n @datosgenerale.contacto5_id = nil\n\n params[:datosgenerale][:contacto1_id].each_index { |i|\n case i\n when 1\n @datosgenerale.contacto1_id = params[:datosgenerale][:contacto1_id][i]\n when 2\n @datosgenerale.contacto2_id = params[:datosgenerale][:contacto1_id][i]\n when 3\n @datosgenerale.contacto3_id = params[:datosgenerale][:contacto1_id][i]\n when 4\n @datosgenerale.contacto4_id = params[:datosgenerale][:contacto1_id][i]\n when 5\n @datosgenerale.contacto5_id = params[:datosgenerale][:contacto1_id][i]\n else\n #do default case\n end\n\n }\n @datosgenerale.horario_id = params[:post][:horario_id]\n\n #@datosgenerale.alta = Date.parse(params[:datosgenerale][:alta], \"%m/%d/%Y\") #=> {:year=>2001, :mon=>2, :mday=>3}\n #@datosgenerale.alta = Date.strptime(params[:datosgenerale][:alta], '%m/%d/%Y')\n if(params[:datosgenerale][:tipocambio]=='1')\n @datosgenerale.tipocambio=true\n else\n @datosgenerale.tipocambio=false\n end\n @datosgenerale.save!\n format.html { redirect_to @datosgenerale, notice: 'Datosgenerale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', :layout => \"layout_2\" }\n format.json { render json: @datosgenerale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def preenche_parcelas_recorrencia\n return unless recorrencia\n \n if recorrencia.tipo == 'por'\n recorrencia.data_inicial = data\n recorrencia.parcelas = recorrencia.descobre_parcelas\n else\n recorrencia.parcelas = nil\n end\n end",
"def setorden\n @xml = params[:solicitud]\n @arreglo = Orden.validarRemota(@xml)\n if !(@arreglo.nil?)\n # @cliente = Persona.new(@xml[:cliente])\n # @cliente.save\n\n # @tarjeta = @xml[:tarjeta]\n # @tarjeta = TipoPago.new(@tarjeta)\n # @tarjeta.personas_id = @cliente.id\n # @tarjeta.save\n\n # @recoleccion = Direccion.new(@xml[:direccionrecoleccion])\n @entrega = Direccion.new(@xml[:direccionentrega])\n # @recoleccion.save\n @entrega.save\n\n @orden = Orden.new(@xml[:orden])\n @orden.estado = 'Pendiente por recolectar'\n @orden.personas_id= @arreglo[0]\n @orden.save\n\n @paquete = Paquete.new(@xml[:paquete])\n @paquete.ordens_id = @orden.id\n @paquete.personas_id = @arreglo[0]\n @paquete.save\n\n @historico1= Historico.new(:ordens_id => @orden.id, :direccions_id => @arreglo[2], :tipo => 'Recolectada')\n @historico= Historico.new(:ordens_id => @orden.id, :direccions_id => @entrega.id, :tipo => 'Entregada')\n @historico1.save\n @historico.save\n \n @monto = Enviar.montoTotal(@orden.id)\n @iva = (@monto * 0.12).round(2)\n @montototal = @monto + @iva\n Enviar.compania\n @factura = Factura.new(:companias_id => 1, :ordens_id =>@orden.id , :tipo_pagos_id => @arreglo[1] , :costoTotal => @monto ,:iva => @iva)\n @factura.save\n else\n render \"errorxml\"\n end\n end",
"def update\n \n @lancamentorapido = Lancamentorapido.find(params[:id]) \n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n\n respond_to do |format|\n if @lancamentorapido.update_attributes(params[:lancamentorapido])\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _save_refresh\n super\n recalculate_values_hashes\n end",
"def actualizarElementosContenido\n\n\n contenido_id = params[:contenido][:id]\n \n # Se borran elementos originales del contenido\n @elementos_asociados = Elemento.find(:all, :conditions => \"contenido_id = #{params[:contenido][:id]}\")\n \n for elemento in @elementos_asociados\n elemento.destroy\n end\n \n\n @elementos = params[:elemento]\n logger.debug(\"Esta es la cantidad de elementos para grabar nuevos: #{@elementos.size()}\" )\n if (!@elementos.nil? && @elementos.size() > 0 )\n \n # Guardando los nuevos elementos\n @elementos.each do |elemento|\n\n campos = elemento[1] # 1 corresponde al hash de campos / 0 es el id del elemento actual\n \n elemento_nuevo = Elemento.new()\n elemento_nuevo.id = campos[:id]\n elemento_nuevo.ubicacion = campos[:ubicacion] \n elemento_nuevo.contenido_id = contenido_id\n elemento_nuevo.valor = campos[:valor]\n elemento_nuevo.tipo_id = campos[:tipo_id]\n \n # Salvo\n elemento_nuevo.save!\n \n end\n end \n end",
"def update\n\t\t\n\t\tend",
"def update\n\t\traise CanCan::AccessDenied if !Postulacion.accessible_by(current_ability, :update).include?(@postulacion)\n respond_to do |format|\n if @postulacion.update(postulacion_params)\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Actualización de la Postulación al proyecto #{@postulacion.proyecto.nombre} del usuario #{@postulacion.usuario.nombreUsuario}: #{@postulacion.previous_changes}\" ,\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @postulacion.proyecto.id)\n format.html { redirect_to @postulacion\nflash[:success] = 'Postulacion fue actualizada satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @postulacion }\n else\n format.html { render :edit }\n format.json { render json: @postulacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def refresh\n # logger.debug(\"refreshing registration #{to_param}\")\n self.last_all_fetch = nil\n self.last_day_fetch = nil\n self.save!\n end",
"def update\n\n if not params[:treino][:atividade_ids].present?\n params[:treino][:atividade_ids] = []\n end\n\n #Recuperar os valores do array de array.\n #Tratamento para evitar o erro na atualizacao do treinos.Estava excluindo as atividades do treino Muscular.\n @result = Atividadetreino.joins('JOIN atividades on atividadetreinos.atividade_id = atividades.id').where('atividades.tipo' => 'A')\n @result.each do |res|\n params[:treino][:atividade_ids].push(res.atividade_id)\n end\n\n #********************************************\n #Gravando as ordens para os Treinos Aerobicos\n #********************************************\n setOrdensTreinos(:aerobico)\n\n #********************************************\n #Gravando as ordens para os Treinos Neurologicos\n #********************************************\n setOrdensTreinos(:neuro)\n\n respond_to do |format|\n if @treino.update(treino_params)\n format.html { redirect_to @treino, notice: 'Treino atualizado!' }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"def update\n @solicitudlabexa = Solicitudlabexa.find(params[:id])\n\n respond_to do |format|\n\n\n\n if params[:fecha]=~ /[0-3]?[0-9]\\-[0-1]?[0-9]\\-[0-9]{4}/\n nfecha=formato_europeo(params[:fecha])\n else\n nfecha=@solicitudlabexa.fecha\n end\n\n pref=\"\"\n @especiales=Laboratorio.where('especial=?',\"t\").to_a\n for especial in @especiales do\n nombre=especial.ssoo.to_s\n if params[:\"#{nombre}\"].to_s!='in'\n pref+=especial.nombre_lab.to_s+'-'+nombre+'-'+params[:\"#{nombre}\"]+\";\"\n end\n end\n @solicitudlabexa.preferencias=pref\n\n nombrecomp = params[:usuario][:identificador].to_s.split(', ')\n if @solicitudlabexa.update_attributes(:fecha => nfecha, \n :usuario_id => @usuario_actual.id,\n :fechasol => Date.today,\n :horaini => params[:horaini][:comienzo],\n :horafin => params[:horafin][:fin],\n\t\t\t\t\t :curso => params[:nivel].to_s,\n :asignatura_id => params[:asignatura][:id].to_i,\n\t\t\t\t\t :npuestos => params[:npuestos],\n :comentarios => Iconv.conv('ascii//translit//ignore', 'utf-8', params[:comentarios].to_s))\n\n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"\",\"Cambios en \").deliver_later \n @solicitudlabexas = Solicitudlabexa.where(\"usuario_id = ?\",@usuario_actual.id).to_a\n @cuenta=@solicitudlabexas.size\n format.html { redirect_to :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { redirect_to :action => \"edit\"}\n format.xml { render :xml => @solicitudlabexa.errors, :status => :unprocessable_entity }\n end\n \n end\n end",
"def clear\n\t\t@data.clear\n\t\t@modified = true\n\tend",
"def salvar\n @pagamento = Pagamento.find(params[:id])\n # valores recebidos por parâmetro\n @pagamento.id_transacao_moip = params[:idmoip]\n @pagamento.data_pag_moip = params[:datapag]\n @pagamento.data_pag_inss = params[:datapaginss]\n # seta os valores\n @pagamento.update_attributes(params[:pagamento])\n\n respond_to do |format|\n format.html { redirect_to action: :index }\n end\n end",
"def inicializar_cruces_pendientes\n cruces = buscar_cruces_pendientes\n self.update_attributes(:cruces_pendientes => cruces) unless self.cruces_pendientes == cruces\n end",
"def update\n invoice_params[:data_prevenda] = Date.today\n respond_to do |format|\n puts 'esse é o id da venda ' + @invoice.id.to_s + invoice_params[:data_prevenda].to_s\n if @invoice.update(invoice_params)\n #ataualiza a data de prevenda em cada item lançado para o relatorio de analise geral\n #Item.where(invoice_id: @invoice.id).update_all(data_prevenda: invoice_params[:data_prevenda])\n format.html { redirect_to @invoice, notice: 'atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @invoice }\n sweetalert_success('Dados atualizados com sucesso!', 'Sucesso!', useRejections: false)\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def repair!\n update!\n end",
"def update\r\n end"
] |
[
"0.65799016",
"0.64958555",
"0.63838905",
"0.6380589",
"0.61371464",
"0.6081781",
"0.60590255",
"0.6037497",
"0.60080886",
"0.6003277",
"0.5969032",
"0.59593785",
"0.5948906",
"0.58884275",
"0.5887544",
"0.5883347",
"0.5860009",
"0.58369833",
"0.58300173",
"0.5819903",
"0.5819433",
"0.58182794",
"0.58166814",
"0.58073825",
"0.5793313",
"0.5792884",
"0.5790968",
"0.5785414",
"0.5785414",
"0.57837397",
"0.57829803",
"0.5767511",
"0.57653314",
"0.57564133",
"0.57549644",
"0.5750922",
"0.57458115",
"0.57331514",
"0.57197726",
"0.5717498",
"0.5713433",
"0.57090276",
"0.57081896",
"0.5704805",
"0.5703216",
"0.56959724",
"0.5695231",
"0.56859815",
"0.5683091",
"0.5682855",
"0.5678688",
"0.5676911",
"0.5675049",
"0.56553626",
"0.56553626",
"0.56553626",
"0.56553626",
"0.56553626",
"0.56553626",
"0.56553626",
"0.56553626",
"0.5648911",
"0.56404746",
"0.5637922",
"0.5637922",
"0.5628962",
"0.56278366",
"0.5622438",
"0.5619099",
"0.56186956",
"0.561724",
"0.56162816",
"0.56094766",
"0.559608",
"0.5591632",
"0.55910885",
"0.5590049",
"0.5574603",
"0.5573296",
"0.55714613",
"0.5570687",
"0.5564674",
"0.55589163",
"0.55531555",
"0.5550555",
"0.5541795",
"0.5540183",
"0.5538491",
"0.55308145",
"0.55306685",
"0.5528583",
"0.55276674",
"0.5527664",
"0.5526395",
"0.55248827",
"0.5522934",
"0.55212647",
"0.55163157",
"0.55158883",
"0.55089635",
"0.5504209"
] |
0.0
|
-1
|
Aun no ha comenzado la entrada de datos
|
def not_yet_open?
opened_at > DateTime.now
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def control_sin_items_comprobantes\n if [detalles].any? {|detalle| detalle.any? }\n self.errors[:base] = \"error que queres hacer?\"\n return false\n end \n end",
"def datos_default\n if new_record?\n lastRecord = MovMovimiento.last\n if lastRecord\n self.hoja = lastRecord.hoja\n end\n\n num_abonos = ComPago.where(com_compra: com_compra).count + 1\n self.concepto = \"Abono #{num_abonos} a compra \\\"#{com_compra.title}\\\"\"\n end\n end",
"def revisa_deuda\n if com_compra.adeudos[:cuentas_con_deuda] == 0\n com_compra.pagado!\n else\n com_compra.pendiente!\n end\n end",
"def guarda_nombres_comunes_todos\n dame_nombres_comunes_todos\n\n if x_nombre_comun_principal.present?\n a = adicional ? adicional : Adicional.new(especie_id: id)\n a.nombres_comunes = x_nombres_comunes.encode('UTF-8', {invalid: :replace, undef: :replace, replace: ''})\n a.nombre_comun_principal = x_nombre_comun_principal.force_encoding(\"UTF-8\")\n\n if a.changed?\n a.save\n reload\n end\n end\n end",
"def dataVazia(data)\n\t\tif data.blank?\n\t\t\tthrow Exception.message = \"sem_eventos\"\n\t\tend\n\tend",
"def orden_combustible_exists\n\n if self.id_orden_combustible.blank?\n true\n else\n begin\n OrdenCombustible.find(self.id_orden_combustible)\n rescue ActiveRecord::RecordNotFound\n errors.add(:id_orden_combustible, \"No existe la orden especificada\")\n false\n end\n end\n\n end",
"def null_check(record,row)\n #se gli attributi obbligatori sono nulli\n if record.data.blank?\n #registro l'errore\n save_error(record,\"Violazione not null - Data\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n if record.cod_plot.blank?\n #registro l'errore\n save_error(record,\"Violazione not null - Plot\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n if record.subplot.blank?\n #registro l'errore\n save_error(record,\"Violazione not null - Subplot\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n if record.in_out.blank?\n #registro l'errore\n save_error(record,\"Violazione not null - In/Out\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n if record.priest.blank?\n #registro l'errore\n save_error(record,\"Violazione not null - Pri/Est\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n if record.cop_comp.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Complessiva\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n #FACOLTATIVI\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_arboreo\")\n if record.cop_arbo.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Arboreo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_arbustivo\")\n if record.cop_arbu.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Arbustivo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_erbaceo\")\n if record.cop_erb.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Erbaceo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_lettiera\")\n if record.cop_lett.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Lettiera\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_muscinale\")\n if record.cop_musc.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Muscinale\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"copertura_suolo_nudo\")\n if record.cop_suol.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Copertura Suolo Nudo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"altezza_arboreo\")\n if record.alt_arbo.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Altezza Arboreo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"altezza_arbustivo\")\n if record.alt_arbu.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Altezza Arbustivo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n if mandatory?(session[:mask_name],\"Copl\",\"altezza_erbaceo\")\n if record.alt_erb.nil?\n #registro l'errore\n save_error(record,\"Violazione not null - Altezza Erbaceo\",row)\n #segnalo che c'è stato un errore sulla riga\n session[:row_error] = true\n #e segnalo l'errore sul file\n session[:file_error] = true\n end\n end\n end",
"def empty?\n @data.rows_count <= 0\n end",
"def paciente_has_not_ficha\n if Consulta.get_ficha(area.nombre + ' Pediatría', paciente.id).nil?\n errors.add(:base, I18n.t('activerecord.errors.messages.paciente_has_not_ficha'))\n end\n end",
"def chegou_no_destino?(cegonha)\n\n if cegonha.cidade_destino == cegonha.cidade_id && cegonha.estado_destino == cegonha.estado_id\n cegonha.cars.each do |car|\n # protege contra codigo legado antes do historico\n if car.historicos.empty?\n car.historicos.create(:cegonha_id => car.cegonha.id)\n end\n #saiu da cegonha\n car.historicos.last.update_attributes(:data_saida => Time.now, :localizacao_saida => car.cegonha.localizacao)\n # verifica se o carro descarregado chegou no destino ou se vai embarcar em outra cegonha/parceiro (logistica)\n if car.cidade_destino == cegonha.cidade_destino and car.estado_destino == cegonha.estado_destino\n car.ativo = 2\n else\n car.ativo = 6\n end\n car.cegonha = nil\n car.save\n\n end\n ceg_id = cegonha.id\n cegonha = Cegonha.find(ceg_id)\n cegonha.rotas += 1\n cegonha.cidade_origem = nil\n cegonha.cidade_destino = nil\n cegonha.estado_origem = nil\n cegonha.estado_destino = nil\n cegonha.save\n return true\n else\n return false\n end\n end",
"def verifica_anulacion_del_cierre\n if Cierre.where(\"fechaproceso > ? and activo = ? and empresa_id = ? \", self.fechaproceso.to_date + 1.day, true, 1).exists?\n errors.add(:fechaproceso, \"Existen fechas posteriores que estan cerradas.\")\n end\n end",
"def inicio_sesion?\n usuario_id.blank?\n end",
"def analizarPago(idPago, idFactura)\n sist = Sistema.new\n pago = JSON.parse(sist.obtenerTransaccion(idPago))\n Rails.logger.debug(\"debug:: Se obtuvo el pago\")\n ## Vemos que el pago exista\n if pago[0] == nil\n return false \n end\n if pago[0][\"param\"] == \"id\"\n return false\n end\n Rails.logger.debug(\"debug:: Pago existe\")\n ## Vemos que la factura exista\n factura = JSON.parse(sist.obtenerFactura(idFactura))\n if factura[0] == nil\n return false \n end\n if factura[0][\"param\"] == \"id\"\n return false\n end \n Rails.logger.debug(\"debug:: Factura existe\")\n\n ## Obtenemos la orden de compra de la factura (asumimos que existe)\n idoc = factura[0][\"oc\"]\n oc = JSON.parse(sist.obtenerOrdenDeCompra(idoc))\n Rails.logger.debug(\"debug:: Orden de Compra obtenida\")\n\n ## Comprobamos que el monto sea el correcto\n if factura[0][\"total\"].to_i != pago[0][\"monto\"].to_i\n return false\n end\n Rails.logger.debug(\"debug:: Monto Correcto\")\n\n ## Comprobamos que seamos el destinatario del pago\n if pago[0][\"destino\"] != sist.idBanco\n return false\n end\n Rails.logger.debug(\"debug:: Destinatario Correcto\")\n\n ## Vemos que ese pago no estuviera ya ingresado\n oc = Oc.find_by(pago: idPago)\n if oc != nil\n return false\n end\n sist.facturaPagada(idFactura)\n Rails.logger.debug(\"debug:: El pago es nuevo, se marcó en el sistema como \")\n\n \n ## Actualizamos la oc\n ocBD = Oc.find_by(oc: idoc)\n \n ## La OC es de otro?\n if ocBD == nil\n return false\n end\n \n ocBD.update(estados: \"Pagada\")\n ocBD.update(pago: idPago)\n Rails.logger.debug(\"debug:: Datos actualizados\")\n \n invent = Inventario.new \n invent.definirVariables\n Thread.new do\n Rails.logger.debug(\"debug:: intentamos despachar\")\n ## Gatillamos el envio desde aqui si es posible?\n res = invent.verSiEnviar(idFactura)\n nOtroGrupo = Grupo.find_by(factura: idFactura)[\"nGrupo\"]\n #url = \"http://localhost:3000/api/despacho/recibir/\" + fact[\"_id\"]\n url = \"http://integra\" + nOtroGrupo.to_s + \".ing.puc.cl/api/despacho/recibir/\" + idFactura\n ans = sist.httpGetRequest(url ,nil)\n Rails.logger.debug(\"debug:: le avisamos al otro grupo\")\n\n\n end\n return true \n end",
"def cargarAula\n @aula = Aula.new(aula_params)\n cumple = true\n\n Aula.all.each do |aul|\n if(@aula.NombreAula == aul.NombreAula)\n flash[:notice] = 'Ya exite un aula con ese nombre'\n cumple = false\n end\n end\n if(cumple)\n if @aula.save\n flash[:notice] = 'El aula se creó exitosamente!'\n redirect_to listadoAulas_path\n else\n redirect_to listadoAulas_path\n end\n else\n redirect_to listadoAulas_path\n end\n end",
"def verificar_jugadas_contradictorias jugadalot\n #jugadalot es un object param\n # 4 tipos de jugadas: 0101, 0102, 0103, 0104\n jugadas = Jugadalot.where(:ticket_id => jugadalot.ticket_id) || [] # nil en caso de no encontrar jugadas de ese ticket_id, my remoto pero contemplarlo. \n respuesta = false\n\n comandos = []\n comando_actual = jugadalot.comandojugada # incluyo tambien la ultima jugada digitada en pantalla que aun no esta en la consulta del modelo. Esta jugada viene dentro del objeto recibido como param ok.\n\n jugadas.each do |jugada|\n comandos << jugada.comandojugada # capturar todos los comandos de las jugadas\n end\n #aplicar la logica de las jugadas contradictorias\n #la jugada contradictoria se verifica en cada entrada nueva, compara la que llega con las que estan?\n\n #si la jugada nueva es al cinta azul, verificar que no este esa misma pelea al cinta blanca y viceversa\n # comando_actual => \"0101\" por ejemplo\n if comando_actual[2..3] == \"01\" # pelea apostando al cinta azul\n jugada_opuesta = comando_actual[0..1].to_s + \"0\"+\"2\" #misma pelea pero al cinta blanca\n return comandos.include?(jugada_opuesta.to_s)\n end\n\n if comando_actual[2..3] == \"02\" # pelea apostando al cinta azul\n jugada_opuesta = comando_actual[0..1].to_s + \"0\"+\"1\" #misma pelea pero al cinta blanca\n return comandos.include?(jugada_opuesta.to_s)\n end\n\n if comando_actual[2..3] == \"03\" # pelea apostando al cinta azul\n jugada_opuesta = comando_actual[0..1].to_s + \"0\"+\"4\" #misma pelea pero al cinta blanca\n return comandos.include?(jugada_opuesta.to_s)\n end\n\n if comando_actual[2..3] == \"04\" # pelea apostando al cinta azul\n jugada_opuesta = comando_actual[0..1].to_s + \"0\"+\"3\" #misma pelea pero al cinta blanca\n return comandos.include?(jugada_opuesta.to_s)\n end\n \n end",
"def validar(orden_abono_excedente_arrime, fecha_registro_cheque, numero_cheque)\n logger.debug \"ENTRE A LA VALIDACION EN MI MODELOS ---- \" << orden_abono_excedente_arrime.inspect.to_s\n logger.debug \"ENTRE A LA VALIDACION EN MI MODELOS ---- \" << orden_abono_excedente_arrime_id.inspect.to_s\n \n logger.debug \"Parametros ---- \" << fecha_registro_cheque.to_s << \" - \" << numero_cheque.to_s\n \n msj = \"\"\n\n orden_abono_excedente_arrime = OrdenAbonoExcedenteArrime.find(orden_abono_excedente_arrime_id)\n solicitud = Solicitud.find(orden_abono_excedente_arrime.solicitud_id)\n\n logger.debug \"cheque ---- \" << numero_cheque.to_s\n logger.debug \"fecha ---- \" << fecha_registro_cheque.to_s\n if numero_cheque.to_s==''\n msj << I18n.t('Sistema.Body.Modelos.ViewExcedenteArrime.Errores.numero_cheque_obligatorio',:numero=>solicitud.numero) \n end\n\n if fecha_registro_cheque.to_s==''\n msj << I18n.t('Sistema.Body.Modelos.ViewExcedenteArrime.Errores.fecha_registro_invalida',:numero=>solicitud.numero)\n end\n\n if msj.length > 0\n return msj\n else\n return ''\n end\n end",
"def check_do_row\n err_arr = []\n begin\n if @row_hash[\"ao_ref_id\"].nil? && @row_hash[\"ao_uri\"].nil?\n err_arr.push I18n.t(\"bulk_import.error.no_uri_or_ref\")\n else\n result = archival_object_from_ref_or_uri(@row_hash[\"ao_ref_id\"], @row_hash[\"ao_uri\"])\n err_arr.push I18n.t(\"bulk_import.error.bad_ao\", :errs => result[:errs]) if result[:ao].nil?\n end\n obj_link = @row_hash[\"digital_object_link\"]\n thumb = @row_hash[\"thumbnail\"] || @row_hash[\"Thumbnail\"]\n err_arr.push I18n.t(\"bulk_import.error.dig_info_miss\") if @row_hash[\"digital_object_link\"].nil? && thumb.nil?\n end\n v = @row_hash[\"publish\"]\n @row_hash[\"publish\"] = (v == \"1\")\n err_arr.join(\"; \")\n end",
"def empty?\n @row >= @data.rows_count\n end",
"def empty_row?(data)\n data.compact.empty?\n end",
"def hasData\n sql = ActiveRecord::Base.connection();\n #dataCount, dummy = sql.execute(\"SELECT count(*), 0 FROM enclavecontrols WHERE enclavequarter_id = #{self.id}\").fetch_row\n dataCount = sql.select_value(\"SELECT count(*) FROM enclavecontrols WHERE enclavequarter_id = #{self.id}\")\n if dataCount.to_i > 0 then\n hasData = true\n else\n hasData = false\n end\n #hasData = dataCount\n hasData\n end",
"def empty?\n\t\t if @cabeza == nil\n\t\t return true\n\t\t else \n\t\t\treturn false\n\t\t end\n\t\t end",
"def set_estoquemp\n if !Estoquemp.where(cliente_id: current_user.cliente_id).exists?\n redirect_to root_path\n flash[:danger] = \"Voce não possui itens cadastrados no estoque ainda!\"\n else\n @estoquemp = Estoquemp.where(cliente_id: current_user.cliente_id).first\n end\n end",
"def create\n cour = Cour.find(params[:elefe][:ville_entrainement])\n u = current_user\n #info_ville = params[:elefe][:info_ville].join.to_i\n #params[:elefe][:info_ville] = info_ville\n # CAS DES FICHES EXISTANTES\n if @All_Eleves.exists?(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n @fiche_exist = @All_Eleves.find_by(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n # Fusion de l'élève avec une fiche existante créée à partir des présences (officialisation)\n if !@fiche_exist.date_naissance\n puts \"On update eleve existant\"\n @elefe = @fiche_exist\n cours = @elefe.cours\n if !cours.detect { |b| b.id == cour.id }\n @elefe.cours << cour\n end\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.update(elefe_params)\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @elefe }\n else\n format.html { render :edit }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n else\n # Ne peut pas écraser une fiche existante\n redirect_back(fallback_location: :back, alert: 'Il existe déjà un élève inscrit avec le même nom et prénom. Peut-être pourriez-vous entrer un deuxième prénom pour vous différencier ?')\n end\n # CAS CLASSIQUE DE L'INSCRIPTION\n else\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n @elefe = Elefe.new(elefe_params)\n @elefe.cours << cour\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.save\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été créée.' }\n format.json { render :show, status: :created, location: @elefe }\n else\n format.html { render :new }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def found?\n @found ||= !(self.result[\"Ares_odpovedi\"][\"Odpoved\"][\"Pocet_zaznamu\"] == '0' ||\n self.result[\"Ares_odpovedi\"][\"Odpoved\"][\"error\"])\n end",
"def set_registro\n if(Registro.where(id: params[:id] ).length>0)\n @registro = Registro.find(params[:id])\n\n else\n respond_to do |format|\n format.html { redirect_to personas_url, alert: '<i class=\"fa fa-exclamation-triangle fa-lg\"></i> El registro no se encuentra en la base de datos.' }\n end\n end\n end",
"def success?\n data_rows.exists? && !data_rows.failed.exists?\n end",
"def empty?\n @data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def crear_comite_nacional session\n \n transaction do\n \n begin\n \n #ciudad = Ciudad.find(:first, :conditions=>['ciudad.id=?',Oficina.find(session[:oficina]).ciudad_id.to_s],:include=>:estado)\n oficina_id=session[:oficina].to_s\n ########################################\n #1 Verificar si el comite esta cerrado.\n Comite.connection.execute(\"LOCK comite in ACCESS EXCLUSIVE MODE;\")\n ComiteDecisionHistorico.connection.execute(\"LOCK comite_decision_historico in ACCESS EXCLUSIVE MODE;\")\n comite=Comite.find(:first,:include=>['comite_decision_historico'],:conditions=>\" comite_decision_historico.tipo_comite='n' \",:order=>\"comite.id desc\")\n if !comite.nil?\n if comite.vigente==true\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.llenar_datos_instancia')\n else\n ##################################################################\n #2 Todos los tramites del ultimo comite deben tener una decision.\n total=ComiteDecisionHistorico.count(:conditions=>\"tipo_comite='n' and comite_id=#{comite.id} \")\n total_decision=ComiteDecisionHistorico.count(:conditions=>\"tipo_comite='n' and decision is not null and comite_id=#{comite.id} \")\n if total.to_i!=total_decision.to_i\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.datos_creados_deben_tener_decision')\n end\n end\n end\n \n condicion=\" estatus_id=10034 and comite_estadal_id is not null and ( comite_id IS NULL or decision_comite_nacional='D' ) \"\n \n solicitudes=Solicitud.find(:all,:conditions=>condicion)\n \n if !solicitudes.nil? && !solicitudes.empty?\n ParametroGeneral.connection.execute(\"LOCK parametro_general in ACCESS EXCLUSIVE MODE;\")\n parametro_general=ParametroGeneral.find(:first)\n semilla = parametro_general.numeracion_instancia_nacional.to_i + 1\n anio = ParametroGeneral.find(:first).anio_constitucion_comite_vigente\n numero = semilla.to_s+\"-\"+anio.to_s\n parametro_general.numeracion_instancia_nacional = semilla\n parametro_general.save!\n comite = Comite.new\n comite.attributes = {:numero=>numero,:instancia_tipo_id=> 5,:vigente=>true}\n comite.save!\n \n params = {\n :p_numero_comite=>numero,\n :p_comite_id=>comite.id,\n :p_tipo=>'N',\n :p_oficina_id=>0\n }\n \n ejecutar = execute_sp('apertura_comite', params.values_at(\n :p_numero_comite,\n :p_comite_id,\n :p_tipo,\n :p_oficina_id))\n \n logger.info \"Ejecutar =======> #{ejecutar.to_s}\"\n \n #solicitudes.each { |x| \n #x.numero_comite_nacional = numero\n #x.comite_id = comite.id\n #x.decision_comite_nacional = nil\n #x.comentario_comite_nacional = nil\n #x.save!\n #ComiteDecisionHistorico.create(\n #:solicitud_id=> x.id,\n #:comite_id => comite.id,\n #:tipo_comite => 'n',\n #:oficina_id => x.oficina_id\n #)\n #}\n return 1\n else\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.no_existen_tramites_para_nuevo_comite')\n end\n rescue=>detail\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.error_en_creacion') + detail.message.to_s\n \n end #------> Fin del Begin\n \n end #------> Fin transacion do\n \n end",
"def orden_repuesto_exists\n\n if self.id_orden_respuesto.blank?\n true\n else\n begin\n OrdenRepuesto.find(self.id_orden_respuesto)\n rescue ActiveRecord::RecordNotFound\n errors.add(:id_orden_respuesto, \"No existe la orden especificada\")\n false\n end\n end\n\n end",
"def check_cuotas\n return if @adquisicion.cuotas.none?\n flash[:alert] = \"No se puede eliminar porque tiene cuotas asociadas. Puede darle una fecha de finalización a esta adquisición. Si realmente quiere borrarla, elimine primero las cuotas asociadas.\"\n redirect_to @adquisicion\n end",
"def crear_en_bloque\r\n if current_user.nil?\r\n redirect_to(log_in_path) and return\r\n end\r\n\r\n ActiveRecord::Base.transaction do\r\n params[:alumno_id].each do |alumno|\r\n @asistencia_alumno_persona_vinculada = Asistencia.new(\r\n :anio_alumno_id => AnioAlumno.find_by_anio_escolar_id_and_alumno_id(anio_escolar.id, alumno).id,\r\n :fecha_hora => Time.now,\r\n :persona_vinculada_id => params[:persona_vinculada_id],\r\n :usuario => current_user.usuario,\r\n :tipo_movimiento => 2\r\n )\r\n\r\n if !@asistencia_alumno_persona_vinculada.save\r\n flash[:notice] = 'Ocurrio un error al registrar la salida'\r\n format.html { render action: \"consultar\" }\r\n else\r\n if @guardados.nil?\r\n @guardados = [@asistencia_alumno_persona_vinculada.id]\r\n else\r\n @guardados.push(@asistencia_alumno_persona_vinculada)\r\n end\r\n \r\n @notificar = AlumnoPersonaVinculada.notificar_salida(alumno)\r\n if !@notificar.empty?\r\n @notificar.each do |alumnopersona|\r\n if alumnopersona.persona_vinculada_id != params[:persona_vinculada_id]\r\n @persona = PersonaVinculada.find(alumnopersona.persona_vinculada_id)\r\n @alumno = Alumno.find(alumno)\r\n AsistenciaMailer.delay.notificar_asistencia(2, @alumno, @asistencia_alumno_persona_vinculada, @persona) ## Asincrono\r\n end\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n tipo = PersonaVinculada.find(params[:persona_vinculada_id]).tipo_documento\r\n numero = PersonaVinculada.find(params[:persona_vinculada_id]).numero_documento\r\n redirect_to :controller => 'alumnos_personas_vinculadas', :action => 'consultar',\r\n :tipo_documento => tipo, :numero_documento => numero\r\n end",
"def emprestimo_atual\n self.emprestimos.where('data_devolucao IS NULL').first\n end",
"def empty?\n @data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def validar_opciones_parciales(parametros,id_factura_despachos)\n \n variable='-1'\n logger.debug \"entre aqui en validar opciones individual\" << parametros.inspect << \" con factura de despacho = \" << id_factura_despachos.inspect\n @factura_orden_despacho_detalle_resultados=FacturaOrdenDespacho.find(:all,:conditions=>\"id in #{id_factura_despachos}\")\n\n otra_var=\"\"\n @factura_orden_despacho_detalle_resultados.each do |factura_orden_despacho_detalle_resultado|\n\n\n if parametros[:\"monto_cantidad_faltante_#{factura_orden_despacho_detalle_resultado.id}\"].to_f == 0 && parametros[:\"monto_cantidad_facturada_#{factura_orden_despacho_detalle_resultado.id}\"].to_f != 0\n variable = factura_orden_despacho_detalle_resultado.id.to_s << \";#{I18n.t('Sistema.Body.Modelos.OrdenDespachoDetalle.Mensajes.mensajes_cantidad_factura_no_cero',:item_nombre=>factura_orden_despacho_detalle_resultado.item_nombre)}\"\n break\n end\n\n if parametros[:\"monto_cantidad_facturada_#{factura_orden_despacho_detalle_resultado.id}\"].to_f == 0 && parametros[:\"monto_cantidad_faltante_#{factura_orden_despacho_detalle_resultado.id}\"].to_f != 0\n variable = factura_orden_despacho_detalle_resultado.id.to_s << \";#{I18n.t('Sistema.Body.Modelos.OrdenDespachoDetalle.Mensajes.mensajes_monto_factura_no_cero',:item_nombre=>factura_orden_despacho_detalle_resultado.item_nombre)}\"\n break\n end\n\n if parametros[:\"monto_cantidad_facturada_#{factura_orden_despacho_detalle_resultado.id}\"].to_f != 0 && parametros[:\"monto_cantidad_faltante_#{factura_orden_despacho_detalle_resultado.id}\"].to_f != 0\n otra_var=\"1\"\n end\n \n end \n if variable==\"-1\" && otra_var==\"\"\n variable = \"Algo\" << \";#{I18n.t('Sistema.Body.Modelos.OrdenDespachoDetalle.Mensajes.mensaje_final')}\"\n end\n return variable\nend",
"def only_one_open_caja\n\t\terrors.add(:base, 'Ya hay una caja abierta') if Collect.is_any_open_caja\n\tend",
"def empty?\n @rows.empty?\n end",
"def empty?\n @row.empty?\n end",
"def create\r\n if current_user.nil?\r\n redirect_to(log_in_path) and return\r\n end\r\n \r\n codigo = params[:codigo_alumno].to_i\r\n personavinculada = params[:asistencia][:persona_vinculada_id].to_i\r\n if codigo == 0\r\n flash[:notice] = 'Ingrese el codigo del alumno'\r\n render :new\r\n else\r\n if !AnioAlumno.find_by_anio_escolar_id_and_alumno_id(anio_escolar.id, codigo)\r\n flash[:notice] = \"El codigo #{codigo} no existe\"\r\n redirect_to(:new_asistencia) and return\r\n end\r\n \r\n @asistencias = Asistencia.por_alumno_fecha(anio_escolar.id, codigo, Date.current)\r\n \r\n ingreso = 0\r\n fecha_hora = Time.now\r\n salida = 0\r\n @asistencias.each do |asistencia|\r\n if asistencia.tipo_movimiento == 1\r\n ingreso = 1\r\n fecha_hora = asistencia.fecha_hora\r\n end\r\n if asistencia.tipo_movimiento == 2\r\n salida = 1\r\n end\r\n end\r\n movimiento = 0\r\n if ingreso == 0 && salida == 0\r\n movimiento = 1\r\n end\r\n if ingreso == 1 && salida == 0\r\n if (Time.now- fecha_hora) > 60\r\n movimiento = 2\r\n end\r\n end\r\n \r\n if movimiento == 2\r\n if Alumno.find(codigo).salida_con_persona == 1\r\n cargarpersonasvinculadas = 0\r\n if personavinculada == 0\r\n if @personasvinculadas.nil?\r\n cargarpersonasvinculadas = 1\r\n else\r\n cargarpersonasvinculadas = 1\r\n end\r\n else\r\n if AlumnoPersonaVinculada.find_by_alumno_id_and_persona_vinculada_id(codigo, personavinculada).nil?\r\n cargarpersonasvinculadas = 1\r\n end\r\n end\r\n if cargarpersonasvinculadas == 1\r\n @personasvinculadas = PersonaVinculada.vinculadas_a(codigo)\r\n flash[:notice] = 'Seleccione la persona que recoge al alumno'\r\n @nuevo = 0\r\n render :new\r\n return\r\n end\r\n end\r\n end\r\n \r\n if movimiento == 0\r\n if salida == 0\r\n flash[:notice] = 'Ha intentado registrar dos veces el ingreso'\r\n else\r\n flash[:notice] = 'Ha intentado registrar dos veces la salida'\r\n end\r\n render :new\r\n @nuevo = 1\r\n else\r\n if personavinculada == 0\r\n personavinculada = nil\r\n end\r\n @asistencia = Asistencia.new(\r\n :anio_alumno_id => AnioAlumno.find_by_anio_escolar_id_and_alumno_id(anio_escolar.id, codigo).id,\r\n :fecha_hora => Time.now,\r\n :usuario => current_user.usuario,\r\n :persona_vinculada_id => personavinculada,\r\n :tipo_movimiento => movimiento\r\n )\r\n if !@asistencia.save\r\n flash[:notice] = 'Ocurrio un error al registrar la asistencia'\r\n format.html { render action: \"new\" }\r\n else\r\n if @guardados.nil?\r\n @guardados = [@asistencia.id]\r\n else\r\n @guardados.push(@asistencia)\r\n end\r\n \r\n if movimiento == 1\r\n @notificar = AlumnoPersonaVinculada.notificar_ingreso(codigo)\r\n else\r\n @notificar = AlumnoPersonaVinculada.notificar_salida(codigo)\r\n end\r\n if !@notificar.empty?\r\n @notificar.each do |alumnopersona|\r\n @persona = PersonaVinculada.find(alumnopersona.persona_vinculada_id)\r\n @alumno = Alumno.find(codigo)\r\n AsistenciaMailer.delay.notificar_asistencia(movimiento, @alumno, @asistencia, @persona) ## Asincrono\r\n end\r\n end\r\n end\r\n redirect_to :controller => 'asistencias', :action => 'new' , :codigo_alumno => codigo\r\n end\r\n end\r\n end",
"def empty?\n data.empty?\n end",
"def empty?\n data.empty?\n end",
"def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"def exist?(cccc)\n not find_data_by_cccc(cccc).nil?\n end",
"def hay_obra?\n @obra.try :persisted?\n end",
"def orden_mantenimiento_exists\n\n if self.id_orden_mantenimiento.blank?\n true\n else\n begin\n OrdenMantenimiento.find(self.id_orden_mantenimiento)\n rescue ActiveRecord::RecordNotFound\n errors.add(:id_orden_mantenimiento, \"No existe la orden especificada\")\n false\n end\n end\n\n end",
"def create\n @calificacion = Calificacion.new(params[:calificacion])\n if @calificacion.alumno && @calificacion.materia && @calificacion.etapa\n calificacion_buscar = Calificacion.where(\"alumno_id = ? AND materia_id = ? AND etapa = ?\", @calificacion.alumno.id, @calificacion.materia.id, @calificacion.etapa)\n else\n calificacion_buscar = []\n end\n unless calificacion_buscar.first\n respond_to do |format|\n if @calificacion.save\n format.html { redirect_to @calificacion, notice: 'La calificacion ha sido registrado con exito.' }\n CustomLogger.info(\"Se ha registrado una nueva calificacion: #{@calificacion.calificacion.inspect} ,Materia: #{@calificacion.materia_materia.inspect} ,Puntos Correctos: #{@calificacion.puntos_correctos.inspect} ,Total de Puntos: #{@calificacion.total_puntos.inspect} ,Etapa: #{@calificacion.etapa.inspect} creados por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @calificacion, status: :created, location: @calificacion }\n else\n year = Date.today.year\n @anos = [year, year-1, year-2]\n @cursos = Curso.by_year(year)\n @alumnos = @cursos.first.alumnos\n @materias = @cursos.first.materias\n format.html { render action: \"new\" }\n CustomLogger.error(\"Error al querer registrar una nueva calificacion: #{@calificacion.calificacion.inspect} y sus demas atributos, por el usuario: #{current_user.full_name.inspect}, #{Time.now} \")\n format.json { render json: @calificacion.errors, status: :unprocessable_entity }\n end\n end\n else\n @calificacion = calificacion_buscar.first\n calificacion_antigua = @calificacion.calificacion\n materia_antigua = @calificacion.materia_materia\n puntos_correctos_antiguo = @calificacion.puntos_correctos\n total_puntos_antiguo = @calificacion.total_puntos\n etapa_antigua = @calificacion.etapa\n respond_to do |format|\n if @calificacion.update_attributes(params[:calificacion])\n calificacion_nueva = @calificacion.calificacion\n materia_nueva = @calificacion.materia_materia\n puntos_correctos_nueva = @calificacion.puntos_correctos\n total_puntos_nueva = @calificacion.total_puntos\n etapa_nueva = @calificacion.etapa\n CustomLogger.info(\"Los datos antes de ser actualizados son: calificacion: #{calificacion_antigua.inspect} ,Materia: #{materia_antigua.inspect} ,Puntos Correctos: #{puntos_correctos_antiguo.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Etapa: #{etapa_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: calificacion: #{calificacion_nueva.inspect} ,Materia: #{materia_nueva.inspect} ,Puntos Correctos: #{puntos_correctos_nueva.inspect} ,Total de Puntos: #{total_puntos_nueva.inspect} ,Etapa: #{etapa_nueva.inspect}, #{Time.now} \")\n format.html { redirect_to @calificacion, notice: 'La calificacion ya existia entonces fue actualizada. ' }\n format.json { head :no_content }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calificacion.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def verificaciones_valid\n return false unless self.verificaciones?\n self.verificaciones.collect { |i|\n i if i['cancelado'] == 'NO'\n }.compact\n end",
"def empty?\n data.nil? ? true : data.rows.empty?\n end",
"def valida_datos_aval?(attributes)\n\t\tif Aval.joins(:clients).where('avals.nombre = ? AND avals.apellidos = ? AND clients.ruta = ?',attributes['nombre'],attributes['apellidos'],self.ruta).exists?\n\t\t\terrors.add(:ruta, \"El Aval ya ha sido asignado a esta ruta\")\n\t\tend\n\tend",
"def modelo_register(name,password)\n count=0\n CSV.foreach($clientes,headers:true) do |row|\n if row['name']==name then count += 1 end\n end\n if count == 0\n CSV.open($clientes, \"a+\") do |csv|\n csv << [name,password,0]\n end \n end\n count == 0\nend",
"def resta_demas\n if emp_cuentab.saldo_actual < total and tipo_movimiento == 'egreso'\n errors.add(:emp_cuentab, 'Saldo insuficiente')\n end\n end",
"def empty?\n @rows.empty?\n end",
"def empty?\n @rows.empty?\n end",
"def empty?\n @rows.empty?\n end",
"def despachoRecibir\n idFactura = params[:id]\n ocClass = Oc.new\n \n ocBD = Oc.findBy(factura: idFactura)\n \n if ocBD == nil\n render :json => {:validado => false} \n return\n end\n \n ## Gatilla el recibir los productos\n ####################################\n \n if ans > ocBD.cantidad\n render :json => {:validado => true} \n return\n end\n render :json => {:validado => false} \n end",
"def donnerErreur()\n return @grilleEnCours.firstDifference(@grilleBase)\n end",
"def setear_fijos_arbol\n # @incisos = Inciso.all\n # @partidas_principales = PartidaPrincipal.all\n # @partidas_parciales = PartidaParcial.all \n @clases = Clase.where(\"fecha_de_baja IS NULL\")\n @bienes_de_consumo = BienDeConsumo.where(\"fecha_de_baja IS NULL\")\n end",
"def compra_correcta\n if File.exist?(\"prueba#{current_user.id}.json\")\n file = File.read(\"prueba#{current_user.id}.json\")\n datosCompra = JSON.parse(file)\n datosCompra.each { |index,item|\n user_id = current_user.id\n item_id = item['id']\n item_nombre = item['nombre']\n item_precio = item['precio']\n item_cantidad = item['cantidad']\n @item = Item.find_by_id(item_id)\n \n @item.save\n if @item['cantidad']-1 == 0\n @item.update_attribute('cantidad', 0)\n else\n @item.update_attribute('cantidad', @item['cantidad']-1)\n end\n #raise @item['cantidad'].to_yaml\n #raise @item['cantidad'].to_yaml\n @buys = Buy.new(\n :user_id => user_id, \n :item_id => item_id.to_i, \n :item_nombre => item_nombre, \n :item_precio => item_precio, \n :item_cantidad => @item['cantidad']\n )\n @buys.save\n }\n File.delete(\"prueba#{current_user.id}.json\")\n flash[:notice] = \"Compra realizada con exito.\"\n else\n flash[:notice] = \"No existen datos de compra.\"\n end\n end",
"def checar_logistica_carros(cegonha_id)\n cegonha = Cegonha.find(cegonha_id)\n cars = cegonha.cars.select {|car| car.cidade_destino == cegonha.cidade_id and car.estado_destino == cegonha.estado_id }\n if cars.empty? or cars.nil?\n return false\n else\n return true\n end\n\n end",
"def actualiza_atributos_con(hash, estado)\n # Validación de atributos de plaza, estado y rol.\n if hash[:rol_id].blank?\n self.errors.add(:rol, \"Rol no puede ir vacío\")\n elsif Rol.find(hash[:rol_id]).nombre.eql?(\"Encargado\")\n if hash[:plaza_id].blank?\n self.errors.add(:plaza, \"Plaza no puede ir vacía\")\n end\n if estado.blank?\n self.errors.add(:estado, \"Estado no puede ir vacío\")\n end\n end\n \n return false unless self.errors.empty?\n self.update_attributes(hash.merge({:password => \"cablecom_#{hash[:login]}\", :password_confirmation => \"cablecom_#{hash[:login]}\"}))\n end",
"def empty?\n rows.empty?\n end",
"def empty?\n a = @data_object\n\n (a.add_line1.nil? || a.add_line1.empty?) &&\n (a.add_line2.nil? || a.add_line2.empty?) &&\n (a.add_city.nil? || a.add_city.empty?) &&\n (a.add_county.nil? || a.add_county.empty?) &&\n (a.add_state.nil? || a.add_state.empty?) &&\n (a.add_zip.nil? || a.add_zip.empty?) &&\n (a.add_country.nil? || a.add_country.empty?)\n end",
"def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.rol_list = params[:rols_buffer].split(\",\").map { |s| s.to_i }\n dummy = @usuario.rol_list.pop #El ultimo elemento siempre es cero por un defecto...\n\n error_flag = 0\n begin\n @usuario.save!\n rescue\n error_flag = 1\n @usuario.errors.add_to_base \"Error guardando el registro!!!\"\n @rols_disp = Rol.find(:all, :conditions => \"id NOT IN (#{@usuario.rol_list.join(\",\")})\")\n @rols_selec = Rol.find(@usuario.rol_list)\n end\n\n respond_to do |format|\n if error_flag == 0\n flash[:notice] = nil\n format.html { redirect_to(usuarios_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def imprimir_todo\n\n # aqui guardo todos los datos que necesito para imprimirlos en las variable\n\n @width_layout = '955'\n @form_title = ''\n @imprimo='1'\n \n #@ordenes_de_despacho_aux=OrdenDespachoDetalle.find(:all, :conditions=>\"id in #{params[:ordenes_despachos_id]}\")\n\n\n @factura_orden_despacho_otra= FacturaOrdenDespacho.find(:all, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n factura_orden_despacho_count=FacturaOrdenDespacho.count(:all, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n@factura_orden_despacho=FacturaOrdenDespacho.find(:first, :conditions=>\"orden_despacho_detalle_id in #{params[:parciales_id]} and secuencia='#{params[:secuencia]}' and monto_factura>0\")\n\n\nsolicitu=OrdenDespacho.find(OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id).solicitud_id\n\n@solicitudes = Solicitud.find(:all,:conditions => ['id = ?', solicitu])\n\n unless @solicitudes[0].nil?\n if !@solicitudes[0].cliente.persona_id.nil?\n \n\t@es_no=1\n\t@datos_cliente=Persona.find(@solicitudes[0].cliente.persona_id) unless @solicitudes[0].nil?\n else\n\t@es_no=2\n\t@datos_cliente=Empresa.find(@solicitudes[0].cliente.empresa_id) unless @solicitudes[0].nil?\n end\n end\n@numero_desembolso=OrdenDespachoDetalle.find(@factura_orden_despacho.orden_despacho_detalle_id).orden_despacho_id\n\n@orden_despacho= OrdenDespacho.find(:all,:conditions => ['id = ?', @numero_desembolso])\n\n\n@oficina= Oficina.find(:all,:conditions => ['id = ?', @solicitudes[0].oficina_id]) unless @solicitudes[0].nil?\n\n\n@parametros_general=ParametroGeneral.find(:first)\n\n @condition = \" orden_despacho_id = #{@factura_orden_despacho.orden_despacho_detalle.orden_despacho_id} and cantidad > 0\"\n\n @total = OrdenDespachoDetalle.count(:conditions=>@condition)\n @list = OrdenDespachoDetalle.find(:all, :conditions => ['orden_despacho_id = ? and cantidad > 0', @factura_orden_despacho.orden_despacho_detalle.orden_despacho_id])\n\n\t@total_saldo_entregar=0\n\t@total_precio_total=0\n\tcont=0\n diferencia=0.00\n @total_monto_confirmado=0.00\n\twhile cont< @total\n #if OrdenDespacho.find(@numero_desembolso).estatus_id==20000 || OrdenDespacho.find(@numero_desembolso).estatus_id==20010 || OrdenDespacho.find(@numero_desembolso).estatus_id==20020\n\t \n # codigo nuevo al 3/9/2013 \n if ( ((@list[cont].cantidad * @list[cont].costo_real)!=@list[cont].monto_financiamiento) and (@list[cont].monto_recomendado!=0))\n \n @total_saldo_entregar+=@list[cont].monto_recomendado\n diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion \n \n else\n \n @total_saldo_entregar+=@list[cont].monto_financiamiento\n diferencia=@list[cont].monto_financiamiento - @list[cont].monto_facturacion\n end\n #codigo nuevo al 3/9/2013 \n \n \n #else\n\t #@total_saldo_entregar+=@list[cont].monto_recomendado\n #diferencia=@list[cont].monto_recomendado - @list[cont].monto_facturacion\n #end\n\n @total_monto_confirmado+=@list[cont].monto_facturacion\n\n logger.debug \"monto financiamiento = \" << @list[cont].monto_financiamiento.to_s\n logger.debug \"monto facturacion = \" << @list[cont].monto_facturacion.to_s\n logger.debug \"diferencia = \" << diferencia.to_s\n if diferencia < 0\n diferencia=diferencia * -1 \n\n end\n \n\t@total_precio_total+=diferencia\n\n #@total_precio_total+=@list[cont].monto_facturacion\n\tcont+=1\t\n\tend\n\n\n@marca=params[:marca]\n\n#@vista = 'view_factura_orden_despacho_parciales'\n\n end",
"def display_no_data\n if Movie.find_all.count == 0 and Episode.find_all.count == 0\n log(\"no new media found\")\n end\nend",
"def cargar_caravana_evento(caravana,collar,ev_parto,ev_serv) \n vaca = Vaca.where(\"nodo_id = ?\",collar).first \n vaca.caravana = caravana\n\n cargar_evento(vaca,ev_parto,\"parto\")\n \n cargar_evento(vaca,ev_serv,\"inseminada\")\n\n if !ev_serv.nil? && ev_serv.length>6\n serv = DateTime::strptime(ev_serv,\"%d%m%Y\") \n vaca.celos.create!(comienzo: serv,probabilidad: \"alta\",caravana:caravana, causa: \"aumento de actividad\")\n end\n\n vaca.save \n end",
"def edit_missing\n @punch.arrival and @punch.departure and raise \"Nulla da inserire\"\n end",
"def debit_factype_null_perdu\n test = init_test('Debit (Facture) avec factype NULL mais sans labour ni pulve associes', LOW)\n Debit.find(:all).each do |facture| \n if facture.factype_id.equal?(Factype.find_by_name('null').id) && facture.pulves.empty? && facture.labours.empty?\n test.num += 1\n error = init_error(facture.name, facture.id, 'factures', '')\n test.errors << error\n end\n end\n test.result = (test.num == 0) \n return test\n end",
"def exist?(cccc)\n !find_data_by_cccc(cccc).nil?\n end",
"def empty?\n @data.columns_count <= 0\n end",
"def index \n if params[:datai].present? && params[:dataf].present?\n verifica_dados(params[:pessoa], params[:esq], params[:mov], params[:sel], params[:busca], \n params[:datai], params[:dataf], params[:horai], params[:horaf], params[:cracha])\n else\n @postgresql_view_people = Hash.new\n flash[:alert] = 'Os campos data inicial e data final não podem ficar em brancos.' \n end \n end",
"def exists?\n !data.empty?\n end",
"def create\n Cabcompra.transaction do\n @cabcompra = Cabcompra.new(params[:cabcompra])\n @comprobante = Tipocomprobante.find(@cabcompra.tipocomprobante_id)\n if ((@comprobante.tcom_discriminaiva.to_s == 'No') || ((params[:rencompras][:rcom_netorenglon].nil?) || (params[:rencompras][:rcom_netorenglon][0].to_i > 0)))\n idplanilla = Cabcompra.maximum(:id, :conditions => [\"sucursal_id = ?\", session[:sucursal]]) \n @cabcompra.id = [idplanilla.to_i + 1, session[:sucursal]]\n # busco y grabo proveedor_id \n str_tokens = \"\"\n str_tokens = params[:proveedor][:prov_cuit].split(\"|\") if params[:proveedor]\n \n @proveedor = Proveedor.find(:first, :conditions => [\"sucursal_id = ? and prov_codigo = ? \", session[:sucursal], str_tokens[2].lstrip] ) if str_tokens[2] \n @cabcompra.proveedor_id = @proveedor.id[0] if str_tokens[2] \n $proveedor = @proveedor.id[0] if str_tokens[2] #para la validacion de proveedores 1 y 2\n @proveedor.prov_cuit = params[:proveedor][:prov_cuit].to_s if str_tokens[2] # por si vuelve con error\n @cabcompra.ccom_ultmod = DateTime.now\n @cabcompra.ccom_usuario = session[:user].usur_nombre\n @cabcompra.ccom_hastacompro = (params[:cabcompra][:ccom_hastacompro].nil? || params[:cabcompra][:ccom_hastacompro].to_i == 0) ? params[:cabcompra][:ccom_desdecompro] : params[:cabcompra][:ccom_hastacompro]\n str_tokens = @cabcompra.id.to_s.split(\",\") \n $plaegid = params[:cabcompra][:cabplaegreso_id]\n $sucursal = session[:sucursal]\n #graba compra o gasto segun el comprobante tenga o no iva\n if (params[:cabcompra][:ccom_iva].nil? || params[:cabcompra][:ccom_iva].to_d == 0 )\n @cabcompra.ccom_gastocompra = 'GASTO'\n else\n @cabcompra.ccom_gastocompra = 'COMPRA'\n end\n @cabcompra.ccom_gastocompra = 'COMPRA' if @comprobante.tcom_cabecera.to_s == 'S' #para los comprobantes de retenciones\n respond_to do |format|\n if @cabcompra.save\n if ((@comprobante.tcom_discriminaiva.to_s == 'Si') && (params[:rencompras][:rcom_netorenglon][0].to_d > 0) && @comprobante.tcom_cabecera.to_s == 'N') \n grabarenglonescompra()\n end\n \n flash[:notice] = 'El comprobante ha sido creado.'\n if @cabcompra.cabplaegreso_id > 0\n format.html { redirect_to(:controller => 'cabcompras', :action => 'index', :nrope => @cabcompra.ccom_nroplaegreso, :idpe => @cabcompra.cabplaegreso_id) }\n else\n format.html { redirect_to(:controller => 'cabcompras', :action => 'comprobantes', :id => 0) }\n end\n format.xml { render :xml => @cabcompra, :status => :created, :location => @cabcompra }\n else\n params[:idpe] = params[:cabcompra][:cabplaegreso_id]\n params[:nrope] = params[:cabcompra][:ccom_nroplaegreso]\n \n @alicuotaivas = Alicuotaiva.find(:all) \n @rencompra = Rencompra.new\n @jurisdiccions = Jurisdiccion.find(:all, :order =>\"juri_nombre\")\n @cabplaegreso = Cabplaegreso.find([params[:idpe], session[:sucursal]])\n @conceptoegresos = Conceptoegreso.find(:all, :order =>\"cegr_detalle\")\n @tipocomprobantes = Tipocomprobante.find(:all, :order =>\"tcom_nombre\")\n @iva = Tipocomprobante.find(@cabcompra.tipocomprobante_id) \n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @cabcompra.errors, :status => :unprocessable_entity }\n end\n end\n else\n render :text => \"<h7> El comprobante no se guardo porque no cargo ningun detalle (renglón) </h7>\", :layout => 'application' \n end\n end\n end",
"def create\n @numero = params[:numero]\n @cvv = params[:cvv]\n @fecha_vencimiento = params[:fecha_vencimiento]\n @viaje_id=params[:viaje_id]\n\n @compra_exitosa = false\n\n if !(@numero.nil? || @cvv.nil? || @fecha_vencimiento.nil?)\n\n if @numero.length == 12\n\n if @cvv.length== 3\n\n if DateTime.parse(@fecha_vencimiento) > Date.today\n\n\n arr=params[:adicionales]\n viaje=Viaje.find_by_id(params[:viaje_id])\n\n #POR AHORA HAGO QUE SE RESERVE AUTOMATICAMENTE\n pasaje= Pasaje.new\n if(arr != nil)\n arr.each do |a|\n pasaje.adicionales=pasaje.adicionales.append(Adicional.find_by_id(a))\n end\n end\n pasaje.viaje_id=params[:viaje_id]\n pasaje.user_id=current_user.id\n if (viaje.asientos_restantes !=nil and viaje.asientos_restantes>0)\n viaje.asientos_restantes=viaje.asientos_restantes-1\n viaje.save\n elsif viaje.asientos_restantes<=0\n flash[:danger] = \"Viaje con asientos ocupados\"\n end\n\n pasaje.save\n @compra_exitosa=true\n\n\n else\n flash[:alert]=\"Debe ingresar una fecha posterior a hoy\"\n end\n else\n flash[:alert]=\"Debe ingresar un código de tarjeta válido de tres dígitos\"\n end\n else\n flash[:alert]=\"Debe ingresar una tarjeta válida de doce dígitos\"\n end\n else\n flash[:notice]=\"Debe ingresar una tarjeta válida\"\n end\n\n end",
"def check_required_field_exists(csv_data, column_name)\n data = csv_data.select{|item| !item[column_name].nil? }\n if data.length < csv_data.length\n puts \"🔴 Some rows contain empty #{column_name}\"\n return true\n else \n return false\n end\n end",
"def cumple_condicion_jaque?\n @tablero.values.any? do |columna_hash|\n columna_hash.values.compact.any? do |pieza|\n pieza.color != @color and pieza._puede_capturar?(@columna, @fila)\n end\n end\n end",
"def completa_info(root_usuario_id=nil)\n if usuario_id.present?\n self.es_propietario = root_usuario_id == self.usuario_id ? true : false\n\n begin # Por si viene del scope datos_basicos y encontro el usuario\n self.nombre = u_nombre\n self.correo = u_email\n self.institucion = u_institucion\n rescue\n u = usuario\n self.nombre = \"#{u.nombre} #{u.apellido}\".strip\n self.correo = u.email\n self.institucion = u.institucion\n end\n\n else # Por si no esta el usuario_id\n begin # Trato de ver si venia de un scope\n self.nombre = c_nombre\n self.institucion = c_institucion\n self.es_propietario = true\n rescue\n self.es_propietario = true\n end\n end\n end",
"def nuevo\n if params[:fechaacred].blank?\n else\n params[:fechaacred] = Date.civil params[:fechaacred][\"year\"].to_i, params[:fechaacred][\"month\"].to_i, params[:fechaacred][\"day\"].to_i\n end\n if params[:dcau_nroboletadeposito].blank?\n params[:dcau_nroboletadeposito] = '000'\n end\n if params[:chequetercero_ids].blank?\n else\n \t params[:chequetercero_ids].each { |item_id|\n @depositocaucion = Depositocaucion.new\n @depositocaucion.dcau_fechadeposito = params[:fechaacred].to_s.to_date\n @depositocaucion.conceptocaucion_id = params[:conceptocaucion].to_s\n @depositocaucion.dcau_nroboletadeposito = params[:dcau_nroboletadeposito].to_s\n @depositocaucion.chequetercero_id = item_id.to_i\n @depositocaucion.sucursal_id = 11\n @depositocaucion.dcau_ultmod = DateTime.now\n @depositocaucion.dcau_usuario = session[:user].usur_nombre\n @depositocaucion.save!\n \t\n if params[:conceptocaucion].to_s == \"2\" \n @cheterc = Chequetercero.find_by_id_and_sucursal_id(item_id, '11')\n @estadocheq = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n #grabar devueltocaucions\n @devueltocaucion = Devueltocaucion.new\n @devueltocaucion.chequetercero_id = item_id\n @devueltocaucion.sucursal_id = 11\n @devueltocaucion.devc_tipo = \"R\"\n @devueltocaucion.devc_fecha = params[:fechaacred].to_s.to_date\n @devueltocaucion.devc_detalle = 'Devolucion(REINGRESO A CARTERA) Ch/Nº '+@cheterc.cter_nrocheque.to_s+' listado('+@cheterc.listadocaucion_id.to_s+')'\n @devueltocaucion.devc_importe = @cheterc.cter_importe\n @devueltocaucion.devc_cabsalidacarteraant = @estadocheq.cabsalidacartera_id\n @devueltocaucion.devc_usuario = session[:user].usur_nombre\n @devueltocaucion.devc_ultmod = DateTime.now\n @devueltocaucion.save\n\n #hacer asiento\n @cabasiento = Cabasiento.new\n @cabasiento.sucursal_id = 11\n @cabasiento.cabcaja_id = 0\n\t\t@cabasiento.casi_fecha = params[:fechaacred].to_s.to_date\n @cabasiento.casi_cerrado = \"No\"\n \t@cabasiento.casi_borrado = \"No\"\n\t\t@cabasiento.casi_importado = \"No\"\n @cabasiento.casi_descripcion = \"Reingreso de Caucion\"\n @cabasiento.casi_usuario = session[:user].usur_nombre\n @cabasiento.casi_ultmod = DateTime.now\n @cabasiento.save\n \n #renglones del asiento\n nrocabasiento = Cabasiento.maximum(:id)\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 21\n @renasiento.rasi_importe = @cheterc.cter_importe\n @renasiento.save\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 132\n @renasiento.rasi_importe = -@cheterc.cter_importe\n @renasiento.save\n \n # pone a cero los estadocheter\n @estadocheter = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n @estadocheter.update_attribute(:cabsalidacartera_id, '0')\n @estadocheter.update_attribute(:destinocheter_id, '0')\n @estadocheter.update_attribute(:echt_usuario, session[:user].usur_nombre)\n @estadocheter.update_attribute(:echt_ultmod, DateTime.now)\n end\n if params[:conceptocaucion].to_s == \"3\" \n @cheterc = Chequetercero.find_by_id_and_sucursal_id(item_id, '11')\n @estadocheq = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n #grabar devueltocaucion Gesv- Manual\n @devueltocaucion = Devueltocaucion.new\n @devueltocaucion.chequetercero_id = item_id\n @devueltocaucion.sucursal_id = 11\n @devueltocaucion.devc_tipo = \"R\"\n @devueltocaucion.devc_fecha = params[:fechaacred].to_s.to_date\n @devueltocaucion.devc_detalle = 'Devolucion (GESVAL - DEP.MANUAL) Ch/Nº '+@cheterc.cter_nrocheque.to_s+' listado('+@cheterc.listadocaucion_id.to_s+')'\n @devueltocaucion.devc_importe = @cheterc.cter_importe\n @devueltocaucion.devc_cabsalidacarteraant = @estadocheq.cabsalidacartera_id\n @devueltocaucion.devc_usuario = session[:user].usur_nombre\n @devueltocaucion.devc_ultmod = DateTime.now\n @devueltocaucion.save\n\n #hacer asiento\n @cabasiento = Cabasiento.new\n @cabasiento.sucursal_id = 11\n @cabasiento.cabcaja_id = 0\n\t\t @cabasiento.casi_fecha = params[:fechaacred].to_s.to_date\n @cabasiento.casi_cerrado = \"No\"\n \t @cabasiento.casi_borrado = \"No\"\n\t\t @cabasiento.casi_importado = \"No\"\n @cabasiento.casi_descripcion = \"GESVAL - DEP.MANUAL\"\n @cabasiento.casi_usuario = session[:user].usur_nombre\n @cabasiento.casi_ultmod = DateTime.now\n @cabasiento.save\n \n #renglones del asiento\n nrocabasiento = Cabasiento.maximum(:id)\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 7\n @renasiento.rasi_importe = @cheterc.cter_importe\n @renasiento.save\n @renasiento = Renasiento.new\n @renasiento.cabasiento_id = nrocabasiento\n @renasiento.plandecuenta_id = 132\n @renasiento.rasi_importe = -@cheterc.cter_importe\n @renasiento.save\n \n # pone a cero los estadocheter\n @estadocheter = Estadocheter.find_by_chequetercero_id_and_sucursal_id(item_id, '11')\n @estadocheter.update_attribute(:cabsalidacartera_id, '0')\n @estadocheter.update_attribute(:destinocheter_id, '0')\n @estadocheter.update_attribute(:echt_usuario, session[:user].usur_nombre)\n @estadocheter.update_attribute(:echt_ultmod, DateTime.now)\n \n end\n }\n end\n # para actualizar las busquedas\n fechas()\n @depositocaucionpendis = Depositocaucion.busqueda(params[:fechadesde], params[:fechahasta], params[:nrocheq])\n @depositocaucions = Depositocaucion.busquedatodo(params[:fechadesde], params[:fechahasta], params[:nrocheq])\n #para sacar los subtotales\n agrup = []\n @depositocaucions.each do |v|\n agrup << v.dcau_nroboletadeposito.to_i\n end\n @agrups = agrup.uniq\n @totalvens = Depositocaucion.totalven(params[:fechadesde], params[:fechahasta])\n @acreditados = Depositocaucion.acreditado(params[:fechadesde], params[:fechahasta])\n render :partial => \"nuevo\", :layout => \"application\"\n\n #redirect_to :action => 'index'\n #render(:update) { |page| page.call 'location.reload' }\n #respond_to do |format| format.js {render(:update) { |page| page.call 'location.reload' }} end \n #render :update do |page| page.form.reset 'uploadPhotoForm' end\n end",
"def verifcar_alguna_pelea_abierta_antes_pago_any_ticket (ticket)\n #todas peleas cerrada implica cero peleas abiertas ok.\n\n @jugadalots = Jugadalot.where(:ticket_id => ticket.id) # todas las jugadas de ese ticket\n @alguna_pelea_abierta = false\n @peleas_abierta = [] # listado de peleas cerradas array\n\n @jugadalots.each do |jugada|\n \n #verifcar que todas las jugadas de ese ticket esten cerrada (peleas cerradas de ese ticket de esa fecha de esa lina de ese dia ok)\n linea_pelea = Lineat.by_day(jugada.created_at.to_date).where(:pelea => jugada.pelea.to_i).first || [] # \n if linea_pelea.status == \"abierta\"\n @peleas_abierta << linea_pelea.pelea # 3, 4 etc cerradas\n end\n \n end\n\n if @peleas_abierta.empty? # si esta vacio no hay niguna pelea cerrada\n return false \n else\n return @peleas_abierta # retorna las peleas abiertas\n end \n\n\n end",
"def save_endereco(log, numero, comp) \n e = Endereco.where(logradouro: log, numero: numero, complemento: comp).first\n if e == nil\n puts \"Criando novo endereco...\"\n e = Endereco.create!(logradouro: log, numero: numero, complemento: comp)\n puts e\n else\n puts \">>> Endereco ja cadastrado #{log.cep} #{numero}\"\n end\n e\n end",
"def empty?\n @rows.empty? if @rows\n end",
"def iniciarBodega\n Cliente.destroy_all\n #1. Crear clientes\n if(Cliente.all.count==0)\n clientesIniciar\n end\n #2. Crear Bodega\n ib = Bodega.iniciarBodega(true) #True porque se inicia\n \n #3. Mandar a producir Stock si es Bajo\n ProducirMateriasPrimas.new.producirStockBajo\n render json: \"Iniciada\"\nend",
"def create\n @ogrenci = Ogrenci.new(ogrenci_params)\n @ogrenci.date=Date.today\n\n if Ogrenci.exists?(tc_no: @ogrenci.tc_no)\n flash[:notice] = \"Bu öğrenci zaten KAYITLI !!\"\n redirect_to new_ogrenci_path\n else\n if !current_user.yonetici?\n flash[:notice] = \"Bu öğrencinin kaydını gerçekleştirebilmeniz için yönetici izni gereklidir !!\"\n redirect_to new_ogrenci_path\n else\n if @ogrenci.save\n flash[:notice]=\"Öğrenci kaydı başarıyla oluşturuldu.!!\" \n redirect_to @ogrenci \n end\n end\n end\n end",
"def check_controllo_offerte(file_controlo)\n sheet = apri_file(file_controlo)\n tabella_controlli = [sheet.column(2),sheet.column(3)]\n tabella_controlli[0].each_with_index do |x,y|\n if x == \"FLUSSO\"\n unless tabella_controlli[1][0] == $data\n @errore << \"Nel file #{file_controlo.basename} c'è una data diversa da quella selezionata\"\n end\n else\n unless tabella_controlli[1][y] == \"OK\"\n @errore << \"Nel file #{file_controlo.basename} il \\\"#{tabella_controlli[0][y]}\\\" non è OK\"\n end\n end\n end\n end",
"def debe_ser_encarcelado\n if is_encarcelado\n return false\n else\n if !tiene_salvoconducto\n return true\n else\n perder_salvoconducto\n Diario.instance.ocurre_evento(\"El jugador se libra de la cárcel\")\n return false\n end\n end\n end",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @total_servicos.nil?\n return false\n end\n\n \n \n \n \n \n if @total_parcelado_nacionais.nil?\n return false\n end\n\n \n \n \n \n \n if @total_parcelado_internacionais.nil?\n return false\n end\n\n \n \n \n \n end",
"def empty?\n load # make sure we have determined the number of fetched records\n\n @number_of_records.zero?\n end",
"def any?\n raise \"#{self.class}: instance not prepared before doing any move\" unless @prepared\n\n @total_rows_number > 0\n end",
"def ensure_not_referenced_by_any_articulo\n unless articulos_agregados.empty?\n errors.add(:base, 'Articulo agregado en carrito')\n throw :abort\n end\n end",
"def new\n \n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n respond_to do |format|\n unless @selecciones.empty?\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n @orden = Orden.new(:direccion_entrega=>usuario_actual.direccion)\n t = Time.now\n fecha = t.strftime(\"%Y-%m-%d\")\n client = Savon::Client.new(\"http://192.168.1.121/DistribuidorFIF/webservices/servicio.php?wsdl\")\n preorden = \"<solicitud_pedido>\n <num_orden>001</num_orden>\n <nombre_comercio>Tukiosquito</nombre_comercio>\n <fecha_solicitud>\"+fecha.to_s+\"</fecha_solicitud>\n <nombre_cliente>\"+usuario_actual.nombre+\" \"+usuario_actual.apellido+\"</nombre_cliente>\n <direccion_comercio>\n <avenida>Sucre</avenida>\n <calle>-</calle>\n <edificio_casa>CC Millenium</edificio_casa>\n <local_apt>C1-15</local_apt>\n <parroquia>Leoncio Martinez</parroquia>\n <municipio>Sucre</municipio>\n <ciudad>Caracas</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_comercio>\n <direccion_destino>\n <avenida>Santa Rosa</avenida>\n <calle>Tierras Rojas</calle>\n <edificio_casa>Villa Magica</edificio_casa>\n <local_apt>69</local_apt>\n <parroquia> </parroquia>\n <municipio>Zamora</municipio>\n <ciudad>Cua</ciudad>\n <estado>Miranda</estado>\n <pais>Venezuela</pais>\n </direccion_destino>\"\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n preorden = preorden+\"\n <articulo>\n <id>\"+p.id.to_s+\"</id>\n <descripcion>\"+p.descripcion+\"</descripcion>\n <peso>\"+p.peso.to_s+\"</peso>\n <cantidad>\"+seleccion.cantidad.to_s+\"</cantidad>\n <precio>\"+p.precio.to_s+\"</precio>\n </articulo>\"\n end\n preorden = preorden+\"</solicitud_pedido>\"\n response = client.request :ejemplo, body: { \"value\" => preorden } \n if response.success? \n respuesta = response.to_hash[:ejemplo_response][:return]\n datos = XmlSimple.xml_in(respuesta)\n end\n\n @precio_envio = datos[\"num_orden\"][0]\n #@arreglo = XmlSimple.xml_in('')\n #@xml = XmlSimple.xml_out(@arreglo, { 'RootName' => 'solicitud_pedido' })\n #url = 'http://192.168.1.101/Antonio/tukyosquito/proyecto/servicio/servicio.php'\n #cotizacion = SOAP::RPC::Driver.new(url)\n #cotizacion.add_method('obtener','asd')\n #tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n #@respuesta = cotizacion.obtener('123')\n format.html # new.html.erb\n else\n format.html { redirect_to carrito_path, notice: 'No tiene productos agregados al carro de compras para generar una orden.' }\n end\n end\n end",
"def insert_comp(data)\n max_row = $DB.execute(\"SELECT MAX(cid) FROM company\")\n new_cid = Integer(max_row[0][0]) + 1\n\n query_qr = \"SELECT * FROM COMPANY WHERE \"\n\n #critical section some companies lack all of above fields to be revised for update!! TODO\n if data[\"საიდენტიფიკაციო კოდი\"]== nil and data[\"პირადი ნომერი\"]== nil\n puts \"The company (name = #{data[\"დასახელება\"]}) missing both id numbers, quering w/r to company name and reg. date.\"\n slct = $DB.prepare(\"SELECT * FROM company WHERE comp_name = ? AND state_reg_date = ?\")\n slct.bind_params(data[\"დასახელება\"], data[\"სახელმწიფო რეგისტრაციის თარიღი\"])\n rslt = slct.execute\n rslt.reset()\n if rslt.next() != nil\n rslt.reset()\n puts \"The company is in the database, verifying the columns\"\n $comp_in_db = true\n rslt.each do |row|\n $current_cid = Integer(row[0])\n if row[1] != data[\"საიდენტიფიკაციო კოდი\"] or\n row[2] != data[\"პირადი ნომერი\"] or\n row[3] != data[\"სახელმწიფო რეგისტრაციის ნომერი\"] or\n row[4] != data[\"დასახელება\"] or\n row[5] != data[\"სამართლებრივი ფორმა\"] or\n row[7] != data[\"სახელმწიფო რეგისტრაციის თარიღი\"] or\n row[8] != data[\"სტატუსი\"]\n msg = \"Company info with missing id numbers has been modified since the last scrape\\n\"\n stm = $DB.prepare(\"SELECT * FROM company WHERE cid = ?\")\n stm.bind_params(row[0])\n result = stm.execute\n result.each do |line|\n msg += \"Identification Code: $DB=> #{row[1]} || scrapped=> #{data[\"საიდენტიფიკაციო კოდი\"]}\\n\"\n msg += \"P number: $DB=> #{row[2]} || scrapped=> #{data[\"პირადი ნომერი\"]}\\n\"\n msg += \"State registration number: $DB=> #{row[3]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\\n\"\n msg += \"Name: $DB=> #{row[4]} || scrapped=> #{data[\"დასახელება\"]}\\n\"\n msg += \"Legal form: $DB=> #{row[5]} || scrapped=> #{data[\"სამართლებრივი ფორმა\"]}\\n\"\n msg += \"State reg date: $DB=>#{row[7]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]}\\n\"\n msg += \"Satus: $DB=> #{row[8]} || scrapped=> #{data[\"სტატუსი\"]}\\n\"\n alert(10, msg)\n end\n stm.close\n puts \"<<<<<<<<<<<<<<<<critical company ALERT!>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n else\n puts \"<<<<<<<<<<<<<<<<< SAME CRITICAL COMPANY>>>>>>>>>>>>>>>>>>>>>\"\n puts \"CID $DB => #{row[0]}\"\n puts \"Identification Code: $DB=> #{row[1]} || scrapped=> #{data[\"საიდენტიფიკაციო კოდი\"]}\"\n puts \"P number: $DB=> #{row[2]} || scrapped=> #{data[\"პირადი ნომერი\"]}\"\n puts \"State registration number: $DB=> #{row[3]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\"\n puts \"Name: $DB=>#{row[4]} || scrapped=> #{data[\"დასახელება\"]}\"\n puts \"Legal Form: $DB=> #{row[5]} || scrapped=> #{data[\"სამართლებრივი ფორმა\"]}\"\n puts \"State registration date: $DB=> #{row[7]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]}\"\n puts \"Status: $DB=> #{row[8]} || scrapped=> #{data[\"სტატუსი\"]}\"\n\n end\n end\n else\n $current_cid = new_cid\n $comp_in_db = false\n $DB.execute(\"INSERT INTO company(cid, id_code, p_code, state_reg_code, comp_name, legal_form, state_reg_date, status, scrap_date) VALUES (\n :cid, :id_code, :p_code, :state_reg_code, :comp_name, :legal_form, :state_reg_date, :status, :scrap_date)\",\n \"cid\" => $current_cid,\n \"id_code\"=>data[\"საიდენტიფიკაციო კოდი\"],\n \"p_code\"=>data[\"პირადი ნომერი\"],\n \"state_reg_code\"=>data[\"სახელმწიფო რეგისტრაციის ნომერი\"],\n \"comp_name\"=>data[\"დასახელება\"],\n \"legal_form\"=>data[\"სამართლებრივი ფორმა\"],\n \"state_reg_date\"=>data[\"სახელმწიფო რეგისტრაციის თარიღი\"],\n \"status\"=>data[\"სტატუსი\"],\n \"scrap_date\"=> Time.now.utc.iso8601)\n\n puts \"<--------------------------A company inserted--------------------------->\"\n puts \"CID = #{$current_cid}; ID=#{data[\"საიდენტიფიკაციო კოდი\"]}; P_code=#{data[\"პირადი ნომერი\"]}; State_reg_code=#{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\"\n puts \"Company name: #{data[\"დასახელება\"]}\"\n puts \"legal form: #{data[\"სამართლებრივი ფორმა\"]}; state_reg_date=#{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]} status:#{data[\"სტატუსი\"]}\"\n puts \"Scrape date: #{Time.now.utc.iso8601}\"\n puts \"<----------------------------------------------------------------------->\"\n\n end\n\n slct.close\n return\n end\n\n\n\n if data[\"საიდენტიფიკაციო კოდი\"] != nil\n query_qr = query_qr + \" id_code = '#{data[\"საიდენტიფიკაციო კოდი\"]}' \"\n id_added = true\n valid_query = true\n end\n if data[\"პირადი ნომერი\"] != nil\n if id_added == true\n query_qr = query_qr + \" OR \"\n end\n query_qr = query_qr + \" p_code = '#{data[\"პირადი ნომერი\"]}' \"\n pcode_added = true\n valid_query = true\n end\n\n if valid_query\n statement = $DB.prepare(query_qr)\n result = statement.execute\n if result.next() == nil\n $current_cid = new_cid\n $comp_in_db = false\n $DB.execute(\"INSERT INTO company(cid, id_code, p_code, state_reg_code, comp_name, legal_form, state_reg_date, status, scrap_date) VALUES (\n :cid, :id_code, :p_code, :state_reg_code, :comp_name, :legal_form, :state_reg_date, :status, :scrap_date)\",\n \"cid\" => $current_cid,\n \"id_code\"=>data[\"საიდენტიფიკაციო კოდი\"],\n \"p_code\"=>data[\"პირადი ნომერი\"],\n \"state_reg_code\"=>data[\"სახელმწიფო რეგისტრაციის ნომერი\"],\n \"comp_name\"=>data[\"დასახელება\"],\n \"legal_form\"=>data[\"სამართლებრივი ფორმა\"],\n \"state_reg_date\"=>data[\"სახელმწიფო რეგისტრაციის თარიღი\"],\n \"status\"=>data[\"სტატუსი\"],\n \"scrap_date\"=> Time.now.utc.iso8601)\n\n puts \"<--------------------------A company inserted--------------------------->\"\n puts \"CID = #{$current_cid}; ID=#{data[\"საიდენტიფიკაციო კოდი\"]}; P_code=#{data[\"პირადი ნომერი\"]}; State_reg_code=#{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\"\n puts \"Company name: #{data[\"დასახელება\"]}\"\n puts \"legal form: #{data[\"სამართლებრივი ფორმა\"]}; state_reg_date=#{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]} status:#{data[\"სტატუსი\"]}\"\n puts \"Scrape date: #{Time.now.utc.iso8601}\"\n puts \"<----------------------------------------------------------------------->\"\n else\n $comp_in_db = true\n result.reset()\n result.each do |row|\n $current_cid = Integer(row[0])\n if row[1] != data[\"საიდენტიფიკაციო კოდი\"] or #Identification Code\n row[2] != data[\"პირადი ნომერი\"] or #P number\n row[3] != data[\"სახელმწიფო რეგისტრაციის ნომერი\"] or #state registration number\n row[4] != data[\"დასახელება\"] or #name\n row[5] != data[\"სამართლებრივი ფორმა\"] or #Legal Form\n row[7] != data[\"სახელმწიფო რეგისტრაციის თარიღი\"] or #State registration date\n row[8] != data[\"სტატუსი\"] #status\n msg = \"Company info with missing id numbers has been modified since the last scrape\\n\"\n stm_m = $DB.prepare(\"SELECT * FROM company WHERE cid = ?\")\n stm_m.bind_params(row[0])\n result = stm_m.execute\n result.each do |line|\n msg += \"Identification Code: $DB=> #{row[1]} || scrapped=> #{data[\"საიდენტიფიკაციო კოდი\"]}\\n\"\n msg += \"P number: $DB=> #{row[2]} || scrapped=> #{data[\"პირადი ნომერი\"]}\\n\"\n msg += \"State registration number: $DB=> #{row[3]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\\n\"\n msg += \"Name: $DB=>#{row[4]} || scrapped=> #{data[\"დასახელება\"]}\\n\"\n msg += \"Legal Form: $DB=> #{row[5]} || scrapped=> #{data[\"სამართლებრივი ფორმა\"]}\\n\"\n msg += \"State registration date: $DB=> #{row[7]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]}\\n\"\n msg += \"Status: $DB=> #{row[8]} || scrapped=> #{data[\"სტატუსი\"]}\\n\"\n alert(10, msg)\n end\n stm_m.close\n puts \"<<<<<<<<<<<<<<<<company ALERT!>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n else\n puts \"<<<<<<<<<<<<<<<<<SAME company>>>>>>>>>>>>>>>>>>>>>>>>\"\n puts \"CID $DB => #{row[0]}\"\n puts \"Identification Code: $DB=> #{row[1]} || scrapped=> #{data[\"საიდენტიფიკაციო კოდი\"]}\"\n puts \"P number: $DB=> #{row[2]} || scrapped=> #{data[\"პირადი ნომერი\"]}\"\n puts \"State registration number: $DB=> #{row[3]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის ნომერი\"]}\"\n puts \"Name: $DB=>#{row[4]} || scrapped=> #{data[\"დასახელება\"]}\"\n puts \"Legal Form: $DB=> #{row[5]} || scrapped=> #{data[\"სამართლებრივი ფორმა\"]}\"\n puts \"State registration date: $DB=> #{row[7]} || scrapped=> #{data[\"სახელმწიფო რეგისტრაციის თარიღი\"]}\"\n puts \"Status: $DB=> #{row[8]} || scrapped=> #{data[\"სტატუსი\"]}\"\n end\n end\n end\n statement.close\n end\nend",
"def buscar_usuario(nombre_de_usuario)\n #dos usuarios son iguales si su nombre de usuario es el mismo\n @usuarios.detect(-> do\n raise UsuarioInexistente\n end) {|usuario| usuario.nombre_de_usuario == nombre_de_usuario}\n end",
"def resultados\n if params[:checklist] == '1'\n self.taxones = taxones.datos_arbol_con_filtros\n checklist\n else\n self.taxones = taxones.select_basico.order(:nombre_cientifico)\n return if formato == 'xlsx'\n\n self.taxones = taxones.offset(offset).limit(por_pagina)\n\n # Si solo escribio un nombre\n if params[:id].blank? && params[:nombre].present?\n taxones.each do |t|\n t.cual_nombre_comun_coincidio(params[:nombre])\n end\n end\n end # End checklist\n end",
"def recibir_auto(usuario)\n if self.estado_id == 2\n traza_creada = Traza.create(:copia_id => self.id, :movimiento_id => 2, :usuario => usuario, :buzon_id => usuario.puesto.buzon_id)\n return false unless traza_creada\n self.estado_id = 3\n return true if self.save \n #si llega aqui, algo malo paso.\n return false\n end\n end",
"def create\n @urun = Urun.new(urun_params)\n @urun.date=Date.today\n\n \n\n if !Urunler.exists?(paket_tipi: @urun.paket_tipi, adi: @urun.adi)\n flash[:notice] = \"Bu ürün girişini yapmadan önce stok girişini yapınız. !!\"\n redirect_to new_urun_path\n\n else\n respond_to do |format|\n if @urun.save\n\n @depo=Urunler.find_by_adi_and_paket_tipi(@urun.adi, @urun.paket_tipi)\n @depo.stok+=@urun.stok\n @depo.save\n\n format.html { redirect_to urunlers_path, notice: 'Kayıt başarıyla oluşturuldu.' }\n format.json { render :show, status: :created, location: @urun }\n else\n format.html { render :new }\n format.json { render json: @urun.errors, status: :unprocessable_entity }\n end\n end\n end\nend",
"def grabar_usuario_ensambladora(nombre,password)\n @usuario = Usuario.find(:first, :conditions => \"nombre='#{nombre}'\")\n if @usuario!=nil\n $tirajson = '{ \"success\": \"true\", \"exito\": \"true\", \"message\": \"Ya existe ese nombre de usuario!\" }'\n else\n @usuario= Usuario.new\n @usuario.nombre=nombre\n @usuario.password=password\n @usuario.rols_id= 3\n @usuario.estatus='a'\n @usuario.save\n $tirajson = '{ \"success\": \"true\", \"exito\": \"true\", \"message\": \"Datos guardados satisfactoriamente!\" }'\n valor=1\n end\n \n \n end",
"def ensure_remitente_exists\n begin\n Entidad.find(self.remitente_id)\n rescue ActiveRecord::RecordNotFound\n errors.add(:remitente,'Debe seleccionar un Remitente')\n end\n\n end",
"def virgin?\n self.transactions.empty?\n end",
"def podeCadastrarNovaTurma\n\n if (current_usuario.usuarioLimitado? && current_usuario.turmas.exists?)\n #se usuario é limitado e ja possui local\n #true -true\n return false\n end\n\n return true\n\n end",
"def can_delete?\n programas.empty? && estaciones.empty?\n end"
] |
[
"0.6077984",
"0.6005125",
"0.5959389",
"0.5910923",
"0.5910204",
"0.58555377",
"0.5827554",
"0.5823105",
"0.57791585",
"0.5730915",
"0.57209843",
"0.5687064",
"0.56418747",
"0.56150514",
"0.5610099",
"0.56001043",
"0.55646485",
"0.54880387",
"0.5487157",
"0.5486776",
"0.54846454",
"0.548234",
"0.54804295",
"0.5478002",
"0.5471647",
"0.5468101",
"0.54661864",
"0.54661864",
"0.5460311",
"0.54587495",
"0.5452319",
"0.5451212",
"0.5435762",
"0.54276556",
"0.54276556",
"0.5423718",
"0.5422993",
"0.5416524",
"0.54163545",
"0.5416113",
"0.54129815",
"0.54129815",
"0.5410323",
"0.54087603",
"0.5394684",
"0.5392365",
"0.53857964",
"0.5368086",
"0.5360019",
"0.5339557",
"0.53378385",
"0.53364843",
"0.53355914",
"0.53355914",
"0.53355914",
"0.5334343",
"0.53340346",
"0.5331847",
"0.53188324",
"0.5308495",
"0.53028196",
"0.53021854",
"0.5296138",
"0.5294064",
"0.528555",
"0.5283176",
"0.5279124",
"0.527703",
"0.5275961",
"0.5275699",
"0.5275547",
"0.526395",
"0.52618665",
"0.5257534",
"0.5252461",
"0.52489525",
"0.5244781",
"0.5244219",
"0.5241489",
"0.5237017",
"0.52338547",
"0.5233525",
"0.52327317",
"0.52228034",
"0.5222642",
"0.5214551",
"0.52068615",
"0.52048135",
"0.5202261",
"0.5201592",
"0.519897",
"0.5198642",
"0.51838183",
"0.5183585",
"0.5180464",
"0.51770943",
"0.5175791",
"0.51744866",
"0.5174401",
"0.516348",
"0.51616204"
] |
0.0
|
-1
|
XXX: is it okay having this here?
|
def service_version_set(service_name, service_id, versions)
@service_map_name_to_id[service_name] = service_id
dev_version = versions.reverse_each.find { |_| !_.locked }
dev = dev_version && dev_version.number
active = (versions.reverse_each.find(&:active) || versions.reverse_each.find(&:locked)).number
@service_versions[service_id] = {dev: dev, active: active, name: service_name, id: service_id}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def probers; end",
"def internal; end",
"def internal?; end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def escaper=(_); end",
"def internship_passed; end",
"def used?; end",
"def wrapper; end",
"def anchored; end",
"def custom; end",
"def custom; end",
"def probers=(_arg0); end",
"def implementation; end",
"def implementation; end",
"def final; end",
"def isolated; end",
"def isolated; end",
"def weber; end",
"def awaken!\n\t\traise 'Not implemented'\n\tend",
"def overload; end",
"def big_bad; end",
"def extra; end",
"def r; end",
"def r; end",
"def suivre; end",
"def refutal()\n end",
"def same; end",
"def who_we_are\r\n end",
"def missing?; end",
"def extra=(_arg0); end",
"def writethis; end",
"def called_from; end",
"def called_from; end",
"def placebo?; false end",
"def whiny=(_arg0); end",
"def returns; end",
"def result=(_); end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def ibu; end",
"def isolated=(_arg0); end",
"def isolated=(_arg0); end",
"def loc; end",
"def loc; end",
"def loc; end",
"def original_result; end",
"def method_731(base); end",
"def handle; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def pausable; end",
"def missing; end",
"def original; end",
"def code_point=(_); end",
"def ignores; end",
"def extra_state; end",
"def fallbacks=(_arg0); end",
"def wrapped_in=(_arg0); end",
"def local?; end",
"def hiss; end",
"def usable?; end",
"def specialty; end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def isolated?; end",
"def isolated?; end",
"def trd; end",
"def private_method\n end",
"def explicit; end",
"def processor; end",
"def jack_handey; end",
"def offences_by=(_arg0); end",
"def under_construction\n end",
"def semact?; false; end",
"def return_value=(_arg0); end",
"def too_many_hops?; end",
"def terpene; end",
"def intensifier; end",
"def pass; end",
"def pass; end",
"def berlioz; end",
"def base=(_arg0); end",
"def final?; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def escaper; end"
] |
[
"0.7435162",
"0.6454252",
"0.6374781",
"0.6172933",
"0.6093583",
"0.60011166",
"0.60011166",
"0.60011166",
"0.60011166",
"0.5988442",
"0.598577",
"0.5961287",
"0.59562254",
"0.5955639",
"0.5912692",
"0.5912692",
"0.586527",
"0.58131856",
"0.58131856",
"0.5806222",
"0.5804997",
"0.5804997",
"0.57741284",
"0.5767871",
"0.5740699",
"0.5734652",
"0.57249916",
"0.5665759",
"0.5665759",
"0.56583995",
"0.5640231",
"0.56352067",
"0.5624856",
"0.5613035",
"0.5608666",
"0.55938375",
"0.5586967",
"0.5586967",
"0.55773896",
"0.55710113",
"0.5557308",
"0.55424744",
"0.5532379",
"0.5532379",
"0.5532379",
"0.5532379",
"0.5532379",
"0.5532379",
"0.5532379",
"0.5532379",
"0.55260336",
"0.5525658",
"0.5525658",
"0.55238974",
"0.55238974",
"0.55238974",
"0.5517871",
"0.5516071",
"0.5515143",
"0.5514801",
"0.5514801",
"0.5514801",
"0.55143255",
"0.55109626",
"0.5503535",
"0.55009896",
"0.5498806",
"0.54949236",
"0.5480445",
"0.54752415",
"0.5473874",
"0.54683656",
"0.54655707",
"0.5461757",
"0.5454023",
"0.5454023",
"0.5454023",
"0.54475003",
"0.54475003",
"0.54460675",
"0.5441243",
"0.54406023",
"0.544",
"0.5435287",
"0.5429053",
"0.5423901",
"0.54230845",
"0.5421928",
"0.5417351",
"0.54112357",
"0.53998244",
"0.53996164",
"0.53996164",
"0.5395254",
"0.5389251",
"0.538716",
"0.5382197",
"0.5382197",
"0.5382197",
"0.5382197",
"0.53820944"
] |
0.0
|
-1
|
GET /site/columns GET /site/columns.json
|
def index
@site = Cms::Site.all.take
@cms_columns = @site.columns.where("parent_column_id is NULL").order("the_order ASC") # Cms::Column.find_by_cms_id(@site.id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_column\n if params[:battery].present?\n @columns = Battery.find(params[:battery]).columns\n else\n @columns = Battery.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {columns: @columns}\n }\n end\n end\n end",
"def get_columns\n battery_id = params[:battery_id]\n columns = Column.where(battery_id: battery_id)\n render json: columns\n end",
"def getcolumns\n puts params\n colid = params[\"batteryid\"]\n\n columns = Column.where(:battery_id => colid)\n\n puts columns.inspect\n \n @x = columns\n respond_to do |format|\n format.json { render json: columns }\n end\n end",
"def column_select\n p params[\"battery_id\"]\n @columns = Column.where(battery_id: params[\"battery_id\"])\n respond_to do |format |\n format.json {\n render json: {\n columns: @columns\n }\n }\n end\n end",
"def column\n if params[:battery].present?\n @column = Column.where(battery_id:params[:battery]) \n else\n @column = Column.all\n end\n\n respond_to do |format|\n format.json {\n render json: {column: @column}\n \n }\n end\n end",
"def index\n @columns = Column.all.page(params[:page])\n end",
"def columns; @columns; end",
"def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end",
"def column\n @equipment = Equipment.pluck(request.params[:column])\n\n respond_to do |format|\n format.json { render json: @equipment }\n end\n end",
"def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end",
"def columns; @columns_hash.values; end",
"def columns\n return [{:id=>\"one\", :display =>'One', :searchable=>false}, {:id=>'two', :display => 'three'}]\n end",
"def columns\n @columns\n end",
"def columns; end",
"def get_columns!( *headers )\n data.get_columns!( *headers ); self\n end",
"def columns\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def index\n @item_columns = ItemColumn.all\n end",
"def index\n @columns = Column.find(:all, :order => _(:title, :column))\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @columns.to_xml }\n end\n end",
"def column_fields(json=true)\n data = @data.map do |data|\n data = data.dup\n editor = parse_column_editor(data.delete(\"editor\"))\n renderer = parse_column_renderer(data.delete(\"renderer\"))\n data.merge!(editor) if editor\n data.merge!(renderer) if renderer\n data.delete(\"method\")\n data.delete(\"mapping\")\n data\n end\n json ? JSON.pretty_generate(data) : data\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def list_entries_for_column(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns/{id}/data\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|ColumnDatum.new(response)}\n end",
"def columns\n @columns_hash.values\n end",
"def columns\n @columns ||= []\n end",
"def columns\n @columns ||= [];\n end",
"def get_columns\n return @columns\n end",
"def index\n @row_columns = RowColumn.all\n end",
"def columns\n _columns || columns!\n end",
"def columns\n @columns = columns_hash.values\n end",
"def columns\n ColumnCollection.new(@data)\n end",
"def columns\n @columns\n end",
"def list_columns\n columns\n end",
"def feature_columns\n ensure_full_data!\n Array(@gapi_json[:featureColumns]).map do |field_gapi_json|\n field_gapi = Google::Apis::BigqueryV2::StandardSqlField.from_json field_gapi_json.to_json\n StandardSql::Field.from_gapi field_gapi\n end\n end",
"def columns()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Columns::ColumnsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n tasks = Task.all\n render json: tasks, include: [:user, :column], except: [:user_id, :column_id]\n end",
"def _columns\n cache_get(:_columns)\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def columns \n []\n end",
"def columns\n @columns ||= ControllerAction.columns.map(&:name).map(&:to_sym).reject{|c|c==:id}\n end",
"def columns\n select.inject([]) do |columns, column|\n columns << {\n :type => all_columns[column][:type]\n }.merge({\n :id => column.to_s,\n :label => column_label(column)\n })\n end\n end",
"def get_column_by_batterie\n @column = Column.where(battery_id: params[:batterie_id])\n puts @column\n respond_to do |format| \n format.json { render :json => @column }\n end\n \n \n end",
"def columns\n get_metadata unless @columns\n return @columns\n end",
"def index\n @app_model_columns = AppModelColumn.all\n end",
"def columns!\n @columns = nil\n columns\n end",
"def columns()\n cols = {}\n prefix = \"#{@opts[:pname]}_\"\n fspec = @opts[:fspec]\n\n fspec.params.each do |name, opts|\n cols[prefix + name] = opts\n end\n cols \n end",
"def columns\n self.class.instance_variable_get(:@columns)\n end",
"def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }\n # end\n end",
"def export_columns\n self.entity_columns.select(\"name, description, ref_type, ref_name, col_type\").where(\"list_rank > 0 and name not in ('domain_id', 'creator_id', 'updater_id', 'created_at', 'updated_at')\").order(\"list_rank asc\")\n end",
"def get_column_entries(column)\n jso = Hash.new() \n jss = self.get_structure()\n db_column = nil\n # Is the column recognized?\n if jss.has_key? column then\n db_column = jss[column].split(\"/\")[1]\n else\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n \n # Connect to database\n dbe = MIDB::API::Dbengine.new(@engine.config, @db)\n dblink = dbe.connect()\n rows = dbe.query(dblink, \"SELECT * FROM #{self.get_structure.values[0].split('/')[0]};\")\n if rows == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n # Iterate over all rows of this table\n rows.each do |row|\n\n name = column\n dbi = jss[name]\n table = dbi.split(\"/\")[0]\n field = dbi.split(\"/\")[1]\n # Must-match relations (\"table2/field/table2-field->row-field\")\n if dbi.split(\"/\").length > 2\n match = dbi.split(\"/\")[2]\n matching_field = match.split(\"->\")[0]\n row_field = match.split(\"->\")[1]\n query = dbe.query(dblink, \"SELECT #{field} FROM #{table} WHERE #{matching_field}=#{row[row_field]};\")\n else\n query = dbe.query(dblink, \"SELECT #{field} from #{table} WHERE id=#{row['id']};\")\n end\n if query == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n jso[row[\"id\"]] = {}\n jso[row[\"id\"]][name] = dbe.length(query) > 0 ? dbe.extract(query,field) : \"unknown\"\n jso[row[\"id\"]][name] = @hooks.format_field(name, jso[row[\"id\"]][name])\n end\n @hooks.after_get_all_entries(dbe.length(rows))\n return jso\n end",
"def columns\n collect = []\n recursive_columns(@base, collect)\n end",
"def columns\n raise NotImplementedError\n end",
"def column_name\n return 'json_scrape' if invalid_param('column_name')\n\n @params['column_name']\n end",
"def venueColumns \n venueLayout[\"columns\"]\n end",
"def columns\n single_record unless @columns\n @columns || []\n end",
"def index\n @columns = Column.includes(:tasks).where(board: @board)\n end",
"def query_columns\n explicit_columns\n end",
"def list_custom_gradebook_columns(course_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns\",\n :course_id => course_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|CustomColumn.new(response)}\n end",
"def columns\n @columns ||= 1.upto(@rowset.get_meta_data.get_column_count).map do |i|\n {\n :id => @rowset.get_meta_data.getColumnName(i),\n :name => @rowset.get_meta_data.getColumnLabel(i)\n }\n end\n end",
"def columns()\n \t cols = {}\n cols['oml_sender_id'] = {:type => 'INTEGER'}\n cols['oml_seq'] = {:type => 'INTEGER'}\n cols['oml_ts_client'] = {:type => 'REAL'}\n cols['oml_ts_server'] = {:type => 'REAL'}\n \t if @filters.size > 0\n \t @filters.each do |f|\n cols.merge!(f.columns)\n \t end\n \t else\n #appDef = AppDefinition[@application.to_s]\n appDef = @application.appDefinition\n appDef.measurements[@mdef].metrics.each do |name, opts|\n #[name] = {:type => type, :description => description, :seqNo => @metrics.length}\n case (type = opts[:type])\n when 'xsd:string' then\n cols[name] = {:type => 'TEXT'}\n when 'xsd:long', 'xsd:float' then\n if @single_sample_mode\n cols[name] = {:type => Xsd2SqlType[type]}\n else\n cols[\"#{name}_avg\"] = cols[\"#{name}_min\"] = cols[\"#{name}_max\"] = {:type => 'REAL'}\n end\n else\n error \"Type '#{opts[:type]}' for '#{name}' not implemented\"\n end\n \t end\n \t end\n cols\n \tend",
"def columns_for_search\n self.entity_columns.select(\"name, ref_type, ref_name, col_type\")\n end",
"def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n []\n end\n end",
"def columns \n @c\n end",
"def columns\n @columns || 150\n end",
"def columns\n @columns ||= [].tap do |fields|\n @model.columns.reject { |a| a.name.match(/_id$/) }.each do |column|\n fields << resolve(column.type, column.name)\n end\n end\n end",
"def columns\n @columns ||= @stats.values.flatten.map { |a| a.column_name }\n end",
"def cols\n @cols\n end",
"def index\n @project_datum_columns = ProjectDatumColumn.all\n end",
"def cols\r\n if !@cols\r\n require \"#{File.dirname(__FILE__)}/drivers/#{@opts[:type]}/knjdb_#{@opts[:type]}_columns\" if (!@opts.key?(:require) or @opts[:require])\r\n @cols = Kernel.const_get(\"KnjDB_#{@opts[:type]}\".to_sym).const_get(:Columns).new(\r\n :db => self\r\n )\r\n end\r\n \r\n return @cols\r\n end",
"def columns\n return @columns\n end",
"def index\n set_url_params\n \n p \"***********************\"\n p @sCols\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render :json => InstitutionsDatatable.new(view_context,eval(@sCols),@sFilter)}\n end\n end",
"def columns_with_redhillonrails_core\n unless @columns\n columns_without_redhillonrails_core\n cols = columns_hash\n indexes.each do |index|\n next if index.columns.blank?\n column_name = index.columns.reverse.detect { |name| name !~ /_id$/ } || index.columns.last\n column = cols[column_name]\n column.case_sensitive = index.case_sensitive?\n column.unique_scope = index.columns.reject { |name| name == column_name } if index.unique\n end\n end\n @columns\n end",
"def get_schema\n schema = CLIENT_TABLES.map {|t| {:name => t.table_name, :columns => table_schema(t)} }\n \n# respond_to do |format|\n# format.js { render({:content_type => :js, :text => schema.to_json}) }\n# end\n \n render_json schema.to_json\n end",
"def get_columns(key, columns, opt = {})\n do_op(:get_columns, column_family, key, columns, sub_columns = nil, opt)\n end",
"def get_columns(key, columns, opt = {})\n do_op(:get_columns, column_family, key, columns, sub_columns = nil, opt)\n end",
"def columns_for(table)\n db_connection.select_values(\"show columns from `#{ table }`\")\n end",
"def upload_file_columns_for_record\n @table_columns = {columns: []}\n table_name = params[:table_name] \n uploaded_schema = DataUploader.get_uploaded_schema(table_name)\n if uploaded_schema.size > 0\n disabled_column = get_user_table_column_info(table_name)\n uploaded_schema.each do |schema|\n if !((disabled_column.collect{|val| (val[:is_disable] == true ? val[:column_name] : '') }).include?schema[:Field]) then \n @table_columns[:columns].append({title: schema[:Field], data: schema[:Field]})\n end\n end \n respond_to do |format| \n format.html \n format.js \n format.json { render :json => @table_columns}\n end\n else\n redirect_to uploadedfile_datauploaders_path, :flash => { :error => \"Table schema does not exists\" }\n end\n end",
"def retrieve_name_columns\n fetch_columns.grep /name/\n end",
"def get_visible_columns\n return @visible_columns_cache unless @visible_columns_cache.nil?\n if get_cookie('columns').nil? or @reload\n visible = ''\n @columns.each do |c|\n next if c.hidden?\n c.visible = true\n visible << c.id.to_s << (c != @columns.last ? ', ' : '')\n end\n set_cookie('columns', visible)\n end\n colstr = get_cookie('columns')\n ret = Array.new\n col_s = colstr.split(/,\\s/)\n col_s.each do |c|\n t = col_by_id c\n next if t.blank?\n t.visible = true\n ret << t\n end\n @visible_columns_cache = ret\n return ret\n end",
"def columns; self.class.columns; end",
"def get_columns_changeable\n if columns_changeable\n return JSON.parse columns_changeable\n else\n return []\n end\n end",
"def get_projects_columns(project_id)\n unless organization.nil?\n client.project_columns(project_id)\n end\n end",
"def get_view_columns\n if @_view_columns.nil?\n set_default_view_columns\n end\n @_view_columns\n end",
"def get_elevator_by_column\n @elevator = Elevator.where(column_id: params[:column_id])\n respond_to do |format| \n format.json { render :json => @elevator }\n end\n \n end",
"def columns\n self.class.const_get(:COLUMNS) rescue []\n end",
"def columns\n @columns ||= connection.columns(table_name, \"#{name} Columns\")\n end",
"def columns\n @columns || self.class.columns\n end",
"def show\n @col = Col.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @col }\n end\n end",
"def columns()\n return @columns.keys\n end",
"def columns\n\t\t\t@columns ||= Txtboard::Column.columns.sort_by(&:order)\n\t\tend",
"def show\n @page = Page.find(params[:id])\n @columns = @page.columns.order(\"position ASC\")\n respond_with(@page)\n end",
"def user_columns\n case current_user.role\n # Admin\n when 0\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"mee_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"semester\", \"true\"]]\n # Academic\n when 2\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"level\", \"true\"],[\"mee_lead\", \"true\"],[\"uni_module\", \"true\"],[\"module_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"programmes\", \"true\"],[\"semester\", \"true\"]]\n # Technician\n when 1\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"last_risk_assessment\", \"true\"],[\"mee_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"semester\", \"true\"],[\"technician\", \"true\"]]\n end\n end",
"def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end",
"def columns\n return @columns if @columns\n return nil if frozen?\n set_columns(dataset.naked.columns)\n end",
"def columns_visible_sql\n if columns_visible.blank?\n ' * '\n else\n JSON.parse(columns_visible).join(', ')\n end\n end",
"def content_columns\n @content_columns ||= columns.reject{|c| c.primary || \"id\"}\n end",
"def columns\n must_be_open!\n return @columns.map(&:first)\n end",
"def column_styles\n # [\n # {:name => 'general', :column => 0},\n # {:name => 'general', :column => 1},\n # {:name => 'general', :column => 2}\n #]\n []\n end"
] |
[
"0.74958885",
"0.747322",
"0.7299896",
"0.67781854",
"0.67499894",
"0.67048776",
"0.669268",
"0.6685288",
"0.66462684",
"0.66328055",
"0.65902466",
"0.65392166",
"0.65128845",
"0.648967",
"0.6461512",
"0.64131254",
"0.64119905",
"0.64119905",
"0.6403832",
"0.6396787",
"0.63866484",
"0.63475585",
"0.63475585",
"0.631474",
"0.6303005",
"0.62872493",
"0.62650263",
"0.6254954",
"0.62544274",
"0.62518996",
"0.6246566",
"0.6205552",
"0.61930645",
"0.6188298",
"0.61734444",
"0.6172425",
"0.6157915",
"0.61250263",
"0.61066747",
"0.61066747",
"0.60748106",
"0.6042817",
"0.6042509",
"0.6041935",
"0.60303116",
"0.60297513",
"0.6029376",
"0.602639",
"0.6013275",
"0.60042983",
"0.60017556",
"0.5990077",
"0.59539217",
"0.5950223",
"0.59235364",
"0.5920312",
"0.591999",
"0.59199035",
"0.5919699",
"0.5912445",
"0.59124064",
"0.5895386",
"0.5890335",
"0.5863029",
"0.58616346",
"0.5860786",
"0.5849095",
"0.58241075",
"0.5810445",
"0.5806635",
"0.5805974",
"0.5799256",
"0.57831997",
"0.5738115",
"0.57378244",
"0.5735485",
"0.5735485",
"0.57259166",
"0.5708501",
"0.5699246",
"0.56986594",
"0.5696585",
"0.5681456",
"0.56813884",
"0.5672867",
"0.56725764",
"0.5663923",
"0.5654196",
"0.56537944",
"0.56421286",
"0.5639888",
"0.56338185",
"0.56323785",
"0.5627627",
"0.5622824",
"0.5622824",
"0.5622626",
"0.5621333",
"0.56108344",
"0.5589572"
] |
0.5702205
|
79
|
GET /site/columns/1 GET /site/columns/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_column\n if params[:battery].present?\n @columns = Battery.find(params[:battery]).columns\n else\n @columns = Battery.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {columns: @columns}\n }\n end\n end\n end",
"def get_columns\n battery_id = params[:battery_id]\n columns = Column.where(battery_id: battery_id)\n render json: columns\n end",
"def getcolumns\n puts params\n colid = params[\"batteryid\"]\n\n columns = Column.where(:battery_id => colid)\n\n puts columns.inspect\n \n @x = columns\n respond_to do |format|\n format.json { render json: columns }\n end\n end",
"def column_select\n p params[\"battery_id\"]\n @columns = Column.where(battery_id: params[\"battery_id\"])\n respond_to do |format |\n format.json {\n render json: {\n columns: @columns\n }\n }\n end\n end",
"def column\n if params[:battery].present?\n @column = Column.where(battery_id:params[:battery]) \n else\n @column = Column.all\n end\n\n respond_to do |format|\n format.json {\n render json: {column: @column}\n \n }\n end\n end",
"def column\n @equipment = Equipment.pluck(request.params[:column])\n\n respond_to do |format|\n format.json { render json: @equipment }\n end\n end",
"def index\n @columns = Column.all.page(params[:page])\n end",
"def get_column_by_batterie\n @column = Column.where(battery_id: params[:batterie_id])\n puts @column\n respond_to do |format| \n format.json { render :json => @column }\n end\n \n \n end",
"def columns\n return [{:id=>\"one\", :display =>'One', :searchable=>false}, {:id=>'two', :display => 'three'}]\n end",
"def get_columns!( *headers )\n data.get_columns!( *headers ); self\n end",
"def columns; @columns; end",
"def index\n @columns = Column.find(:all, :order => _(:title, :column))\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @columns.to_xml }\n end\n end",
"def column_name\n return 'json_scrape' if invalid_param('column_name')\n\n @params['column_name']\n end",
"def index\n @item_columns = ItemColumn.all\n end",
"def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end",
"def columns\n @columns\n end",
"def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end",
"def list_entries_for_column(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns/{id}/data\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|ColumnDatum.new(response)}\n end",
"def index\n tasks = Task.all\n render json: tasks, include: [:user, :column], except: [:user_id, :column_id]\n end",
"def show\n @col = Col.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @col }\n end\n end",
"def columns; end",
"def index\n @row_columns = RowColumn.all\n end",
"def columns()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Columns::ColumnsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def columns\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def columns; @columns_hash.values; end",
"def get_elevator_by_column\n @elevator = Elevator.where(column_id: params[:column_id])\n respond_to do |format| \n format.json { render :json => @elevator }\n end\n \n end",
"def column_fields(json=true)\n data = @data.map do |data|\n data = data.dup\n editor = parse_column_editor(data.delete(\"editor\"))\n renderer = parse_column_renderer(data.delete(\"renderer\"))\n data.merge!(editor) if editor\n data.merge!(renderer) if renderer\n data.delete(\"method\")\n data.delete(\"mapping\")\n data\n end\n json ? JSON.pretty_generate(data) : data\n end",
"def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }\n # end\n end",
"def get_column_entries(column)\n jso = Hash.new() \n jss = self.get_structure()\n db_column = nil\n # Is the column recognized?\n if jss.has_key? column then\n db_column = jss[column].split(\"/\")[1]\n else\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n \n # Connect to database\n dbe = MIDB::API::Dbengine.new(@engine.config, @db)\n dblink = dbe.connect()\n rows = dbe.query(dblink, \"SELECT * FROM #{self.get_structure.values[0].split('/')[0]};\")\n if rows == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n # Iterate over all rows of this table\n rows.each do |row|\n\n name = column\n dbi = jss[name]\n table = dbi.split(\"/\")[0]\n field = dbi.split(\"/\")[1]\n # Must-match relations (\"table2/field/table2-field->row-field\")\n if dbi.split(\"/\").length > 2\n match = dbi.split(\"/\")[2]\n matching_field = match.split(\"->\")[0]\n row_field = match.split(\"->\")[1]\n query = dbe.query(dblink, \"SELECT #{field} FROM #{table} WHERE #{matching_field}=#{row[row_field]};\")\n else\n query = dbe.query(dblink, \"SELECT #{field} from #{table} WHERE id=#{row['id']};\")\n end\n if query == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n jso[row[\"id\"]] = {}\n jso[row[\"id\"]][name] = dbe.length(query) > 0 ? dbe.extract(query,field) : \"unknown\"\n jso[row[\"id\"]][name] = @hooks.format_field(name, jso[row[\"id\"]][name])\n end\n @hooks.after_get_all_entries(dbe.length(rows))\n return jso\n end",
"def _columns\n cache_get(:_columns)\n end",
"def feature_columns\n ensure_full_data!\n Array(@gapi_json[:featureColumns]).map do |field_gapi_json|\n field_gapi = Google::Apis::BigqueryV2::StandardSqlField.from_json field_gapi_json.to_json\n StandardSql::Field.from_gapi field_gapi\n end\n end",
"def show\n @onecolumnmodel = Onecolumnmodel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onecolumnmodel }\n end\n end",
"def columns\n _columns || columns!\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def index\n @app_model_columns = AppModelColumn.all\n end",
"def get_columns\n return @columns\n end",
"def index\n set_url_params\n \n p \"***********************\"\n p @sCols\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render :json => InstitutionsDatatable.new(view_context,eval(@sCols),@sFilter)}\n end\n end",
"def columns\n @columns = columns_hash.values\n end",
"def columns!\n ds = clone(opts.merge(:sql => \"SELECT TOP 1 [T1].* FROM (#{opts[:sql]}) \\\"T1\\\"\"))\n ds.each{break}\n\n if cols = ds.cache[:_columns]\n self.columns = cols\n else\n []\n end\n end",
"def columns\n @columns ||= []\n end",
"def columns\n @columns ||= ControllerAction.columns.map(&:name).map(&:to_sym).reject{|c|c==:id}\n end",
"def query_columns\n explicit_columns\n end",
"def elevator_select\n p params[\"column_id\"]\n @elevators = Elevator.where(column_id: params[\"column_id\"])\n respond_to do |format |\n format.json {\n render json: {\n elevators: @elevators\n }\n }\n end\n end",
"def show\n @page = Page.find(params[:id])\n @columns = @page.columns.order(\"position ASC\")\n respond_with(@page)\n end",
"def get_schema\n schema = CLIENT_TABLES.map {|t| {:name => t.table_name, :columns => table_schema(t)} }\n \n# respond_to do |format|\n# format.js { render({:content_type => :js, :text => schema.to_json}) }\n# end\n \n render_json schema.to_json\n end",
"def columns\n @columns ||= [];\n end",
"def columns\n @columns\n end",
"def columns\n ColumnCollection.new(@data)\n end",
"def index\n @columns = Column.includes(:tasks).where(board: @board)\n end",
"def columns!\n @columns = nil\n columns\n end",
"def list_custom_gradebook_columns(course_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns\",\n :course_id => course_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|CustomColumn.new(response)}\n end",
"def upload_file_columns_for_record\n @table_columns = {columns: []}\n table_name = params[:table_name] \n uploaded_schema = DataUploader.get_uploaded_schema(table_name)\n if uploaded_schema.size > 0\n disabled_column = get_user_table_column_info(table_name)\n uploaded_schema.each do |schema|\n if !((disabled_column.collect{|val| (val[:is_disable] == true ? val[:column_name] : '') }).include?schema[:Field]) then \n @table_columns[:columns].append({title: schema[:Field], data: schema[:Field]})\n end\n end \n respond_to do |format| \n format.html \n format.js \n format.json { render :json => @table_columns}\n end\n else\n redirect_to uploadedfile_datauploaders_path, :flash => { :error => \"Table schema does not exists\" }\n end\n end",
"def columns\n @columns_hash.values\n end",
"def index\n @project_datum_columns = ProjectDatumColumn.all\n end",
"def columns\n single_record unless @columns\n @columns || []\n end",
"def export_columns\n self.entity_columns.select(\"name, description, ref_type, ref_name, col_type\").where(\"list_rank > 0 and name not in ('domain_id', 'creator_id', 'updater_id', 'created_at', 'updated_at')\").order(\"list_rank asc\")\n end",
"def columns\n 1\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def get_projects_columns(project_id)\n unless organization.nil?\n client.project_columns(project_id)\n end\n end",
"def columns \n []\n end",
"def columns\n select.inject([]) do |columns, column|\n columns << {\n :type => all_columns[column][:type]\n }.merge({\n :id => column.to_s,\n :label => column_label(column)\n })\n end\n end",
"def columns()\n cols = {}\n prefix = \"#{@opts[:pname]}_\"\n fspec = @opts[:fspec]\n\n fspec.params.each do |name, opts|\n cols[prefix + name] = opts\n end\n cols \n end",
"def columns\n raise NotImplementedError\n end",
"def columns\n get_metadata unless @columns\n return @columns\n end",
"def index\n @recommend_other_columns = Recommend::OtherColumn.paginate(:page => params[:page])\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_other_columns_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recommend_other_columns }\n end\n end",
"def columns\n self.class.instance_variable_get(:@columns)\n end",
"def get_columns_changeable\n if columns_changeable\n return JSON.parse columns_changeable\n else\n return []\n end\n end",
"def show_column\n @dataset = Dataset.find(params[:dataset_id])\n @variable = Variable.find(params[:variable_id])\n @data = ActiveRecord::Base.connection.select_all(\"SELECT var#{@dataset.identifierccode1_var} as ccode, var#{@dataset.identifieryear_var} as year, var#{@variable.var_id} as data from dataset_#{@dataset.id} ORDER BY var#{@dataset.identifierccode1_var} , var#{@dataset.identifieryear_var} \")\n @pays = ActiveRecord::Base.connection.select_values(\"SELECT var#{@dataset.identifierccode1_var} as ccode from dataset_#{@dataset.id} group by var#{@dataset.identifierccode1_var} ORDER BY var#{@dataset.identifierccode1_var} ASC\")\n @annees = ActiveRecord::Base.connection.select_values(\"SELECT var#{@dataset.identifieryear_var} as annee from dataset_#{@dataset.id} group by var#{@dataset.identifieryear_var} ORDER BY var#{@dataset.identifieryear_var} ASC\")\n @tableau = Array.new\n for annee in @annees\n @tableau[annee.to_i] = Hash.new()\n @pays.each do |pays|\n @tableau[annee.to_i][pays.to_i] = \"#\"\n end\n end\n \n for ligne in @data # pour chaque ligne (annee-pays) du tableau de donnees\n @tableau[ligne['year'].to_i][ligne['ccode'].to_i] = case when ligne['data'] == nil then nil else ligne['data'].to_f end\n end\n render :inline => @tableau[1870..2003].to_json + @annees.to_json\n end",
"def show\n @unsigned_columns_test = UnsignedColumnsTest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unsigned_columns_test }\n end\n end",
"def retrieve_name_columns\n fetch_columns.grep /name/\n end",
"def list_columns\n columns\n end",
"def columns_for_search\n self.entity_columns.select(\"name, ref_type, ref_name, col_type\")\n end",
"def get_columns(key, columns, opt = {})\n do_op(:get_columns, column_family, key, columns, sub_columns = nil, opt)\n end",
"def get_columns(key, columns, opt = {})\n do_op(:get_columns, column_family, key, columns, sub_columns = nil, opt)\n end",
"def index\n @alumnos = Alumno.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @alumnos }\n end\n end",
"def index\n @site = Cms::Site.all.take\n @cms_columns = @site.columns.where(\"parent_column_id is NULL\").order(\"the_order ASC\") # Cms::Column.find_by_cms_id(@site.id)\n end",
"def columns_with_redhillonrails_core\n unless @columns\n columns_without_redhillonrails_core\n cols = columns_hash\n indexes.each do |index|\n next if index.columns.blank?\n column_name = index.columns.reverse.detect { |name| name !~ /_id$/ } || index.columns.last\n column = cols[column_name]\n column.case_sensitive = index.case_sensitive?\n column.unique_scope = index.columns.reject { |name| name == column_name } if index.unique\n end\n end\n @columns\n end",
"def columns\n @columns || 150\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: DataTable::Nodes.new(view_context) }\n end\n end",
"def columns()\n \t cols = {}\n cols['oml_sender_id'] = {:type => 'INTEGER'}\n cols['oml_seq'] = {:type => 'INTEGER'}\n cols['oml_ts_client'] = {:type => 'REAL'}\n cols['oml_ts_server'] = {:type => 'REAL'}\n \t if @filters.size > 0\n \t @filters.each do |f|\n cols.merge!(f.columns)\n \t end\n \t else\n #appDef = AppDefinition[@application.to_s]\n appDef = @application.appDefinition\n appDef.measurements[@mdef].metrics.each do |name, opts|\n #[name] = {:type => type, :description => description, :seqNo => @metrics.length}\n case (type = opts[:type])\n when 'xsd:string' then\n cols[name] = {:type => 'TEXT'}\n when 'xsd:long', 'xsd:float' then\n if @single_sample_mode\n cols[name] = {:type => Xsd2SqlType[type]}\n else\n cols[\"#{name}_avg\"] = cols[\"#{name}_min\"] = cols[\"#{name}_max\"] = {:type => 'REAL'}\n end\n else\n error \"Type '#{opts[:type]}' for '#{name}' not implemented\"\n end\n \t end\n \t end\n cols\n \tend",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def column; end",
"def get_column(col_title)\n id_gmail = ENV['GMAIL_ID']\n mdp_gmail = ENV['GMAIL_MDP']\n session = GoogleDrive::Session.from_config(\"config.json\")\n ws = session.spreadsheet_by_key(\"1N7--OE8i6xGaAO2AA8cxe9Ry1xm2GSdGULdlyJL7-iE\").worksheets[0]\n gmail = Gmail.connect!(id_gmail, mdp_gmail)\n i = 0\n column = Array.new\n while i < ws.num_rows do\n column.push(ws.list[i][col_title])\n i += 1\n end\n column\nend",
"def show\n @column = Column.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @column }\n end\n end",
"def cols\r\n if !@cols\r\n require \"#{File.dirname(__FILE__)}/drivers/#{@opts[:type]}/knjdb_#{@opts[:type]}_columns\" if (!@opts.key?(:require) or @opts[:require])\r\n @cols = Kernel.const_get(\"KnjDB_#{@opts[:type]}\".to_sym).const_get(:Columns).new(\r\n :db => self\r\n )\r\n end\r\n \r\n return @cols\r\n end",
"def index\n respond_to do |format|\n format.html do\n @recent_objects = ObservationMatrixColumnItem.recent_from_project_id(sessions_current_project_id)\n .order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n end\n format.json {\n @observation_matrix_column_items = ObservationMatrixColumnItem.where(filter_params).with_project_id(sessions_current_project_id)\n }\n end\n end",
"def expected_columns; end",
"def columns \n @c\n end",
"def columns; self.class.columns; end",
"def column_params\n params.fetch(:column, {}).permit(:title)\n end",
"def index\n @alumnos = Alumno.all\n respond_with @alumnos\n end",
"def columns\n @columns ||= [].tap do |fields|\n @model.columns.reject { |a| a.name.match(/_id$/) }.each do |column|\n fields << resolve(column.type, column.name)\n end\n end\n end"
] |
[
"0.7540389",
"0.73204565",
"0.72503585",
"0.7025096",
"0.7002443",
"0.67390466",
"0.6621653",
"0.6468809",
"0.6367124",
"0.63464093",
"0.63194823",
"0.6307809",
"0.628574",
"0.62791276",
"0.6193161",
"0.6181916",
"0.6162941",
"0.6159068",
"0.6115821",
"0.60821575",
"0.6066124",
"0.60602194",
"0.6045911",
"0.6041988",
"0.6009828",
"0.6009828",
"0.6004218",
"0.5991498",
"0.5982679",
"0.59621745",
"0.59360206",
"0.5881797",
"0.58606786",
"0.58539885",
"0.58407223",
"0.58363783",
"0.58363783",
"0.58317286",
"0.5803997",
"0.578428",
"0.577363",
"0.57678723",
"0.57573897",
"0.575356",
"0.57286566",
"0.57267106",
"0.5724673",
"0.5716145",
"0.57124203",
"0.57112366",
"0.5708734",
"0.5705273",
"0.5673997",
"0.56630665",
"0.56603575",
"0.5656011",
"0.5640728",
"0.56244963",
"0.56203014",
"0.56185013",
"0.5606671",
"0.5606671",
"0.5603594",
"0.55952156",
"0.5591756",
"0.5585616",
"0.5571282",
"0.55710953",
"0.556511",
"0.55602884",
"0.55489564",
"0.55489075",
"0.55468947",
"0.5540902",
"0.5536464",
"0.55179864",
"0.54931736",
"0.54931736",
"0.54749227",
"0.5461035",
"0.54581267",
"0.54551953",
"0.54520464",
"0.5444625",
"0.5428926",
"0.5428926",
"0.5428926",
"0.5428926",
"0.5428926",
"0.5428926",
"0.5428926",
"0.5404617",
"0.5404047",
"0.5396713",
"0.538235",
"0.53806037",
"0.5377711",
"0.5372963",
"0.53695655",
"0.53692055",
"0.5365077"
] |
0.0
|
-1
|
POST /site/columns POST /site/columns.json
|
def create
@cms_column = Cms::Column.new(cms_column_params)
@site = Cms::Site.all.take
@cms_column.site = @site
respond_to do |format|
if @cms_column.save
@site.themes.each do |theme|
template = Cms::Template.new
template.theme = theme
template.column = @cms_column
template.function = @cms_column.function
template.content = @cms_column.function.content
template.save
end
#对应的功能有子功能则自动增加子栏目
if @cms_column.function.child_functions.size >0
@cms_column.function.child_functions.each do |child_function|
add_child_column(child_function,@cms_column)
end
end
format.html { redirect_to cms.columns_url, notice: '栏目已成功创建.' }
format.json { render action: 'show', status: :created, location: @cms_column }
else
format.html { render action: 'new' }
format.json { render json: @cms_column.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_columns(test)\n is_singular = test['columns'].length == 1\n column_or_columns = nil\n if is_singular\n column_or_columns = 'column'\n else\n column_or_columns = 'columns'\n end\n\n puts \" Creating #{test['columns'].length} #{column_or_columns}\"\n\n test['columns'].each do |column|\n append_timestamp_to_column_name(column)\n @client.create_column(column)\n\n if @verbose\n puts \" - #{column['api-name']}\"\n end\n end\n end",
"def column_fields(json=true)\n data = @data.map do |data|\n data = data.dup\n editor = parse_column_editor(data.delete(\"editor\"))\n renderer = parse_column_renderer(data.delete(\"renderer\"))\n data.merge!(editor) if editor\n data.merge!(renderer) if renderer\n data.delete(\"method\")\n data.delete(\"mapping\")\n data\n end\n json ? JSON.pretty_generate(data) : data\n end",
"def upload_file_columns_for_record\n @table_columns = {columns: []}\n table_name = params[:table_name] \n uploaded_schema = DataUploader.get_uploaded_schema(table_name)\n if uploaded_schema.size > 0\n disabled_column = get_user_table_column_info(table_name)\n uploaded_schema.each do |schema|\n if !((disabled_column.collect{|val| (val[:is_disable] == true ? val[:column_name] : '') }).include?schema[:Field]) then \n @table_columns[:columns].append({title: schema[:Field], data: schema[:Field]})\n end\n end \n respond_to do |format| \n format.html \n format.js \n format.json { render :json => @table_columns}\n end\n else\n redirect_to uploadedfile_datauploaders_path, :flash => { :error => \"Table schema does not exists\" }\n end\n end",
"def get_column\n if params[:battery].present?\n @columns = Battery.find(params[:battery]).columns\n else\n @columns = Battery.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {columns: @columns}\n }\n end\n end\n end",
"def column_params\n params.require(:column).permit(:name)\n end",
"def column\n @equipment = Equipment.pluck(request.params[:column])\n\n respond_to do |format|\n format.json { render json: @equipment }\n end\n end",
"def column_select\n p params[\"battery_id\"]\n @columns = Column.where(battery_id: params[\"battery_id\"])\n respond_to do |format |\n format.json {\n render json: {\n columns: @columns\n }\n }\n end\n end",
"def column_params\n params.fetch(:column, {}).permit(:title)\n end",
"def column_params\n params.fetch(:column, {}).permit(\n :span_xs, :span_sm, :alignment, :viewport, :pivot, :background_color,\n :gradient_color, :gradient_type, :gradient_direction, :gradient_balance\n )\n end",
"def get_columns\n battery_id = params[:battery_id]\n columns = Column.where(battery_id: battery_id)\n render json: columns\n end",
"def columns; end",
"def columns; @columns; end",
"def getcolumns\n puts params\n colid = params[\"batteryid\"]\n\n columns = Column.where(:battery_id => colid)\n\n puts columns.inspect\n \n @x = columns\n respond_to do |format|\n format.json { render json: columns }\n end\n end",
"def column_params\n params.require(:column).permit(:name, :title, :position)\n end",
"def column_params\n params.require(:column).permit(:label, :value, :id, :created_at, :updated_at)\n end",
"def create_column_data\n\tcolumn_hash = {}\n\t\n\tcreate_column_data_array.map do |array|\n\tcolumn_hash = {title: array[0], table_id: array[1], \n\t\tcol_id: array[2]}\n\tend\nend",
"def column\n if params[:battery].present?\n @column = Column.where(battery_id:params[:battery]) \n else\n @column = Column.all\n end\n\n respond_to do |format|\n format.json {\n render json: {column: @column}\n \n }\n end\n end",
"def feature_columns\n ensure_full_data!\n Array(@gapi_json[:featureColumns]).map do |field_gapi_json|\n field_gapi = Google::Apis::BigqueryV2::StandardSqlField.from_json field_gapi_json.to_json\n StandardSql::Field.from_gapi field_gapi\n end\n end",
"def columns\n end",
"def columns=(value)\n @columns = value\n end",
"def columns\n ColumnCollection.new(@data)\n end",
"def column_params\n params.require(:column).permit(:name, :ident)\n end",
"def columns\n select.inject([]) do |columns, column|\n columns << {\n :type => all_columns[column][:type]\n }.merge({\n :id => column.to_s,\n :label => column_label(column)\n })\n end\n end",
"def columns\n @columns ||= [];\n end",
"def create\n @item_column = ItemColumn.new(item_column_params)\n\n respond_to do |format|\n if @item_column.save\n format.html { redirect_to @item_column, notice: 'Item column was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_column }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def columns\n @columns = columns_hash.values\n end",
"def columns; @columns_hash.values; end",
"def column_name\n return 'json_scrape' if invalid_param('column_name')\n\n @params['column_name']\n end",
"def columns()\n cols = {}\n prefix = \"#{@opts[:pname]}_\"\n fspec = @opts[:fspec]\n\n fspec.params.each do |name, opts|\n cols[prefix + name] = opts\n end\n cols \n end",
"def columns\n @columns ||= []\n end",
"def export_columns\n self.entity_columns.select(\"name, description, ref_type, ref_name, col_type\").where(\"list_rank > 0 and name not in ('domain_id', 'creator_id', 'updater_id', 'created_at', 'updated_at')\").order(\"list_rank asc\")\n end",
"def createJsColumnModel\n @columns = ActiveRecord::Base.connection.select_all 'show columns from `'+@table_name+'`'\n @columns.each do |column_info|\n case column_info['Type']\n #string\n when /varchar/,/char/\n type = column_info['Type']\n len = type[type.index('(')+1...type.index(')')].to_i\n column_info['Type'] = 'string'\n \n if len < 100\n column_info['editor'] = {:xtype => 'textfield'} \n else\n column_info['editor'] = {\n :xtype => 'textarea',\n :minHeight => 100\n } \n end\n #int\n when /int/,/binary/,/decimal/,/numeric/,/bit/,/timestamp/\n column_info['Type'] = 'int'\n column_info['editor'] = {\n :xtype => 'numberfield'\n }\n #real\n when /float/,/double/\n column_info['Type'] = 'float'\n column_info['editor'] = {:xtype => 'numberfield'}\n #enumeric\n when /enum/,/set/\n values = column_info['Type']\n values = values[values.index('(')+1...values.index(')')].split(',').map do |v|\n {:p => (v[0] == \"'\" && v[v.length-1] == \"'\") ? v[1...-1] : v}\n end\n \n column_info['editor'] = {\n :xtype => 'combo',\n :triggerAction => 'all',\n :forceSelection => true,\n :store => {\n :xtype => 'jsonstore',\n :fields => ['p'],\n :data => values\n },\n :mode => 'local',\n :valueField => 'p',\n :displayField => 'p'\n }\n column_info['Type'] = 'string'\n #date\n when /date/i,/time/i,/year/i\n date_desc = self.date_desc column_info\n column_info['Type'] = date_desc[:type]\n column_info['editor'] = date_desc[:editor]\n #text\n when /text/i\n column_info['editor'] = {\n :xtype => 'textarea',\n :minHeight => 100\n }\n column_info['Type'] = 'string'\n else\n column_info['Type'] = 'string'\n column_info['editor'] = {\n :xtype => 'textarea',\n :minHeight => 100\n }\n end\n end\n end",
"def create\n @column = Column.new(params[:column])\n\n respond_to do |format|\n if @column.save\n flash[:notice] = 'Column was successfully created.'\n format.html { redirect_to columns_url }\n format.xml { head :created, :location => columns_url }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @column.errors.to_xml }\n end\n end\n end",
"def create\n @app_model_column = AppModelColumn.new(app_model_column_params)\n\n respond_to do |format|\n if @app_model_column.save\n format.html { redirect_to @app_model_column, notice: 'App model column was successfully created.' }\n format.json { render :show, status: :created, location: @app_model_column }\n else\n format.html { render :new }\n format.json { render json: @app_model_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @column = Column.new(column_params)\n @column.board = @board\n\n if @column.save\n BoardChannel.broadcast_to(@board, {action: 'newColumn', column: @column})\n render :show, status: :created\n else\n render json: @column.errors, status: :unprocessable_entity\n end\n end",
"def columns\n @columns\n end",
"def index\n @item_columns = ItemColumn.all\n end",
"def create\n @connection_table_column = ConnectionTableColumn.new(connection_table_column_params)\n\n respond_to do |format|\n if @connection_table_column.save\n format.html { redirect_to @connection_table_column, notice: 'Connection table column was successfully created.' }\n format.json { render action: 'show', status: :created, location: @connection_table_column }\n else\n format.html { render action: 'new' }\n format.json { render json: @connection_table_column.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def modify_columns(columns)\n columns\n end",
"def after_columns_created\n end",
"def columns()\n \t cols = {}\n cols['oml_sender_id'] = {:type => 'INTEGER'}\n cols['oml_seq'] = {:type => 'INTEGER'}\n cols['oml_ts_client'] = {:type => 'REAL'}\n cols['oml_ts_server'] = {:type => 'REAL'}\n \t if @filters.size > 0\n \t @filters.each do |f|\n cols.merge!(f.columns)\n \t end\n \t else\n #appDef = AppDefinition[@application.to_s]\n appDef = @application.appDefinition\n appDef.measurements[@mdef].metrics.each do |name, opts|\n #[name] = {:type => type, :description => description, :seqNo => @metrics.length}\n case (type = opts[:type])\n when 'xsd:string' then\n cols[name] = {:type => 'TEXT'}\n when 'xsd:long', 'xsd:float' then\n if @single_sample_mode\n cols[name] = {:type => Xsd2SqlType[type]}\n else\n cols[\"#{name}_avg\"] = cols[\"#{name}_min\"] = cols[\"#{name}_max\"] = {:type => 'REAL'}\n end\n else\n error \"Type '#{opts[:type]}' for '#{name}' not implemented\"\n end\n \t end\n \t end\n cols\n \tend",
"def data\n datacolumns.reduce({}) do |t, col|\n t[col.name] = col.data; t\n end\n end",
"def columns!\n @columns = nil\n columns\n end",
"def index\n @row_columns = RowColumn.all\n end",
"def tm_table_column_params\n params.require(:tm_table_column).permit(:column_number, :column_name, :column_name_jp, :column_type, :column_size, :column_null, :column_default, :column_p_key, :column_f_key, :note, :tm_table_id)\n end",
"def collate\n @metrics.all.each do |request|\n row = {}\n metric = request[:body]\n metric.each do |key, value|\n @columns.add key\n row[key] = value\n end\n @rows << row\n end\n end",
"def columns()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Columns::ColumnsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def columns\n return [{:id=>\"one\", :display =>'One', :searchable=>false}, {:id=>'two', :display => 'three'}]\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def columns\n @columns ||= dataset.columns\n end",
"def expected_columns; end",
"def index\n @columns = Column.all.page(params[:page])\n end",
"def add_row(table_name, column_values)\n options = {\n :query => {\n 'ZOHO_ACTION' => 'ADDROW',\n },\n :body => column_values\n }\n\n send_request get_uri(table_name), 'post', options\n end",
"def label_columns\n ensure_full_data!\n Array(@gapi_json[:labelColumns]).map do |field_gapi_json|\n field_gapi = Google::Apis::BigqueryV2::StandardSqlField.from_json field_gapi_json.to_json\n StandardSql::Field.from_gapi field_gapi\n end\n end",
"def create_column_list\n for columnID in 1..Battery.num_columns do\n column = Column.new(columnID)\n column.create_elevator_list()\n column.create_call_buttons()\n\n @column_list.append(column)\n end\n end",
"def item_column_params\n params.require(:item_column).permit(:table_id, :item_id, :column_id, :value)\n end",
"def column_list_params\n params.require(:column_list).permit(:name, :type)\n end",
"def set_columns_visible(value)\n self.write_attribute :columns_visible, value.to_json\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def columns \n []\n end",
"def columns\n @columns ||= ControllerAction.columns.map(&:name).map(&:to_sym).reject{|c|c==:id}\n end",
"def create\n @tm_table_column = TmTableColumn.new(tm_table_column_params)\n\n respond_to do |format|\n if @tm_table_column.save\n format.html { redirect_to @tm_table_column, notice: 'Tm table column was successfully created.' }\n format.json { render :show, status: :created, location: @tm_table_column }\n else\n format.html { render :new }\n format.json { render json: @tm_table_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n set_url_params\n \n p \"***********************\"\n p @sCols\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render :json => InstitutionsDatatable.new(view_context,eval(@sCols),@sFilter)}\n end\n end",
"def data_for_update_columns\n {}\n end",
"def save_columns!\n # NetzkeFieldList.update_list_for_current_authority(global_id, columns(false), original_data_class.name) if persistent_config_enabled?\n end",
"def wire_jqgrid_columns\n omit_options = [:custom, :action, :object, :field]\n (@columns.map {|c| jqgrid_make_js(c.dup.delete_if{|k,v| omit_options.include?(k)})}).join(',')\n end",
"def columns\n @columns_hash.values\n end",
"def columns\n @columns ||= [].tap do |fields|\n @model.columns.reject { |a| a.name.match(/_id$/) }.each do |column|\n fields << resolve(column.type, column.name)\n end\n end\n end",
"def create\n #I create and add the column params from the existing params so that the columns are created as nested attributes\n cols = CodeScheme.find(params[:question_grid][:horizontal_codelist_id]).codes\n carray = []\n cols.each do |col|\n c = Hash.new\n \tc[:code_id] = col.id\n \tcarray.push(c)\n end\n params[:question_grid][:columns_attributes] = carray\n #render :text => params.inspect\n\n @question_grid = QuestionGrid.new(params[:question_grid])\n\n respond_to do |format|\n if @question_grid.save\n format.html { redirect_to(@question_grid, :notice => 'Question grid was successfully created.') }\n format.xml { render :xml => @question_grid, :status => :created, :location => @question_grid }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @question_grid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def columns\n @columns\n end",
"def columns\n @columns\n end",
"def create\n @column_sample = ColumnSample.new(column_sample_params)\n\n respond_to do |format|\n if @column_sample.save\n format.html { redirect_to @column_sample, notice: 'Column sample was successfully created.' }\n format.json { render action: 'show', status: :created, location: @column_sample }\n else\n format.html { render action: 'new' }\n format.json { render json: @column_sample.errors, status: :unprocessable_entity }\n end\n end\n end",
"def columns=(value)\n return if @columns == value\n @columns = value\n refresh\n end",
"def column_attrs\n attrs = {}\n\n attrs[\"SRID\"] = \"respondable.is_a?(ServiceRequest) ? respondable.id : respondable.try(:display_id)\"\n attrs[\"User ID\"] = :identity_id\n attrs[\"User Name\"] = \"identity.try(:full_name)\"\n attrs[\"User Email\"] = \"identity.try(:email)\"\n attrs[\"Submitted Date\"] = \"created_at.try(:strftime, \\\"%D\\\")\"\n\n if params[:system_survey_id]\n survey = Survey.find(params[:system_survey_id])\n survey.sections.each do |section|\n section.questions.each do |question|\n question.question_responses.each do |qr|\n attrs[ActionView::Base.full_sanitizer.sanitize(question.content)] = \"question_responses.any? ? question_responses.where(question_id: #{question.id}).first.try(:report_content) : 'No Response'\"\n end\n end\n end\n end\n\n attrs\n end",
"def initialize_columns\n @columns = []\n valid_table = table.alias('valid_taxon_names')\n\n @columns.push({ header: 'ro', projected: rank_over(table, valid_table) })\n\n @columns.push({header: 'taxon_name_id', projected: table[:id].as('taxon_name_id') } )\n @columns.push({header: 'cached_valid_taxon_name_id', projected: table[:cached_valid_taxon_name_id].as('cached_valid_taxon_name_id') } )\n @columns.push({header: 'cached', projected: table[:cached].as('cached') } )\n @columns.push({header: 'cached_author_year', projected: table[:cached_author_year].as('cached_author_year') } )\n @columns.push({header: 'cached_is_valid', projected: table[:cached_is_valid].as('cached_is_valid') } )\n\n if fieldsets.include?('observations')\n @columns.push({header: 'otu_id', projected: otu_table[:id].as('otu_id') } )\n @columns.push({header: 'otu_name', projected: otu_table[:name].as('otu_name')} )\n end\n end",
"def index\n @app_model_columns = AppModelColumn.all\n end",
"def columns\n _columns || columns!\n end",
"def columns\n @columns ||= 1.upto(@rowset.get_meta_data.get_column_count).map do |i|\n {\n :id => @rowset.get_meta_data.getColumnName(i),\n :name => @rowset.get_meta_data.getColumnLabel(i)\n }\n end\n end",
"def row_column_params\n params.require(:row_column).permit(\n :name,\n :container_row_id,\n :css_classes,:content_type,\n :content_id,\n :category_id,\n :image_group_id,\n :carousel_id,\n :list_group_id,\n :grid_columns,\n :grid_image_height,\n :grid_break_point,\n :placeholder_flag)\n end",
"def build_columns\n return unless configurable?\n return if @columns_opted == false\n selector(ORMUtils.properties(model), @columns_opted, @columns_ignored).each do |setup|\n setup << {summary: false} if setup.last == 'text'\n column *setup\n end\n end",
"def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end",
"def create\n @col = Col.new(params[:col])\n\n respond_to do |format|\n if @col.save\n format.html { render html: @col, layout: \"ajax\"}\n format.json { render json: @col, status: :created, location: @col }\n else\n format.html { render action: \"new\" }\n format.json { render json: @col.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @project_datum_columns = ProjectDatumColumn.all\n end",
"def create_custom_gradebook_column(course_id,column__title__,column__position__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :column__title__,\n :column__position__,\n :column__hidden__,\n :column__teacher_notes__,\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"column__title__ is required\" if column__title__.nil?\n raise \"column__position__ is required\" if column__position__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :column__title__ => column__title__,\n :column__position__ => column__position__\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns\",\n :course_id => course_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n CustomColumn.new(response)\n end",
"def columns\n 1\n end",
"def set_columns_visible(value)\n write_attribute :columns_visible, value.to_json\n end",
"def list_entries_for_column(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns/{id}/data\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|ColumnDatum.new(response)}\n end",
"def format_dynamic_column_cells(cells, column_name, context)\n cells\n end",
"def columna_params\n params.require(:columna).permit(:orden, :linea_id, :columna)\n end",
"def columns\n raise NotImplementedError\n end",
"def draw_columns\n @sections[:body][:fields].each do |field, settings|\n settings = [settings[0], @posY, (@defaults.merge (settings[1] || { }).symbolize_keys!)]\n settings[2][:style] = settings[2][:style].to_sym\n set_options settings[2]\n draw_line(@posY + @sections[:body][:settings][:height]/2)\n field = settings[2][:column] || field.to_s.split('_').inject('') do |str, part|\n str << part.camelize << \" \"\n end\n draw_text field, settings\n end\n draw_line(@posY - @sections[:body][:settings][:height]/2)\n set_pos_y @sections[:body][:settings][:height]\n end",
"def columns\n @columns ||= begin\n column_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end",
"def import_data\r\n # generate data column instances\r\n columnheaders_raw.each do |columnheader|\r\n\r\n data_column_information = initialize_data_column_information(columnheader)\r\n data_column_new = Datacolumn.create!(data_column_information)\r\n all_cells_for_one_column = data_for_columnheader(columnheader)[:data]\r\n datatype = Datatypehelper.find_by_name(data_column_information[:import_data_type])\r\n\r\n unless all_cells_for_one_column.blank?\r\n save_all_cells_to_database(data_column_new, datatype, all_cells_for_one_column)\r\n add_any_sheet_categories_included_for_this_column(columnheader, data_column_new)\r\n add_acknowledged_people(columnheader, data_column_new)\r\n end\r\n data_column_new.finished = true\r\n end\r\n end",
"def add_columns(*new_columns)\n options = Hash.new\n new_columns.each {|c| options[c] = true}\n @params[:add_columns] = FEATURE_DEFAULTS[:add_columns].merge(options)\n end",
"def dynamic_fields\n default_columns.collect do |c|\n {\n :name => c[:name],\n :type => c[:attr_type] == :json ? :text : c[:attr_type], # store :json columns as :text\n :default => c[:default_value]\n }\n end\n end",
"def get_column_entries(column)\n jso = Hash.new() \n jss = self.get_structure()\n db_column = nil\n # Is the column recognized?\n if jss.has_key? column then\n db_column = jss[column].split(\"/\")[1]\n else\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n \n # Connect to database\n dbe = MIDB::API::Dbengine.new(@engine.config, @db)\n dblink = dbe.connect()\n rows = dbe.query(dblink, \"SELECT * FROM #{self.get_structure.values[0].split('/')[0]};\")\n if rows == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n # Iterate over all rows of this table\n rows.each do |row|\n\n name = column\n dbi = jss[name]\n table = dbi.split(\"/\")[0]\n field = dbi.split(\"/\")[1]\n # Must-match relations (\"table2/field/table2-field->row-field\")\n if dbi.split(\"/\").length > 2\n match = dbi.split(\"/\")[2]\n matching_field = match.split(\"->\")[0]\n row_field = match.split(\"->\")[1]\n query = dbe.query(dblink, \"SELECT #{field} FROM #{table} WHERE #{matching_field}=#{row[row_field]};\")\n else\n query = dbe.query(dblink, \"SELECT #{field} from #{table} WHERE id=#{row['id']};\")\n end\n if query == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n jso[row[\"id\"]] = {}\n jso[row[\"id\"]][name] = dbe.length(query) > 0 ? dbe.extract(query,field) : \"unknown\"\n jso[row[\"id\"]][name] = @hooks.format_field(name, jso[row[\"id\"]][name])\n end\n @hooks.after_get_all_entries(dbe.length(rows))\n return jso\n end",
"def predefined_columns\n helper_module = \"Netzke::Helpers::#{short_widget_class_name}#{data_class.name}\".constantize rescue nil\n \n data_class_columns = data_class && data_class.column_names.map(&:to_sym) || []\n \n if helper_module\n exposed_attributes = helper_module.respond_to?(:exposed_attributes) ? normalize_array_of_columns(helper_module.exposed_attributes) : nil\n virtual_attributes = helper_module.respond_to?(:virtual_attributes) ? helper_module.virtual_attributes : []\n excluded_attributes = helper_module.respond_to?(:excluded_attributes) ? helper_module.excluded_attributes : []\n attributes_config = helper_module.respond_to?(:attributes_config) ? helper_module.attributes_config : {}\n \n res = exposed_attributes || data_class_columns + virtual_attributes\n \n res = normalize_columns(res)\n \n res.reject!{ |c| excluded_attributes.include? c[:name] }\n\n res.map!{ |c| c.merge!(attributes_config[c[:name]] || {})}\n else\n res = normalize_columns(data_class_columns)\n end\n \n res\n end",
"def cms_column_params\n params.require(:column).permit(:name, :path, :function_id, :is_top_menu, :is_bottom_menu,\n :has_menu,:parent_column_id,:the_order, :content, :is_enabled)\n end",
"def columns\n @columns || 150\n end"
] |
[
"0.64054364",
"0.6388201",
"0.6214513",
"0.61821026",
"0.6105319",
"0.608656",
"0.6026457",
"0.60060424",
"0.6003642",
"0.5994483",
"0.5967785",
"0.59384537",
"0.59157693",
"0.5905653",
"0.587835",
"0.58746094",
"0.5853674",
"0.58522874",
"0.5832496",
"0.583021",
"0.5808151",
"0.58028316",
"0.5794742",
"0.57151383",
"0.57135284",
"0.570565",
"0.5695978",
"0.5685496",
"0.56773865",
"0.56758046",
"0.56733054",
"0.5663402",
"0.5659398",
"0.5653392",
"0.56500435",
"0.5626674",
"0.5624877",
"0.5617619",
"0.56069857",
"0.556977",
"0.55676967",
"0.55612236",
"0.5560906",
"0.55559534",
"0.55413",
"0.5536514",
"0.5529537",
"0.55195516",
"0.5516144",
"0.5516144",
"0.551038",
"0.5479783",
"0.54710394",
"0.5467558",
"0.54667753",
"0.54429686",
"0.54213446",
"0.54016507",
"0.5399268",
"0.5399268",
"0.5398519",
"0.5385137",
"0.5377788",
"0.53756744",
"0.53756094",
"0.53616124",
"0.5361371",
"0.53566104",
"0.5356607",
"0.53549415",
"0.53501403",
"0.53501403",
"0.53472745",
"0.53393936",
"0.532816",
"0.5325272",
"0.5324525",
"0.53231645",
"0.532235",
"0.5321508",
"0.5321076",
"0.53152055",
"0.53128654",
"0.5307482",
"0.5297022",
"0.528973",
"0.52827674",
"0.52773017",
"0.52728724",
"0.52715135",
"0.52672267",
"0.526383",
"0.5255051",
"0.5254115",
"0.52477187",
"0.5226013",
"0.52113414",
"0.5209648",
"0.52030164",
"0.5199465"
] |
0.562577
|
36
|
PATCH/PUT /site/columns/1 PATCH/PUT /site/columns/1.json
|
def update
respond_to do |format|
if @cms_column.update(cms_column_params)
#子功能有增加,自动添加相关栏目、模板
if @cms_column.parent_column.nil? &&
@cms_column.function.child_functions.size > @cms_column.child_columns.size
@cms_column.function.child_functions.each do |child_function|
child_column = @cms_column.child_columns.find_by(function:child_function)
add_child_column(child_function,@cms_column) if child_column.nil?
end
end
format.html { redirect_to cms.columns_url, notice: '栏目已修改.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @cms_column.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update!(**args)\n @custom_columns = args[:custom_columns] if args.key?(:custom_columns)\n end",
"def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n end",
"def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n end",
"def update\n @column = Column.find(params[:id])\n\n respond_to do |format|\n if @column.update_attributes(params[:column])\n flash[:notice] = 'Column was successfully updated.'\n format.html { redirect_to columns_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @column.errors.to_xml }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item_column.update(item_column_params)\n format.html { redirect_to @item_column, notice: 'Item column was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app_model_column.update(app_model_column_params)\n format.html { redirect_to @app_model_column, notice: 'App model column was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_model_column }\n else\n format.html { render :edit }\n format.json { render json: @app_model_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column_headers = args[:column_headers] if args.key?(:column_headers)\n @kind = args[:kind] if args.key?(:kind)\n @rows = args[:rows] if args.key?(:rows)\n end",
"def update\n @col = Col.find(params[:id])\n\n respond_to do |format|\n if @col.update_attributes(params[:col])\n format.html { redirect_to @col, notice: 'Col was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @col.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @columns_int16 = args[:columns_int16] if args.key?(:columns_int16)\n @columns_int32 = args[:columns_int32] if args.key?(:columns_int32)\n @columns_int64 = args[:columns_int64] if args.key?(:columns_int64)\n @columns_int8 = args[:columns_int8] if args.key?(:columns_int8)\n @values = args[:values] if args.key?(:values)\n end",
"def update\n respond_to do |format|\n if @column_sample.update(column_sample_params)\n format.html { redirect_to @column_sample, notice: 'Column sample was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @column_sample.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n begin\n @row_column.update(row_column_params)\n flash[:success] = 'Column was successfully updated.'\n if @page\n format.html { redirect_to admin_page_url(@page) }\n else\n format.html { redirect_to admin_row_column_url(@row_column) }\n end\n format.json { render :show, status: :ok, location: @row_column }\n rescue Exception, RowColumn::ExclusiveArcError => e\n flash[:danger] = \"Error: #{e.message}\"\n format.html { render :edit }\n format.json { render json: @row_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(columns)\n update(nil, columns)\n end",
"def update!(**args)\n @column_items = args[:column_items] if args.key?(:column_items)\n @wrap_style = args[:wrap_style] if args.key?(:wrap_style)\n end",
"def update\n respond_to do |format|\n if @connection_table_column.update(connection_table_column_params)\n format.html { redirect_to @connection_table_column, notice: 'Connection table column was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @connection_table_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _update(columns)\n model.cti_models.each do |m|\n h = {}\n m.cti_table_columns.each{|c| h[c] = columns[c] if columns.include?(c)}\n cti_this(m).update(h) unless h.empty?\n end\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @columns = args[:columns] if args.key?(:columns)\n end",
"def update\n @onecolumnmodel = Onecolumnmodel.find(params[:id])\n\n respond_to do |format|\n if @onecolumnmodel.update_attributes(params[:onecolumnmodel])\n format.html { redirect_to @onecolumnmodel, notice: 'Onecolumnmodel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @onecolumnmodel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column_headers = args[:column_headers] if args.key?(:column_headers)\n @errors = args[:errors] if args.key?(:errors)\n @kind = args[:kind] if args.key?(:kind)\n @rows = args[:rows] if args.key?(:rows)\n end",
"def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @rows = args[:rows] if args.key?(:rows)\n end",
"def _update_columns(columns)\n _update(columns) unless columns.empty?\n end",
"def update!(**args)\n @column_items = args[:column_items] if args.key?(:column_items)\n end",
"def update\n @recommend_other_column = Recommend::OtherColumn.find(params[:id])\n\n respond_to do |format|\n if @recommend_other_column.update_attributes(params[:recommend_other_column])\n format.html { redirect_to @recommend_other_column, notice: 'Other column was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recommend_other_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tm_table_column.update(tm_table_column_params)\n format.html { redirect_to @tm_table_column, notice: 'Tm table column was successfully updated.' }\n format.json { render :show, status: :ok, location: @tm_table_column }\n else\n format.html { render :edit }\n format.json { render json: @tm_table_column.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @data = args[:data] if args.key?(:data)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @column_header = args[:column_header] if args.key?(:column_header)\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @description = args[:description] if args.key?(:description)\n @mode = args[:mode] if args.key?(:mode)\n @subcolumns = args[:subcolumns] if args.key?(:subcolumns)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @fields = args[:fields] if args.key?(:fields)\n @name = args[:name] if args.key?(:name)\n @template = args[:template] if args.key?(:template)\n @template_display_name = args[:template_display_name] if args.key?(:template_display_name)\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @fields = args[:fields] if args.key?(:fields)\n @name = args[:name] if args.key?(:name)\n @template = args[:template] if args.key?(:template)\n @template_display_name = args[:template_display_name] if args.key?(:template_display_name)\n end",
"def update\n respond_to do |format|\n if @bls_column_mapper.update(bls_column_mapper_params)\n format.html { redirect_to @bls_column_mapper, notice: 'Bls column mapper was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bls_column_mapper.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(columna_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Columna was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n end",
"def update\n @alumno = Alumno.find(params[:id])\n\n respond_to do |format|\n if @alumno.update_attributes(params[:alumno])\n head :no_content\n else\n render json: @alumno.errors, status: :unprocessable_entity\n end\n end\n end",
"def update_custom_gradebook_column(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns/{id}\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:put, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:put, path, query_params, form_params, headers)\n page_params_store(:put, path)\n CustomColumn.new(response)\n end",
"def modify_columns(columns)\n columns\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @default_value = args[:default_value] if args.key?(:default_value)\n @description = args[:description] if args.key?(:description)\n @gc_rule = args[:gc_rule] if args.key?(:gc_rule)\n @highest_indexing_type = args[:highest_indexing_type] if args.key?(:highest_indexing_type)\n @looker_column_spec = args[:looker_column_spec] if args.key?(:looker_column_spec)\n @mode = args[:mode] if args.key?(:mode)\n @ordinal_position = args[:ordinal_position] if args.key?(:ordinal_position)\n @subcolumns = args[:subcolumns] if args.key?(:subcolumns)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n @columna = Columna.find(params[:id])\n\n respond_to do |format|\n if @columna.update_attributes(params[:columna])\n flash[:notice] = 'Columna actualizado correctamente.'\n format.html { redirect_to(@columna) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @columna.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @mysql_columns = args[:mysql_columns] if args.key?(:mysql_columns)\n @table = args[:table] if args.key?(:table)\n end",
"def update\n respond_to do |format|\n if @column_list.update(column_list_params)\n format.html { redirect_to list_column_list_path(@column_list), notice: 'Column list was successfully updated.' }\n format.json { render :show, status: :ok, location: list_column_list_path(@column_list) }\n else\n format.html { render :edit }\n format.json { render json: @column_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _update_without_checking(columns)\n _update_dataset.update(columns)\n end",
"def _update_without_checking(columns)\n _update_dataset.update(columns)\n end",
"def update\n respond_to do |format|\n if @card_in_column.update(card_in_column_params)\n format.json { render json: @card_in_column.as_json(include: { card: { only: [:id, :name, :description, :project_id, :type] } }), status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_columns_changeable(value)\n self.write_attribute :columns_changeable, value.to_json\n end",
"def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @primary_geometry = args[:primary_geometry] if args.key?(:primary_geometry)\n @primary_key = args[:primary_key] if args.key?(:primary_key)\n end",
"def update\n if @column.update(column_params)\n BoardChannel.broadcast_to(@board, {action: 'updateColumn', column: @column})\n render :show, status: :ok\n else\n render json: @column.errors, status: :unprocessable_entity\n end\n end",
"def columns=(value)\n return if @columns == value\n @columns = value\n refresh\n end",
"def update!(**args)\n @cols = args[:cols] if args.key?(:cols)\n @data = args[:data] if args.key?(:data)\n @rows = args[:rows] if args.key?(:rows)\n @type = args[:type] if args.key?(:type)\n end",
"def update_preferences\n params[:columns].each do |k,v|\n col = @grid.get_column(params[:field])\n\n if col\n #RailsPowergrid::Preference.update(get_current_user, self, params[:field], v)\n end\n\n end\n render json: {}\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n end",
"def update\n respond_to do |format|\n if @schema_table.update(schema_table_params)\n format.html { redirect_to @schema_table, notice: 'Schema table was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_table }\n else\n format.html { render :edit }\n format.json { render json: @schema_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column_type = args[:column_type] if args.key?(:column_type)\n @data_type = args[:data_type] if args.key?(:data_type)\n @name = args[:name] if args.key?(:name)\n end",
"def data_for_update_columns\n {}\n end",
"def update!(**args)\n @column_type = args[:column_type] if args.key?(:column_type)\n @data_type = args[:data_type] if args.key?(:data_type)\n @name = args[:name] if args.key?(:name)\n end",
"def update!(**args)\n @column_type = args[:column_type] if args.key?(:column_type)\n @data_type = args[:data_type] if args.key?(:data_type)\n @name = args[:name] if args.key?(:name)\n end",
"def update!(**args)\n @column_type = args[:column_type] if args.key?(:column_type)\n @data_type = args[:data_type] if args.key?(:data_type)\n @name = args[:name] if args.key?(:name)\n end",
"def update!(**args)\n @column_type = args[:column_type] if args.key?(:column_type)\n @data_type = args[:data_type] if args.key?(:data_type)\n @name = args[:name] if args.key?(:name)\n end",
"def update\n @custom_table = CustomTable.find(params[:id])\n\n respond_to do |format|\n if @custom_table.update_attributes(params[:custom_table])\n format.html { redirect_to @custom_table, notice: 'Custom table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @time_format = args[:time_format] if args.key?(:time_format)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @time_format = args[:time_format] if args.key?(:time_format)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @time_format = args[:time_format] if args.key?(:time_format)\n end",
"def _update_columns(columns)\n @columns_updated ||= DeprecatedColumnsUpdated.new(columns) # SEQUEL5: Remove\n _update(columns) unless columns.empty?\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @column_span = args[:column_span] if args.key?(:column_span)\n @row = args[:row] if args.key?(:row)\n @row_span = args[:row_span] if args.key?(:row_span)\n end",
"def set_columns_changeable(value)\n write_attribute :columns_changeable, value.to_json\n end",
"def update!(**args)\n @custom_column_headers = args[:custom_column_headers] if args.key?(:custom_column_headers)\n @field_mask = args[:field_mask] if args.key?(:field_mask)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @results = args[:results] if args.key?(:results)\n @summary_row = args[:summary_row] if args.key?(:summary_row)\n @total_results_count = args[:total_results_count] if args.key?(:total_results_count)\n end",
"def update_column_spec request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_column_spec_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AutoML::V1beta1::ColumnSpec.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @data_type = args[:data_type] if args.key?(:data_type)\n @length = args[:length] if args.key?(:length)\n @nullable = args[:nullable] if args.key?(:nullable)\n @ordinal_position = args[:ordinal_position] if args.key?(:ordinal_position)\n @precision = args[:precision] if args.key?(:precision)\n @primary_key = args[:primary_key] if args.key?(:primary_key)\n @scale = args[:scale] if args.key?(:scale)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @invalid_values_allowed = args[:invalid_values_allowed] if args.key?(:invalid_values_allowed)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @invalid_values_allowed = args[:invalid_values_allowed] if args.key?(:invalid_values_allowed)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @invalid_values_allowed = args[:invalid_values_allowed] if args.key?(:invalid_values_allowed)\n @time_format = args[:time_format] if args.key?(:time_format)\n end",
"def update\n @table = Table.find(params[:id])\n\n respond_to do |format|\n if @table.update_attributes(params[:table].permit(:name, :notes, :x, :y, :table_type, :guest_ids => []))\n format.html { redirect_to @table, notice: 'Table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @table.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @column_headers = args[:column_headers] if args.key?(:column_headers)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @profile_info = args[:profile_info] if args.key?(:profile_info)\n @query = args[:query] if args.key?(:query)\n @rows = args[:rows] if args.key?(:rows)\n @self_link = args[:self_link] if args.key?(:self_link)\n @total_results = args[:total_results] if args.key?(:total_results)\n @totals_for_all_results = args[:totals_for_all_results] if args.key?(:totals_for_all_results)\n end",
"def update_data(table_name, column_values, criteria, config={})\n body = column_values.merge!({:ZOHO_CRITERIA => criteria})\n body = body.merge!(config) if config.any?\n\n options = {\n :query => {\n 'ZOHO_ACTION' => 'UPDATE',\n },\n :body => body\n }\n\n send_request get_uri(table_name), 'post', options\n end",
"def update!(**args)\n @column = args[:column] if args.key?(:column)\n @data_type = args[:data_type] if args.key?(:data_type)\n @encoding = args[:encoding] if args.key?(:encoding)\n @length = args[:length] if args.key?(:length)\n @nullable = args[:nullable] if args.key?(:nullable)\n @ordinal_position = args[:ordinal_position] if args.key?(:ordinal_position)\n @precision = args[:precision] if args.key?(:precision)\n @primary_key = args[:primary_key] if args.key?(:primary_key)\n @scale = args[:scale] if args.key?(:scale)\n end",
"def _update(columns)\n n = _update_without_checking(columns)\n raise(NoExistingObject, \"Attempt to update object did not result in a single row modification (SQL: #{_update_dataset.update_sql(columns)})\") if require_modification && n != 1\n n\n end",
"def _update(columns)\n n = _update_without_checking(columns)\n raise(NoExistingObject, \"Attempt to update object did not result in a single row modification (SQL: #{_update_dataset.update_sql(columns)})\") if require_modification && n != 1\n n\n end",
"def update!(**args)\n @cols = args[:cols] if args.key?(:cols)\n @rows = args[:rows] if args.key?(:rows)\n end",
"def update!(**args)\n @column_name = args[:column_name] if args.key?(:column_name)\n @value = args[:value] if args.key?(:value)\n end",
"def _update_without_checking(columns)\n if use_prepared_statements_for?(:update)\n _set_prepared_statement_server(model.send(:prepared_update, columns.keys)).call(Hash[columns].merge!(pk_hash))\n else\n super\n end\n end",
"def update!(**args)\n @postgresql_columns = args[:postgresql_columns] if args.key?(:postgresql_columns)\n @table = args[:table] if args.key?(:table)\n end",
"def update!(**args)\n @existing_schema = args[:existing_schema] if args.key?(:existing_schema)\n @new_schema = args[:new_schema] if args.key?(:new_schema)\n @sampled_data_locations = args[:sampled_data_locations] if args.key?(:sampled_data_locations)\n @schema_change = args[:schema_change] if args.key?(:schema_change)\n @table = args[:table] if args.key?(:table)\n end",
"def update!(**args)\n @attribute_columns = args[:attribute_columns] if args.key?(:attribute_columns)\n @attribute_weights = args[:attribute_weights] if args.key?(:attribute_weights)\n @context_columns = args[:context_columns] if args.key?(:context_columns)\n @context_weights = args[:context_weights] if args.key?(:context_weights)\n @horizon_columns = args[:horizon_columns] if args.key?(:horizon_columns)\n @horizon_weights = args[:horizon_weights] if args.key?(:horizon_weights)\n end",
"def update\n respond_to do |format|\n if @temp.update(temp_params.merge(get_update_columns))\n format.html { redirect_to edit_project_temp_path(@project, @temp), notice: 'Temp was successfully updated.' }\n format.json { render :show, status: :ok, location: @temp }\n else\n format.html { render :edit }\n format.json { render json: @temp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:user_id])\n @board = @user.boards.find(params[:id])\n @board.update_column(:content, params[:board].as_json)\n respond_to do |format|\n format.json { render json: @board }\n end\n end",
"def update\n @java_dynamic_row = JavaDynamicRow.find(params[:id])\n\n respond_to do |format|\n if @java_dynamic_row.update_attributes(params[:java_dynamic_row])\n format.html { redirect_to @java_dynamic_row, :notice => 'Java dynamic row was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @java_dynamic_row.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @erd.update(erd_params.merge(get_update_columns))\n format.html { redirect_to project_erd_path(@project, @erd), notice: 'Erd was successfully updated.' }\n format.json { render :show, status: :ok, location: @erd }\n else\n format.html { render :edit }\n format.json { render json: @erd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_field\n begin\n load_resource\n\n param_permits.each do |k,v|\n @grid.get_column(k).set(@resource, v)\n end\n\n if @resource.save\n render :json => @grid.get_hash(prepare_collection_query.where(id: @resource.id).first)\n else\n render :json => {status: \"ERROR\", errors: @resource.errors.messages }, status: :unprocessable_entity\n end\n rescue ActiveRecord::RecordNotSaved, ActiveRecord::RecordInvalid\n #This case can occurs when one field is a compound field and call \"save!\" method for example.\n render :json => {status: \"ERRORS\", errors: @resource.errors.messages }, status: :unprocessable_entity\n end\n end"
] |
[
"0.6447643",
"0.64074504",
"0.64074504",
"0.6316252",
"0.6307119",
"0.6291217",
"0.61956704",
"0.6181688",
"0.61401516",
"0.61148995",
"0.6104601",
"0.6078052",
"0.60732234",
"0.60643363",
"0.60507196",
"0.6029994",
"0.601361",
"0.6010979",
"0.60059035",
"0.5982574",
"0.59531885",
"0.59437543",
"0.59156233",
"0.589382",
"0.581002",
"0.5794649",
"0.5794649",
"0.57832885",
"0.57813764",
"0.57788444",
"0.57761765",
"0.57612497",
"0.5727762",
"0.57271224",
"0.5722884",
"0.5700078",
"0.5696484",
"0.56806177",
"0.56806177",
"0.56675947",
"0.5663076",
"0.56424916",
"0.56170696",
"0.55924314",
"0.55908424",
"0.5582887",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5574804",
"0.5569664",
"0.5529795",
"0.5528532",
"0.5522718",
"0.5522718",
"0.5522718",
"0.5522718",
"0.5513464",
"0.549697",
"0.549697",
"0.549697",
"0.5490546",
"0.5490376",
"0.5489814",
"0.5483057",
"0.5470512",
"0.5468654",
"0.54646695",
"0.54646695",
"0.54454887",
"0.5442614",
"0.54209",
"0.54199773",
"0.54169405",
"0.5415486",
"0.5415486",
"0.5401655",
"0.5400877",
"0.53942645",
"0.53881776",
"0.5386021",
"0.53842",
"0.5372749",
"0.5365556",
"0.5352125",
"0.5345926",
"0.53442395"
] |
0.5994505
|
19
|
DELETE /site/columns/1 DELETE /site/columns/1.json
|
def destroy
#先删除子节点
if @cms_column.parent_column.nil?
if Cms::Category.find_by_column_id(@cms_column.id)
flash[:error] = "该栏目还有类别,不可以删除"
else
@cms_column.destroy
end
else
flash[:error] = "子栏目不可以单独删除"
end
respond_to do |format|
format.html { redirect_to cms.columns_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @item_column.destroy\n respond_to do |format|\n format.html { redirect_to item_columns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column = Column.find(params[:id])\n @column.destroy\n\n respond_to do |format|\n format.html { redirect_to columns_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @connection_table_column.destroy\n respond_to do |format|\n format.html { redirect_to connection_table_columns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column = Column.find(params[:id])\n @column.remove_from_list()\n @column.destroy\n\n respond_to do |format|\n format.html { redirect_to(columns_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @col = Col.find(params[:id])\n @col.destroy\n\n respond_to do |format|\n format.html { redirect_to cols_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column_sample.destroy\n respond_to do |format|\n format.html { redirect_to column_samples_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @container_row = @row_column.container_row\n @row_column.destroy\n respond_to do |format|\n flash[:success] = 'Column was successfully deleted.'\n format.html { redirect_to admin_container_row_url(@container_row) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tm_table_column.destroy\n respond_to do |format|\n format.html { redirect_to tm_table_columns_url, notice: 'Tm table column was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_model_column.destroy\n respond_to do |format|\n format.html { redirect_to app_model_columns_url, notice: 'App model column was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column_list.destroy\n respond_to do |format|\n format.html { redirect_to column_lists_url, notice: 'Column list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @onecolumnmodel = Onecolumnmodel.find(params[:id])\n @onecolumnmodel.destroy\n\n respond_to do |format|\n format.html { redirect_to onecolumnmodels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bls_column_mapper.destroy\n respond_to do |format|\n format.html { redirect_to bls_column_mappers_url }\n format.json { head :no_content }\n end\n end",
"def delete_row(row_id); rest_delete(\"#{link('rows')}/#{row_id}\"); nil; end",
"def destroy\n @unsigned_columns_test = UnsignedColumnsTest.find(params[:id])\n @unsigned_columns_test.destroy\n\n respond_to do |format|\n format.html { redirect_to unsigned_columns_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recommend_other_column = Recommend::OtherColumn.find(params[:id])\n @recommend_other_column.destroy\n\n respond_to do |format|\n format.html { redirect_to recommend_other_columns_url }\n format.json { head :no_content }\n end\n end",
"def delete!\n self.update_columns(:deleted => true)\n end",
"def destroy\n @project_datum_column.destroy\n respond_to do |format|\n format.html { redirect_to project_datum_columns_url, notice: 'Project datum column was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column_image.destroy\n respond_to do |format|\n format.html { redirect_to column_images_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @java_dynamic_row = JavaDynamicRow.find(params[:id])\n @java_dynamic_row.destroy\n\n respond_to do |format|\n format.html { redirect_to java_dynamic_rows_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @outcome_column = OutcomeColumn.find(params[:id])\n @outcome_column.destroy\n\n respond_to do |format|\n format.html { redirect_to(outcome_columns_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @erd.update(get_delete_columns)\n respond_to do |format|\n format.html { redirect_to project_erds_path(@project), notice: 'Erd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_to do |format|\n @data_dictionary.update_columns( :del_flg => 1)\n format.html { redirect_to data_dictionaries_path(:dictid => @data_dictionary.parent_code), notice: 'Data dictionary was successfully destroyed.' }\n format.json { head :no_content }\n end\n \n end",
"def delete()\n db = PG connect( {dbname: 'bounty_hunter',\n host: 'localhost'\n })\n sql = 'DELETE from bounty_hunter'\n db.prepare('delete_one', sql)\n db.exec_prepared('delete_one', value)\n db.close()\nend",
"def destroy\n @case.update_columns(deleted: true)\n respond_to do |format|\n format.html { redirect_to cases_url, notice: 'Case was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @column_transform.destroy\n respond_to do |format|\n format.html { redirect_to column_transforms_url, notice: 'Column transform was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @columna = Columna.find(params[:id])\n modelo_id=@columna.modelo_id\n @columna.destroy\n\n respond_to do |format|\n format.html { redirect_to(modelo_path(modelo_id)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @<%= singular_table_name %>.destroy\n respond_to do |format|\n format.html { redirect_to <%= table_name %>_url }\n format.json { head :no_content }\n end",
"def delete\n binding.pry\n DATABASE.execute(\"DELETE FROM contents WHERE id = #{id}\")\n end",
"def delete_custom_gradebook_column(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/custom_gradebook_columns/{id}\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:delete, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:delete, path, query_params, form_params, headers)\n page_params_store(:delete, path)\n CustomColumn.new(response)\n end",
"def destroy\n @row.destroy\n respond_to do |format|\n format.html { redirect_to rows_url, notice: 'Row was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @temp.update(get_delete_columns)\n respond_to do |format|\n format.html { redirect_to project_temps_path(@project), notice: 'Temp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @default_adverse_event_column = DefaultAdverseEventColumn.find(params[:id])\n @default_adverse_event_column.destroy\n\n respond_to do |format|\n format.html { redirect_to(default_adverse_event_columns_url) }\n format.xml { head :ok }\n end\n end",
"def lnbDeleteColumn _args\n \"lnbDeleteColumn _args;\" \n end",
"def delete\n\n DB.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end",
"def delete_one()\n #connect to db\n db = PG.connect({ dbname: \"bounty_hunters\", host: \"localhost\" })\n #write SQL statement string\n sql = \"DELETE FROM bounties WHERE id = $1\"\n #make values array - in this case it only needs one value\n values = [@id]\n #prepare statemnt\n db.prepare(\"delete_one\", sql)\n #run prepared statement\n db.exec_prepared(\"delete_one\", values)\n #close db link\n db.close()\n end",
"def destroy\n @service.update_column(:deleted, true)\n respond_to do |format|\n format.html { redirect_to admin_services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@admin_blog_entry.update_column(\"is_deleted\", true)\n respond_to do |format|\n format.html { redirect_to admin_blog_entries_url, notice: 'Blog entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_column( ref )\n delete( Column.new( sheet, ref ) )\n end",
"def delete\n client.delete(\"/customFields/#{id}\")\n end",
"def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n head :no_content\n end",
"def delete_table(name, columns = nil)\n begin\n request = Request::TableRequest.new(name)\n Response::TableResponse.new(rest_delete(request.delete(columns)))\n rescue => e\n if e.to_s.include?(\"TableNotFoundException\")\n raise TableNotFoundError, \"Table '#{name}' not exists\"\n elsif e.to_s.include?(\"TableNotDisabledException\")\n raise TableNotDisabledError, \"Table '#{name}' not disabled\"\n end\n end\n end",
"def destroy\n @custom_table = CustomTable.find(params[:id])\n @custom_table.destroy\n\n respond_to do |format|\n format.html { redirect_to custom_tables_url }\n format.json { head :no_content }\n end\n end",
"def delete_plant_row(delete_name)\n CONNECTION.execute(\"DELETE FROM backyard WHERE name = '#{delete_name}';\")\nend",
"def destroy\n set_redireccion\n @objeto.destroy\n respond_to do |format|\n format.html { redirect_to @redireccion, notice: 'Columna was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @container = @container_row.container\n @container_row.destroy\n respond_to do |format|\n flash[:success] = 'Row was successfully deleted.' \n format.html { redirect_to admin_container_url(@container) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dummy_table = DummyTable.find(params[:id])\n @dummy_table.destroy\n\n respond_to do |format|\n format.html { redirect_to dummy_tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @site.columns.size > 0\n flash[:error] = \"该站点存在多个栏目,不能删除\"\n else\n delete_file(@site.logo_file) if !@site.logo_file.blank?\n @site.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to cms.sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @row = Row.find(params[:id])\n @row.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.js\n format.json { head :no_content }\n end\n end",
"def delete(sql, name = nil) end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to admin_index_tables_path, notice: 'Table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tgl_row = TglRow.find(params[:id])\n @tgl_row.destroy\n\n respond_to do |format|\n format.html { redirect_to tgl_rows_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @schema_table.destroy\n respond_to do |format|\n format.html { redirect_to schema_tables_url, notice: 'Schema table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete() # EXTENSION\n sql = \"DELETE FROM films WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend",
"def destroy\n @outcome_column_value = OutcomeColumnValue.find(params[:id])\n @outcome_column_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(outcome_column_values_url) }\n format.xml { head :ok }\n end\n end",
"def delete! key = nil\n if key.nil?\n @schema.delete!\n @values.clear\n else\n key = ::Kernel.String(key).to_sym\n @schema.delete! key\n @values.delete key\n end\n self\n end",
"def delete()\n\n db = PG.connect({dbname: \"pizza_shop\", host: \"localhost\"})\n sql = \"DELETE FROM pizza_orders WHERE id = $1\"\n values = [@id]\n db.prepare(\"Delete\", sql)\n db.exec_prepared(\"Delete\", values)\n db.close\n\n end",
"def destroy\n @schema_field = SchemaField.find(params[:id])\n @schema_field.destroy\n\n respond_to do |format|\n format.html { redirect_to schema_fields_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n table = self.class.to_s.pluralize.underscore\n\n DATABASE.execute(\"DELETE FROM #{table} WHERE id = #{@id};\")\n end",
"def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alumnu = Alumnu.find(params[:id])\n @alumnu.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end",
"def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end",
"def destroy(id)\n store.write do |data|\n data[:columns][column].delete(id)\n end\n\n true\n end",
"def destroy\n @alumno.destroy\n respond_to do |format|\n format.html { redirect_to alumnos_url, notice: 'Registro de Alumno eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n exec { index.delete(path) }\n end",
"def delete\n %w[\n hathi_isbn\n hathi_issn\n hathi_lccn\n hathi_oclc\n hathi_title\n hathi_enumc\n hathi_pubdate\n hathi_publisher\n hathi_sudoc\n hathi_related\n hathi_gd\n ].each do |tablename|\n sql = \"DELETE FROM #{tablename}\";\n q = @conn.prepare(sql);\n puts sql;\n q.execute();\n end\nend",
"def destroy\n @table_def.destroy\n respond_to do |format|\n format.html { redirect_to table_defs_url, status: 303 }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def delete(table_name, field)\nmongo_client = Mongo::Client.new($mongo_connect_string)\n if table_name == \"channel_reach\" && field == \"age\"\n result=mongo_client[:\"#{table_name}\"].delete_one({ \"#{field}\": '100' })\n elsif table_name == \"country_state_mappings\" && field == \"state\"\n result = mongo_client[:\"#{table_name}\"].delete_one({ country: \"India\", \"#{field}\": \"TestState\" })\n elsif table_name == \"regions\" && field == \"region\"\n result = mongo_client[:regions].delete_one({ region: \"Test Region\", type: \"Metro\", location: \"East\", contained_in: \"N/A\" })\n else\n result=mongo_client[:\"#{table_name}\"].delete_one({ \"#{field}\": 'Test New' })\n end\nend",
"def delete_dim_table_data(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteDimTableData'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :dim_table_name\n\t\t\targs[:query]['DimTableName'] = optional[:dim_table_name]\n\t\tend\n\t\tif optional.key? :key\n\t\t\targs[:query]['Key'] = optional[:key]\n\t\tend\n\t\tself.run(args)\n\tend",
"def ListView_DeleteColumn(hwnd, iCol) send_listview_message(hwnd, :DELETECOLUMN, wparam: iCol) end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @mega_table.destroy\n respond_to do |format|\n format.html { redirect_to mega_tables_url, notice: 'Mega table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alumno = Alumno.find(params[:id])\n @alumno.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_url }\n format.json { head :ok }\n end\n end",
"def delete()\n db = PG.connect({ dbname: 'Music_Collection', host: 'localhost'})\n sql = \n \"\n DELETE FROM Music_Collection where id = #{@id};\n \"\n db.exec(sql)\n db.close()\nend",
"def delete_field(key)\n @table.delete(key.to_sym)\n end",
"def remove_field(field_name)\n result_table = table.each { |row| row.delete(field_name) }\n File.write(@table_path, JSON.generate(result_table))\n end",
"def destroy\n @card_in_column.destroy\n respond_to do |format|\n format.html { redirect_to card_in_columns_url, notice: 'Card in column was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alumnos_x_curso = AlumnosXCurso.find(params[:id])\n @alumnos_x_curso.destroy\n\n respond_to do |format|\n format.html { redirect_to alumnos_x_cursos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n table_name = self.class.to_s.pluralize.underscore\n DATABASE.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\")\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def delete\n # Figure out the table's name from the object we're calling the method on.\n table_name = self.class.to_s.pluralize.underscore\n CONNECTION.execute(\"DELETE FROM #{table_name} WHERE id = #{@id};\") # need to see if this one will work, if not look up.\n end",
"def destroy\n @schema = Schema.find(params[:id])\n @schema.destroy\n\n respond_to do |format|\n format.html { redirect_to schemas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @schema = Schema.find(params[:id])\n @schema.destroy\n\n respond_to do |format|\n format.html { redirect_to schemas_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Company.delete(params[\"id\"])\n end",
"def delete_code(cheatsheet_db, language, delete_by, delete_this)\n cheatsheet_db.execute(\"DELETE FROM #{language} WHERE #{delete_by}=#{delete_this}\")\nend",
"def destroy\n @cg_table_type = CgTableType.find(params[:id])\n @cg_table_type.destroy\n\n respond_to do |format|\n format.html { redirect_to cg_table_types_url }\n format.json { head :no_content }\n end\n end",
"def delete\n CONNECTION.execute(\"DELETE FROM '#{tablename}' WHERE id = ?;\", @id)\n \"Deleted.\"\n end",
"def delete()\n sql = \"DELETE FROM stock_items WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end",
"def del(key)\n response = db.delete_item(@table_name, {'HashKeyElement' => {'S' => key}})\n true\n end",
"def destroy\n\t\t@column_sort = current_user.column_sorts.find(params[:id])\n\t\t@column_sort.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(column_sorts_url) }\n\t\t\tformat.xml { head :ok }\n\t\t\tformat.json { head :ok }\n\t\t\tformat.yaml { render :text => \"\", :content_type => 'text/yaml' }\n\t\tend\n\tend",
"def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end",
"def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"def delete(id)\n @conn.exec(\"DELETE FROM students WHERE id = '#{id}';\");\nend"
] |
[
"0.72419876",
"0.7161343",
"0.7061195",
"0.7042832",
"0.69228965",
"0.68932706",
"0.68366724",
"0.6807337",
"0.6709186",
"0.6693889",
"0.654845",
"0.654678",
"0.6528353",
"0.65058446",
"0.6463959",
"0.64071476",
"0.63073266",
"0.62643063",
"0.62540954",
"0.6220614",
"0.61991113",
"0.61885643",
"0.61438817",
"0.61101836",
"0.6106741",
"0.60723644",
"0.6049201",
"0.6047558",
"0.6015575",
"0.60079354",
"0.5958039",
"0.5956596",
"0.59551525",
"0.5944435",
"0.593503",
"0.59286815",
"0.5921441",
"0.59122574",
"0.590163",
"0.58980596",
"0.58977026",
"0.5893118",
"0.58889526",
"0.58835983",
"0.5879678",
"0.5868115",
"0.5864012",
"0.58636636",
"0.5853024",
"0.58499163",
"0.5848986",
"0.5845187",
"0.5833717",
"0.5832984",
"0.58179414",
"0.58141756",
"0.5805316",
"0.58042765",
"0.5798052",
"0.57960725",
"0.57922214",
"0.57922214",
"0.5791455",
"0.5789766",
"0.57783526",
"0.57712567",
"0.57698375",
"0.5766386",
"0.5764682",
"0.5759159",
"0.5755483",
"0.57507443",
"0.5744615",
"0.5740666",
"0.5739882",
"0.5737838",
"0.5737327",
"0.573002",
"0.57291746",
"0.5724668",
"0.5716044",
"0.5715539",
"0.57120025",
"0.5704262",
"0.5696263",
"0.5693433",
"0.56893086",
"0.56893086",
"0.5685474",
"0.5679205",
"0.5674175",
"0.56741226",
"0.567395",
"0.5671607",
"0.5666976",
"0.5661432",
"0.56606716",
"0.56606716",
"0.56606716",
"0.56604695"
] |
0.5870574
|
45
|
Use callbacks to share common setup or constraints between actions.
|
def set_cms_functions
@cms_functions = Cms::Function.where("parent_function_id is NULL").order("name DESC")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def cms_column_params
params.require(:column).permit(:name, :path, :function_id, :is_top_menu, :is_bottom_menu,
:has_menu,:parent_column_id,:the_order, :content, :is_enabled)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Initialize reservations object Holds growing and shrinking list of ticket reservations
|
def initialize
@reservations = {}
@lockers = Lockerz::Lockers.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize\n @rooms = list_rooms\n @reservations = []\n end",
"def initialize\n @reservations_list = []\n @block_list = []\n @all_rooms = []\n make_hotel_rooms\n end",
"def reservations\n @reservations ||= flight.reservations\n end",
"def initialize\n @rooms = make_rooms\n @reservations = []\n @blocks = []\n end",
"def prepare_all\n reservations = []\n @items.each do |id, quantity|\n quantity.times do\n reservations << Reservation.new(reserver: reserver,\n start_date: @start_date,\n due_date: @due_date,\n equipment_model_id: id)\n end\n end\n reservations\n end",
"def initialize\n\t\t\t@rooms = []\n\t\t\t@reservation_blocks = []\n\n\t\t\t20.times do |index|\n\t\t\t\t@rooms << HotelManager::Room.new(id: index + 1)\n\t\t\tend\n\t\tend",
"def reserve(*args)\n @reservations << Reservation.new(self, *args)\n end",
"def create_reservations\n Time.use_zone(@timezone) do\n @reservations = build_reservations\n return nil unless @reservations.any?\n @reservations = commit_reservations(@reservations)\n return nil unless valid? && @reservations.all?(&:persisted?)\n charge(@reservations) && @reservations.each(&:reload) if @pay\n track(@reservations)\n\n @reservations\n end\n end",
"def set_reservations\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservations\n @reservation = Reservation.find(params[:id])\n end",
"def make_reservation(range)\n\t\t\troom = room_finder(range).first\n\t\t\tnew_reservation = Hotel::Reservation.new(room, range)\n\t\t\t@reservations << new_reservation\n\t\t\troom.reservations << new_reservation\n\n\t\t\treturn new_reservation\n\t\tend",
"def reservations(base = self.date_from)\n\t\t\t\t\t@reservations = {} if @reservations.nil?\n\t\t\t\t\tif @reservations[base.to_s].nil?\n\t\t\t\t\t\t@reservations[base.to_s] = RicReservation.reservation_model.event(self, base)\n\t\t\t\t\tend\n\t\t\t\t\treturn @reservations[base.to_s]\n\t\t\t\tend",
"def make_resevation(date_range)\n available_rooms = get_available_rooms(date_range)\n if available_rooms.length < 1\n raise ArgumentError\n end\n new_reservation = Hotel::Reservation.new(date_range,available_rooms[0])\n @reservations << new_reservation\n return new_reservation\n end",
"def add_reservation(room_selection, check_in, check_out)\n # self.add_block()\n # self.add_reservation_to_block()\n @reservations << Hotel::Reservation.new(room_selection, check_in, check_out)\n end",
"def make_reservation\n #@reservation = Reservation.new\n end",
"def make_reservation\n \n node_obj = Nodes.new\n hash_details_of_resources = node_obj.get_details_of_resources\n \n # finds which resources are for reservation\n ids = []\n reservations = []\n reservations = params[:reservations]\n # puts \"Autes einai oi krathseis pou thelw na kanw\"\n # puts reservations\n\n # control for empty request for reservation\n reservation_table = []\n if reservations == nil \n redirect_to :back\n flash[:danger] = \"You must select a timeslot to make a reservation. Please try again\" \n else\n\n #control for up to 8 timeslots reservation \n\n hash_num_limition = Hash.new\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = 0 \n end\n\n reservations.each do |element|\n hash_num_limition[element.split('/')[0]] = hash_num_limition[element.split('/')[0]]+1\n end\n\n flag_limit = false\n hash_num_limition.each_value do |value|\n if value>8\n flag_limit = true\n break\n end\n end\n\n if flag_limit == true\n redirect_to :back\n flash[:danger] = \"Please choose at most 8 timeslots for every resource.\" \n else\n #control for forgotten timeslots \n old_timeslot = false\n reservations.each do |reservation|\n if reservation.split('/')[1] <= Time.zone.now.to_s[0...-9]\n old_timeslot = true\n break\n end\n end\n \n if old_timeslot == true\n redirect_to :back\n flash[:danger] = \"Please select a time from now on\" \n else\n\n \n # Checks if there is two different dates of reservations (case of 24hours schedule) and keeps the shorter\n reservation_date_num = 0\n reservation_date = \"\"\n reservations.each do |reservation|\n date = reservation.split('/')[1][0...-6]\n if date != reservation_date\n if date < reservation_date && reservation_date != \"\"\n reservation_date = date\n reservation_date_num +=1\n elsif reservation_date == \"\"\n reservation_date = date\n reservation_date_num +=1\n end\n \n end\n end\n\n reservations.each do |reservation|\n if !ids.include?(reservation.split('/')[0])\n ids << reservation.split('/')[0]\n end\n end\n\n puts \"reservation_date_num\"\n puts reservation_date_num\n\n # constructs a table with the reservations. 1 for selected timeslot and 0 for non-selected\n if reservation_date_num >= 2 || reservation_date == Time.zone.today.to_s\n\n today = Time.zone.today.to_s\n tomorrow = (Time.zone.today + 1.day).to_s\n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n\n #Upologismos gia sthles\n columns = Array.new(48)\n columns[0]= \"Name\"\n (0..47).each do |n|\n if (n % 2 == 0) \n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:00\"\n else\n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:30\"\n end\n end\n\n today_and_tommorow_columns = []\n today_and_tommorow_columns << \"Name\"\n\n columns.each do |element|\n if element > time_now && element != \"Name\"\n today_and_tommorow_columns << today + \" \" + element \n end\n end\n\n columns.each do |element|\n if element <= time_now && element != \"Name\" \n today_and_tommorow_columns << tomorrow + \" \" + element\n end\n end\n\n #Upologismos gia rows\n rows = Array.new(ids.length){Array.new(49,0)}\n rows.each_index do |i|\n rows[i][0] = ids[i]\n end\n\n reservation_table = rows.map{|r| Hash[ *today_and_tommorow_columns.zip(r).flatten ] }\n else\n ids.each_index do |i|\n h = Hash.new\n r_name = ids[i]\n h[\"Name\"] = r_name\n (0..47).each do |n|\n if (n % 2 == 0) \n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:00\"] = 0\n else\n h[\"#{reservation_date}#{n<20 ? \" 0#{n / 2}\" : \" #{n / 2}\"}:30\"] = 0\n end\n end\n #if the last half hour of a day selected, we reserve a node until \"23:59\" \n h[reservation_date + \" 23:59\"] = 0\n reservation_table << h\n end\n end\n #Sumplhrwnw o kathe hash me tis krathseis \n reservation_table.each do |element|\n reservations.each do |reservation|\n if reservation.split('/')[0] == element[\"Name\"]\n element[reservation.split('/')[1]] =1\n end\n end\n end\n puts ids\n\n \n # array_with_reservations: table filled with hashes of the reservations to be done \n array_with_reservations = []\n num = 0\n #Compute valid_from and valid_until for each reservation request \n valid_from = \"\"\n valid_until = \"\"\n puts \"Auto einai to reservation table afou to gemisw\"\n puts reservation_table.inspect\n reservation_table.each do |element|\n element.each do |key,value|\n #puts key\n #puts value\n if num ==0\n if value ==1\n #puts \"mpika \"\n valid_from = key\n #puts valid_from\n num += 1\n end\n else \n if value ==0\n valid_until = key\n #stelnw krathsh \n #element[\"Name\"]\n\n valid_from = valid_from + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_from = Time.zone.parse(valid_from)\n valid_until = valid_until + \":00 \" #+ Time.zone.now.to_s.split(' ')[2]\n valid_until = Time.zone.parse(valid_until)\n #reserveNode(node_list_uuids[element[\"Name\"]],params[:user_slice],valid_from,valid_until)\n \n h = Hash.new\n h = {\"valid_from\" => valid_from, \"valid_until\"=> valid_until, \"resources\"=> [hash_details_of_resources[element[\"Name\"]][\"uuid\"]] }\n if array_with_reservations.length == 0\n array_with_reservations << h\n else\n flag = 0\n array_with_reservations.each do |reservation|\n if reservation[\"valid_from\"] == valid_from && reservation[\"valid_until\"] == valid_until && !reservation[\"resources\"].include?(hash_details_of_resources[element[\"Name\"]][\"uuid\"])\n reservation[\"resources\"] << hash_details_of_resources[element[\"Name\"]][\"uuid\"]\n flag =1\n break \n end\n end\n if flag == 0\n array_with_reservations << h\n end\n end\n puts \"Tha kanw krathsh me valid_from\"\n puts valid_from\n puts \"kai valid_until\"\n puts valid_until\n # puts \"Gia ton \"+element[\"Name\"] + \"me uuid=\" + @node_list_uuids[element[\"Name\"]]\n num = 0\n end\n end\n end\n end\n puts \"\"\n puts \"Auto einai to array me ta reservation pou prepei na ginoun\"\n puts array_with_reservations\n\n # Making reservations\n results_of_reservations = []\n array_with_reservations.each do |reservation|\n results_of_reservations << reserveNode(reservation[\"resources\"],params[:user_slice],reservation[\"valid_from\"],reservation[\"valid_until\"])\n end\n \n flash_msg = []\n results_of_reservations.each do |result|\n if !result.to_s.include?(\"OK\") \n flash_msg << result.to_s \n end\n end \n if flash_msg.length !=0\n flash[:danger] = flash_msg\n else\n flash[:success] = \"Successful reservation!\"\n end\n redirect_to :back \n end\n\n end\n\n \n end \n end",
"def build_reservations\n # IMPORTANT: .take_matching_resell should be called before validations\n reservations = @bookings.map { |booking| Reservation.new(booking).take_matching_resell }\n all_valid = reservations.all? { |reservation| reservation.valid? }\n all_valid ? group_bookings.map { |booking| Reservation.new(booking).take_matching_resell } : reservations\n end",
"def new\n @reserve = Reservation.new\n end",
"def reserve_room(start_date, end_date) \n \n current_room = ()\n if @reservation_list.empty? == true\n current_room = rooms.shift\n elsif @reservation_list.empty? == false\n @reservation_list.include?(start_date)\n count = @reservation_list.count(start_date)\n current_room = rooms[count - 1]\n end\n \n \n room = current_room\n range = Hotel::DateRange.new(start_date, end_date)\n start_date = range.start_date\n end_date = range.end_date\n nights = range.nights\n \n # if the range has overlapping dates, then it will return true\n # if the range returns true \n \n reservation = Reservation.new(start_date, end_date, nights, room)\n \n # if @reservations_list.overlap?(range)\n # raise ArgumentError.new\n # end\n \n @reservation_list << reservation\n return reservation\n end",
"def reserved_items=(reserved_items)\n reserved_items.each do |id, amount|\n item_reservations.build(:item_id => id, :amount => amount)\n end\n end",
"def reserve_room(start_date, end_date)\n if start_date.class != Date || end_date.class != Date\n raise ArgumentError.new(\"Please input valid dates\")\n else\n reservation = Reservation.new(start_date, end_date)\n @reservations << reservation\n return reservation\n end\n end",
"def my_reservations\n @slices = []\n @slices = getSlices\n puts @slices.inspect\n @my_reservations = Hash.new\n if @slices.length != 0 \n @slices.each do |slice|\n this_slice_leases = []\n this_slice_leases = getLeasesBySlice(slice) \n #Sort my slices by valid_from\n this_slice_leases = this_slice_leases.sort_by{|hsh| hsh[\"valid_from\"]}\n @my_reservations[slice] = this_slice_leases \n # puts \"my reservations \"\n # puts @my_reservations.inspect\n end\n end\n end",
"def make_reservation(check_in, check_out, rooms)\n unavailable_rooms = []\n\n if room_flagged_available?(check_in, check_out, rooms, unavailable_rooms)\n @reservations.push(Reservation.new(check_in, check_out, rooms))\n else\n raise ArgumentError.new(\"Room: #{unavailable_rooms} not available\")\n end\n end",
"def new\n\t\t@reservation = Reservation.new\n\tend",
"def create\n @reservation = Reservation.new(reservation_params) \n respond_to do |format|\n if @reservation.save\n\n Reservation.last.reservation_rooms.each do |reservation|\n #Cambio el estado de la habitacion\n reservation.update({start: reservation.check_in, end: (reservation.check_out.to_date)+1,title: \"Reserva: \"+Room.find(reservation.room_id).identificador ,textColor: \"#ffffff\"})\n #Le pongo check_in y check_out para el calendario\n Room.find(reservation.room_id).update({state_id: 3})\n end\n\n format.html { redirect_to reservations_path(), notice: 'Reservacion creada exitosamente.' }\n #format.json { render :show, status: :created, location: @reservation }\n else\n #@my_reservation_requests = ReservationRequest.find(reservation_params[:reservation_request_id])\n #@reservation.reservation_requests.build()\n @reservation.reservation_rooms.build() \n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make_reservation(cost_per_night, check_in, check_out)\n available_rooms = list_available_rooms(Hotel::DateRange.new(check_in, check_out))\n if available_rooms.empty?\n raise StandardError, \"There's no room in the inn\"\n end\n room_number = available_rooms.sample[:room_number]\n reservation = Hotel::Reservation.new(room_number, cost_per_night, check_in, check_out)\n @reservations << reservation\n return reservation\n end",
"def make_room_reservation(test_range, room)\n overlapping = self.list_room_reservations(room, test_range)\n if overlapping.length != 0\n raise ArgumentError.new(\"room not available in that date range\")\n else\n new_res = Reservation.new(date_range: test_range, room: room)\n @reservations << new_res\n return new_res\n end\n end",
"def make_block_reservation(number_of_rooms, cost_per_night, check_in, check_out)\n available_rooms = list_available_rooms(Hotel::DateRange.new(check_in, check_out))\n if available_rooms.length < number_of_rooms\n raise StandardError, \"There's no room in the inn\"\n end\n block_reservation = []\n number_of_rooms.times do\n room_number = available_rooms.sample[:room_number]\n reservation = Hotel::Reservation.new(room_number, cost_per_night, check_in, check_out)\n @reservations << reservation\n block_reservation << res\n end\n return block_reservation\n end",
"def reserve_room(check_in, check_out)\n dates = date_range(check_in, check_out)\n new_reservation = nil\n @rooms.each do |room|\n if is_available?(room, dates) && is_not_blocked?(room, dates)\n new_reservation = Reservation.new(room, check_in, check_out)\n new_reservation.id = assign_res_id\n @reservations << new_reservation\n break\n end\n end\n if new_reservation != nil\n return new_reservation\n else\n raise StandardError, 'no rooms available in date range'\n end\n end",
"def prepare_guest_lists\n confirmed = []\n waitlist = []\n num_total = 0\n\n reservations.order(:created_at).each do |r|\n if num_total >= show.seats\n # We're already past capacity. All people join the waitlist.\n waitlist << r\n num_total += r.num\n elsif (num_total + r.num) > show.seats\n # This group puts us past capacity. Split it and waitlist the excess #.\n seats_available = (show.seats - num_total)\n r_waitlisted = r.dup\n r.num = seats_available\n r_waitlisted.id = r.id # having the same id referent is important\n r_waitlisted.num -= seats_available\n\n confirmed << r\n waitlist << r_waitlisted\n num_total += (r.num + r_waitlisted.num)\n else\n # We're still within capacity.\n confirmed << r\n num_total += r.num\n end\n end\n\n [\n confirmed.sort_by{ |r| r.lname.downcase },\n waitlist # waitlist stays in order reserved\n ]\n end",
"def reserve_room(start_date, end_date)\n requested_range = DateRange.new(start_date: start_date, end_date: end_date)\n reservable_rooms = available_rooms(requested_range)\n chosen_room = nil\n\n # pick first room in list of open rooms\n if reservable_rooms.length == 0\n raise ArgumentError.new(\"There are no open rooms available between the dates #{start_date} and #{end_date}. Please try another date range.\")\n else \n chosen_room = reservable_rooms.first \n end \n\n # create a unique id \n if @reservations.length == 0 \n new_res_id = 1\n else \n new_res_id = @reservations.last.id + 1\n end \n\n # create a new reservation \n new_reservation = Hotel::Reservation.new(id: new_res_id, room_num: chosen_room, start_date: start_date, end_date: end_date)\n\n # update @reservations \n update_reservations_list(new_reservation)\n end",
"def add_reservation(start_date, end_date)\n @bookings << [start_date, end_date]\n end",
"def make_hotel_rooms\n (1..20).each do |num|\n @all_rooms << num #Hotel::Room.new(num) I don't think I have to do this\n end\n end",
"def initialize\n @reservations = {}\n @secret = HelperFunctions.get_secret()\n end",
"def add_ticket(ticket)\n @reservations[ticket.confirmation_number] = ticket\n end",
"def create\n @reservation = Reservation.new(reservation_params)\n @reservation.teacher_id = current_user.id\n authorize! :create, @reservation\n\n if(session[:rental_category_id].nil?)\n redirect_to shopping_path\n end\n \n \n reservation_category = ItemCategory.find(session[:rental_category_id])\n \n #Nasty race condition if multiple ppl grab same kit\n @@semaphore.synchronize {\n kit_pool = Kit.available_for_item_category(reservation_category)\n \n test_kit = kit_pool.sample\n if(!test_kit.nil?)\n test_kit.set_reserved\n test_kit.reload\n @reservation.kit_id = test_kit.id\n end\n \n respond_to do |format|\n if @reservation.save\n session[:rental_category_id] = nil\n session[:start_date] = nil\n session[:end_date] = nil\n session[:pickup_date] = nil\n session[:return_date] = nil\n\n format.html { redirect_to rental_history_path(current_user), notice: 'Thank you for supporting the STEAM Kit rental program.' }\n else\n if(!test_kit.nil?)\n test_kit.unset_reserved\n test_kit.reload\n end\n format.html { redirect_to reservation_error_path }\n end\n end\n }\n end",
"def add_reservation_to_list(reservation)\n raise ArgumentError.new('Not a valid reservation.') if reservation.class != Hotel::Reservation\n @reservations << reservation\n end",
"def initialize(rooms, times)\n\t\t@rooms = rooms\n\t\t@times = times\n\n\t\t# create 1 key per each room in hash\n\t\t@roomhash = Hash.new\n\t\t@rooms.each do |r|\n\t\t\t@roomhash[r] = Array.new\n\t\tend\n\n\t\t# initialize to all rooms available at all times\n\t\t@availability = Hash.new\n\t\t@times.each do |t|\n\t\t\tfor i in t[0]..t[1]\n\t\t\t\t@availability[i] = @rooms.dup\n\t\t\tend\n\t\tend\n\tend",
"def make_reservation(start_date: Date.today, end_date: Date.today + 2, group_name: \"\", num_of_rooms: 1)\n if group_name != \"\"\n found_block = Block.find_block(blocks, group_name, start_date: start_date, end_date: end_date)\n\n if found_block == nil\n new_block = create_a_block(group_name, start_date: start_date, end_date: end_date)\n else\n new_block = found_block\n end\n\n final_list = Block.all_available_rooms_in_block(blocks, group_name, start_date: start_date, end_date: end_date)\n\n if (final_list == nil) || final_list.length < num_of_rooms\n raise StandardError.new(\"Not enough available rooms for this date range.\")\n else\n num_of_rooms.times do |k|\n room_number = final_list[k]\n new_reservation = Reservation.new(room_number, start_date: start_date, end_date: end_date, room_rate: new_block.room_rate, group_name: group_name)\n # Right here: I am modifying an attribute of the Block class\n # new_block.room_list[room_number] = :UNAVAILABLE\n new_block.change_status(room_number)\n reservations << new_reservation\n end\n end\n else\n room_list = Room.all_available_rooms(rooms, start_date: start_date, end_date: end_date)\n\n if room_list.length < num_of_rooms\n raise StandardError.new(\"Not enough available rooms for this date range. Only #{room_list.length} rooms available.\")\n else\n num_of_rooms.times do |j|\n new_reservation = Reservation.new(room_list[j], start_date: start_date, end_date: end_date)\n\n room = Room.find_room(rooms, room_list[j])\n\n room.change_status_of_room(rooms, room_list[j], start_date: start_date, end_date: end_date)\n reservations << new_reservation\n end\n end\n end\n end",
"def reservation \n\n # check if user pass a date. if user select a date we present him/her the schedule according to this date\n # else we show the schedule of current date.\n # @date: variable that contains the given date or the current according to user's timezone\n\n if params[:start_date] == \"\" || params[:start_date] == nil\n @date = Time.zone.today.to_s\n else\n @date = params[:start_date].split(\" \")[0]\n end\n\n node_obj = Nodes.new\n @resources_list_names = node_obj.get_resources_list_names\n @node_list = node_obj.get_node_list\n @user_slices = getSlices()\n @details_of_resources = node_obj.get_details_of_resources\n\n # columns: array with the times of a day. from 00:00 until 23:30. step = :30\n columns = Array.new(48)\n columns[0]= \"Name\"\n (0..47).each do |n|\n if (n % 2 == 0) \n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:00\"\n else\n columns[n+1] = \"#{n<20 ? \"0#{n / 2}\" : n / 2}:30\"\n end\n end\n\n num = @resources_list_names.length\n # rows: a two dimension array filled with zero, except from the first column that is filled with the names of the resources\n rows = Array.new(num){Array.new(49,0)}\n\n $i=0\n\n while $i< num do\n rows[$i][0] = @resources_list_names[$i]\n $i +=1\n end\n\n # We have two cases.\n # if @date == Time.zone.today.to_s we shows the schedule of the next 24hours\n # else we shows the schedule for the selected date by the user\n if @date == Time.zone.today.to_s\n \n time_now = Time.zone.now.to_s.split(\" \")[1][0...-3]\n @tomorrow = (Time.zone.today + 1.day).to_s\n \n # today_and_tommorow_columns: table with first element the string \"Name\" and the rest elements are all times from the next half hour\n today_and_tommorow_columns = []\n today_and_tommorow_columns << \"Name\"\n columns.each do |element|\n if element > time_now && element != \"Name\"\n today_and_tommorow_columns << @date + \" \" + element \n end\n end\n\n columns.each do |element|\n if element <= time_now && element != \"Name\" \n today_and_tommorow_columns << @tomorrow + \" \" + element\n end\n end\n\n # @reservation_table: a table with hashes.\n # every element is a hash with the Name of the resource and the reserved timeslots\n # ex {\"Name\"=>\"node016\", \"2014-11-11 21:00\"=>0, \"2014-11-11 21:30\"=>0, \"2014-11-11 22:00\"=>0, \"2014-11-11 22:30\"=>0, \n # \"2014-11-11 23:00\"=>0, \"2014-11-11 23:30\"=>0, \"2014-11-12 00:00\"=>0, \"2014-11-12 00:30\"=>0, \"2014-11-12 01:00\"=>0, \"2014-11-12 01:30\"=>0,\n # \"2014-11-12 02:00\"=>0, \"2014-11-12 02:30\"=>1, \"2014-11-12 03:00\"=>0, \"2014-11-12 03:30\"=>0, \"2014-11-12 04:00\"=>0, \"2014-11-12 04:30\"=>0,\n # \"2014-11-12 05:00\"=>0, \"2014-11-12 05:30\"=>0, \"2014-11-12 06:00\"=>0, \"2014-11-12 06:30\"=>0, \"2014-11-12 07:00\"=>0, \"2014-11-12 07:30\"=>0, \n # \"2014-11-12 08:00\"=>0, \"2014-11-12 08:30\"=>0, \"2014-11-12 09:00\"=>0, \"2014-11-12 09:30\"=>0, \"2014-11-12 10:00\"=>0, \"2014-11-12 10:30\"=>0,\n # \"2014-11-12 11:00\"=>0, \"2014-11-12 11:30\"=>0, \"2014-11-12 12:00\"=>0, \"2014-11-12 12:30\"=>0, \"2014-11-12 13:00\"=>0, \"2014-11-12 13:30\"=>0, \n # \"2014-11-12 14:00\"=>0, \"2014-11-12 14:30\"=>0, \"2014-11-12 15:00\"=>0, \"2014-11-12 15:30\"=>0, \"2014-11-12 16:00\"=>0, \"2014-11-12 16:30\"=>0, \n # \"2014-11-12 17:00\"=>0, \"2014-11-12 17:30\"=>0, \"2014-11-12 18:00\"=>0, \"2014-11-12 18:30\"=>0, \"2014-11-12 19:00\"=>0, \"2014-11-12 19:30\"=>0, \n # \"2014-11-12 20:00\"=>0, \"2014-11-12 20:30\"=>0}\n # if there is a reservation for a specifiv timeslot we set the relative timeslot with 1 otherwise we have 0 (default value)\n\n @reservation_table = rows.map{|r| Hash[ *today_and_tommorow_columns.zip(r).flatten ] } \n\n @today_leases = getLeasesByDate(Time.zone.today.to_s)\n @tomorrow_leases = getLeasesByDate(@tomorrow)\n \n\n @reservation_table.each do |iterate|\n # filling 1 to @reservation_table for the reserved resources for the \"today\" date \n @today_leases.each do |today_lease|\n\n date_from = today_lease[\"valid_from\"].split(' ')[0]\n date_until = today_lease[\"valid_until\"].split(' ')[0]\n time_from = today_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = today_lease[\"valid_until\"].split(' ')[1][0...-3]\n \n # use roundTimeFrom and roundTimeUntil for times between :00-:30 such as :15 (for minutes)\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n #Auto me to prev einai gia na apofeugw ta diplwtupa (den einai aparaithto)\n prev_component = \"\"\n today_lease[\"components\"].each do |component|\n #puts (@date + \" \" + component[\"component\"][\"name\"]).to_s\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"]\n if date_from == date_until\n if time_from < time_now && time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n #puts key_time \n \n if key_time > time_now && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n elsif time_from > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time >= time_from && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n end \n elsif date_from < date_until\n if @date == date_from\n if time_from > time_now \n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time >= time_from \n iterate[key] = 1\n end\n end\n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now \n iterate[key] = 1\n end \n end\n end \n end\n elsif @date == date_until\n if time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now && key_time < time_until \n iterate[key] = 1\n end\n end\n end\n end\n else\n iterate.each_key do |key| \n if key != \"Name\"\n key_time = key.split(\" \")[1] \n \n if key_time > time_now\n iterate[key] = 1\n end\n end\n end\n end\n end\n\n #puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end\n end\n end\n #puts @reservation_table\n @reservation_table.each do |iterate|\n # filling 1 to @reservation_table for the reserved resources for the \"tommorow\" date \n \n #Se auth thn periptwsh skeftomai to <= tou time_now san to orio tou programmatos \n #pou tha emfanisw sto xrhsh \n @tomorrow_leases.each do |tomorrow_lease|\n\n date_from = tomorrow_lease[\"valid_from\"].split(' ')[0]\n date_until = tomorrow_lease[\"valid_until\"].split(' ')[0]\n time_from = tomorrow_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = tomorrow_lease[\"valid_until\"].split(' ')[1][0...-3]\n\n\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n #Auto me to prev einai proswrinh lush gia na apofeugw ta diplwtupa \n prev_component = \"\"\n tomorrow_lease[\"components\"].each do |component|\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"] \n if date_from == date_until\n if time_from < time_now && time_until <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time < time_until\n iterate[key] = 1\n end \n end\n end \n elsif time_from <= time_now && time_until > time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time <= time_now\n iterate[key] = 1\n end \n end\n end \n end\n elsif date_from < date_until\n if @tomorrow == date_from\n if time_from <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time >= time_from && key_time <= time_now \n iterate[key] = 1\n end \n end \n end \n end\n elsif @tomorrow == date_until\n if time_until <= time_now\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time < time_until \n iterate[key] = 1\n end \n end \n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time <= time_now \n iterate[key] = 1\n end \n end \n end\n end\n else\n iterate.each_key do |key| \n if key != \"Name\"\n key_time = key.split(\" \")[1] \n if key_time <= time_now\n iterate[key] = 1\n end\n end\n end \n end\n end\n puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end\n end\n end\n puts @reservation_table\n else\n # Same way as above but only for the given date\n @today_leases = getLeasesByDate(@date)\n\n today_columns = []\n today_columns << \"Name\"\n columns.each do |element|\n if element != \"Name\"\n today_columns << @date + \" \" + element \n end\n end\n\n @reservation_table = rows.map{|r| Hash[ *today_columns.zip(r).flatten ] }\n #puts @reservation_table.inspect \n # puts @today_leases.inspect\n puts @today_leases.inspect\n\n @reservation_table.each do |iterate|\n @today_leases.each do |t_lease|\n\n\n date_from = t_lease[\"valid_from\"].split(' ')[0]\n date_until = t_lease[\"valid_until\"].split(' ')[0]\n time_from = t_lease[\"valid_from\"].split(' ')[1][0...-3]\n time_until = t_lease[\"valid_until\"].split(' ')[1][0...-3]\n\n\n\n time_from = roundTimeFrom(time_from)\n time_until = roundTimeUntil(time_until)\n\n prev_component = \"\"\n t_lease[\"components\"].each do |component|\n if component[\"component\"][\"name\"] != prev_component && iterate[\"Name\"] == component[\"component\"][\"name\"]\n if date_from == date_until\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time >= time_from && key_time < time_until && key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n elsif date_from < date_until\n if @date == date_from\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time >= time_from && key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n elsif @date == date_until\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key_time < time_until \n iterate[key] = 1\n end\n end\n end\n else\n iterate.each_key do |key|\n if key != \"Name\"\n key_time = key.split(\" \")[1]\n if key != \"Name\" \n iterate[key] = 1\n end\n end\n end\n end \n end \n end\n\n puts component[\"component\"][\"name\"]\n prev_component = component[\"component\"][\"name\"]\n end\n end \n end\n end\n\n end",
"def count_reservations\n reservations.count\n end",
"def index\n @reservations = @bus.reservations\n end",
"def index\n @reservations = Reservation.all\n @reservation_statuses = @@reservation_statuses\n end",
"def your_reservations\n @rooms = current_user.rooms\n @reservations = Reservation.all\n end",
"def new\n unless r = params['reservation-times'] || session['reservation-times']\n return select_times_first\n end\n resource_id = r.keys.first\n sll_times = r[resource_id] \n return select_times_first if sll_times.blank?\n\n @reservation = Reservation.new({ \n :start_datetime => Time.parse(sll_times.first), \n :end_datetime => Time.parse(sll_times.last) + 1.hour,\n :resource_id => resource_id\n })\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end",
"def existing_reservations\n start_dt = self.start_dt.try(:to_datetime).try(:change, offset: \"+0000\")\n end_dt = self.end_dt.try(:to_datetime).try(:change, offset: \"+0000\")\n room_id = self.room.try(:id)\n results_size = (self.is_block?) ? 1000 : 1\n\n return [] if room_id.blank? || start_dt.blank? || end_dt.blank?\n block_query = [{ term: { is_block: false } }, { range: { end_dt: { gte: Time.zone.now.to_datetime.change(offset: \"+0000\") } } }]\n query =\n {\n query: {\n constant_score: {\n filter: {\n bool: {\n must: [\n { term: { room_id: room_id } },\n { term: { deleted: false }},\n { bool:\n {\n should: [\n {\n bool: {\n must: [\n { range: { start_dt: { gte: start_dt } } },\n { range: { start_dt: { lt: end_dt } } }\n ]\n }\n },\n {\n bool: {\n must: [\n { range: { end_dt: { gt: start_dt } } },\n { range: { end_dt: { lte: end_dt } } }\n ]\n }\n },\n {\n bool: {\n must: [\n { range: { start_dt: { lte: start_dt } } },\n { range: { end_dt: { gte: end_dt } } }\n ]\n }\n }\n ]\n }\n }\n ]\n }\n }\n }\n },\n size: results_size\n }\n query[:query][:constant_score][:filter][:bool][:must] += block_query if self.is_block?\n return Reservation.search(query).results\n end",
"def create\n @reservation = V2::Reservation.new(reservation_params)\n if @reservation.save\n flash[:notice] = \"An interview has been booked for #{@reservation.time_slot.start_datetime_human}\"\n send_notifications(@reservation)\n else\n flash[:error] = \"No time slot was selected, couldn't create the reservation\"\n end\n @available_time_slots = []\n @person = @reservation.person\n respond_to do |format|\n format.js {}\n format.html { render :new }\n end\n end",
"def create\n @reservation = Reservation.new(reservation_params)\n @room = Room.where(\"room_number LIKE ?\", @reservation.room_number)\n if session[:role] != \"admin\"\n @member = Member.where(\"email LIKE ?\", session[:email])\n else\n @member = Member.where(\"email LIKE ?\", params[:members_email])\n if @member.nil? or @member.empty?\n flash[:notice] = \"Member not found !\"\n render 'reservations/newreservation' and return\n end\n end\n @current_reservations = Reservation.where(\"room_number LIKE ? and ? <= end_time and start_time <= ? \", @reservation.room_number,\n @reservation.start_time, @reservation.end_time)\n if not @current_reservations.nil? and not @current_reservations.empty?\n flash[:notice] = \"This room is not available at this time. Conflicts with other reservation which starts at #{@current_reservations.first.start_time} \"\n render 'reservations/newreservation' and return\n end\n\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time + 2.hours < @reservation.end_time\n flash[:notice] = \"ERROR : Reservation can be made only for 2 hours at a time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now + 7.days < @reservation.start_time\n flash[:notice] = \"ERROR : Reservation can be made only 1 week in advance from today\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time == @reservation.end_time\n flash[:notice] = \"ERROR: Please book the room for atleast 1 minute!\"\n render 'reservations/newreservation' and return\n end\n\n if @reservation.start_time > @reservation.end_time\n flash[:notice] = \"ERROR: Booking start time can't be greater than end time\"\n render 'reservations/newreservation' and return\n end\n\n if Time.now - 5.minutes >= @reservation.start_time\n flash[:notice] = \"ERROR: Booking start time should not be less than current time\"\n render 'reservations/newreservation' and return\n end\n\n #User can only reserve one room at a perticular date and time without extra permission from admin\n @user_reservations = Reservation.where(\"members_id = ? and ? <= end_time and start_time <= ? \", @member.first.id,\n @reservation.start_time, @reservation.end_time)\n if not @user_reservations.empty? and @member.first.isMultipleReservationAllowed != \"Yes\"\n flash[:notice] = \"ERROR : You already have reservation from #{@reservation.start_time} to #{@reservation.end_time} .\n You can't book room during this time interval. Contact Administrator if you want to book multiple rooms with\n overlapping time intervals\"\n render 'reservations/newreservation' and return\n end\n\n @reservation.room_id = @room.first.id\n @reservation.status = \"Booked\"\n @member.first.reservations << @reservation\n SendEmail.reservation_email(@member.first, @reservation).deliver\n\n\n respond_to do |format|\n if @member.first.save\n @member.first.reservations.each do |res|\n end\n\n format.html { redirect_to @reservation, notice: 'Reservation was successfully created.' and return }\n format.json { render :show, status: :created, location: @reservation }\n else\n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def manage_time_slots\n @time_slot = TimeSlot.new\n\n end",
"def initialize(x, y, width, height, actors=nil)\n super(x, y, width, height, 28, 48)\n @column_max = 8\n @ucReserveActorsList = []\n window_update(actors)\n self.index = 0\n @cursor_transfer = false\n end",
"def initialize:\n\t\t@slots = []",
"def time_slots\n\n # you can book by the hour, and you can stay for an hour\n reservation_interval = 1.hour\n\n # Determine the earliest time we will allow reservation\n # It can't be in the past, we'll start 10 minutes from now\n start_time = Time.zone.now + 10.minutes\n # Then we have to round to the next hour block\n start_time = Time.zone.at( (start_time.to_f / reservation_interval).ceil * reservation_interval )\n # Then, if we are still earlier than opening hour, just use the opening hour\n # We can use the 'max' Array method\n start_time = [start_time, start_time.change(hour: opening_hour)].max\n\n # Determine the furthest in the future we will allow reservations\n end_time = (start_time + 3.days).change(hour: closing_hour)\n\n # Now, we want to make a list of every hour between our start_time and our end_time\n # For this we can use a begin... end while condition loop.\n # We'll start with an empty array that will hold all the hours,\n # and a variable to hold each hour, which we will keep increasing by 1 hour, and then add to our array\n # Our loop condition will have us stop looping once we've reached the end time\n\n all_times = []\n a_time = start_time\n\n begin\n\n # add this time to our list of times\n all_times << a_time\n\n # increment the time\n a_time += reservation_interval\n\n # Once we get to closing time, we have to skip ahead to the next day's opening\n # That way you can't make a reservation at 2am\n if (a_time + reservation_interval) > a_time.change(hour: closing_hour)\n a_time = (a_time + 1.day).change(hour:opening_hour)\n end\n\n end while a_time < end_time\n\n all_times\n end",
"def initialize(room_number, reservations)\n @room_number = room_number.to_i\n if room_number.between?(1,20) == false\n raise ArgumentError, \"Room id must be between 1 and 20. Given #{room_number}.\"\n end\n @reservations = reservations\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def index\n @reservations = Reservation.all\n end",
"def set_reservation\n @apartment = Apartment.find(params[:apartment_id])\n @reservation = Reservation.find(params[:id]) if params[:id]\n end",
"def set_reservation\n @reservation = Reservation.includes(:user, :posting).find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find_by(id: params[:id])\n end",
"def set_reservation\n #@reservation = Reservation.find(params[:id])\n @reservations = Reservation.joins(\"INNER JOIN rooms ON rooms.id = reservations.room_id \n INNER JOIN users ON reservation.user_id = users.id\").where(user_id: session[:user_id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end"
] |
[
"0.75554866",
"0.7495674",
"0.73429924",
"0.696298",
"0.68865544",
"0.68165845",
"0.67641413",
"0.6654761",
"0.65217304",
"0.65217304",
"0.6492565",
"0.6362393",
"0.6347391",
"0.6276365",
"0.62518656",
"0.6236001",
"0.6214744",
"0.60587496",
"0.60212964",
"0.59254354",
"0.59162587",
"0.59138954",
"0.58870924",
"0.58836794",
"0.5880064",
"0.58744407",
"0.5871956",
"0.5840525",
"0.5836962",
"0.5813233",
"0.5811722",
"0.5806408",
"0.5740436",
"0.5712697",
"0.5708873",
"0.56936157",
"0.5675087",
"0.56663823",
"0.56650305",
"0.5663267",
"0.5629201",
"0.56181896",
"0.55930364",
"0.55863124",
"0.5581586",
"0.55614555",
"0.5552436",
"0.5550127",
"0.55469567",
"0.5546439",
"0.55298615",
"0.5526776",
"0.5507288",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.549994",
"0.5491694",
"0.54912347",
"0.5491071",
"0.54876196",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498",
"0.5475498"
] |
0.694603
|
4
|
Conviencience proxy method to internal hash's length
|
def length
@reservations.length
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hash_length\n super\n end",
"def length\n @internal_hash.length\n end",
"def hashref_size\n hashptr_size + length_size\n end",
"def digest_length()\n #This is a stub, used for indexing\n end",
"def digest_length()\n #This is a stub, used for indexing\n end",
"def hash_size\n hashref_size * num_hashes\n end",
"def hash_byte_size\n return 20\n end",
"def size\n return @hash.length\n end",
"def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"def size\n @hash.size\n end",
"def size\n @hash.size\n end",
"def size\n @hash.size\n end",
"def xlen(key); end",
"def hashfunction(key, size)\n #key.hash % size\n key % size\n end",
"def llen(key); end",
"def llen(key); end",
"def length\n return @ghash.length\n end",
"def key_length(name); end",
"def strlen(key); end",
"def strlen(key); end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def size\n @hash_array.length\n end",
"def size\n @hash_array.length\n end",
"def test_Hash_InstanceMethods_size\n\t\th={1=>'a', 2=>'b', 3=>'c'}\n\t\tassert_equal(3, h.size)\n\tend",
"def cookie_hash_length\n super\n end",
"def test_Hash_InstanceMethods_length\n\t\th = {'d'=>100, 'a'=>200, 'v'=>300, 'e'=>400}\n\t\tassert_equal(4, h.length)\n\t\tassert_equal(200, h.delete('a'))\n\t\tassert_equal(3, h.length)\n\tend",
"def hash(*) end",
"def length\n hash.keys.length\n end",
"def length=(_); end",
"def rehash(oldhash, size)\n (oldhash + 1) % size\n end",
"def size\n @hash.size + @converted.size\n end",
"def digest_length\n decode[:length]\n end",
"def length() end",
"def length() end",
"def length() end",
"def length() end",
"def hlen(key); end",
"def hlen(key); end",
"def hash\n 0\n end",
"def fnvhash( key, len=key.length )\n state = 0x811C9DC5\n\n len.times{ |i|\n state ^= key[i]\n state *= 0x1000193\n }\n\n return state\nend",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def set_hash_length(opts)\n opts = check_params(opts,[:lengths])\n super(opts)\n end",
"def key_length\n key.unpack('b*').first.length\n end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def hash=(_arg0); end",
"def length=(_arg0); end",
"def length(*) end",
"def length(*) end",
"def hash()\n #This is a stub, used for indexing\n end",
"def length()\n #This is a stub, used for indexing\n end",
"def size\n key.call(\"LLEN\")\n end",
"def hash() source.hash ^ (target.hash+1); end",
"def hash() source.hash ^ (target.hash+1); end",
"def length\n @sync.synchronize{super}\n end",
"def hash()\n #This is a stub, used for indexing\nend",
"def length\n raise NotImplementedError, \"Please implement length\"\n end",
"def size(key)\n raise \"subclass responsibility\"\n end",
"def increase_size\n hash_size *= 2\n end",
"def length; count end",
"def hash_code; end",
"def length\n do_num_bytes\n end",
"def digest_length\n check_valid\n md.md_size\n end",
"def length\n pack.length\n end",
"def key_handle_length\n registration_data_raw.byteslice(KEY_HANDLE_LENGTH_OFFSET).unpack('C').first\n end",
"def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\n end",
"def key_size\n compute_minimal_keys if not @key_length\n @key_length \n end",
"def length\n do_num_bytes\n end",
"def length\n do_num_bytes\n end",
"def block_length()\n #This is a stub, used for indexing\n end",
"def block_length()\n #This is a stub, used for indexing\n end",
"def size\n @hash_table.keys.length\n end",
"def length()\n #This is a stub, used for indexing\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def length()\n return self.keys.get_length()\n end",
"def length()\n return @i_keys.get_length()\n end",
"def iv_len; end",
"def size\n self.dna_hash.size\n end",
"def size\n self.dna_hash.size\n end",
"def size=(_); end",
"def size=(_); end"
] |
[
"0.820875",
"0.7828041",
"0.77949333",
"0.7626832",
"0.7626832",
"0.7403767",
"0.7272758",
"0.7248375",
"0.71779317",
"0.70802677",
"0.70802677",
"0.70802677",
"0.7053473",
"0.7014784",
"0.6993647",
"0.6993647",
"0.69513977",
"0.6907704",
"0.6820383",
"0.6820383",
"0.68109363",
"0.68109363",
"0.68109363",
"0.68109363",
"0.68109363",
"0.68109363",
"0.68109363",
"0.67577296",
"0.67577296",
"0.6746008",
"0.6737618",
"0.67294466",
"0.67252576",
"0.6705073",
"0.6685271",
"0.66736823",
"0.6659622",
"0.66531116",
"0.66250044",
"0.66250044",
"0.66250044",
"0.66250044",
"0.6624782",
"0.6624782",
"0.65866524",
"0.65255296",
"0.65054905",
"0.65041894",
"0.6484684",
"0.64736605",
"0.64736605",
"0.64736605",
"0.64736605",
"0.64736605",
"0.64736605",
"0.64736605",
"0.6467465",
"0.644887",
"0.6441687",
"0.6441687",
"0.6436152",
"0.6425636",
"0.64152575",
"0.6379823",
"0.6379823",
"0.63784057",
"0.6371535",
"0.6367464",
"0.63471466",
"0.6320359",
"0.6301027",
"0.6293628",
"0.62612575",
"0.6258687",
"0.6258152",
"0.6257017",
"0.62499946",
"0.62310064",
"0.622828",
"0.622828",
"0.6226502",
"0.6226502",
"0.622121",
"0.6220575",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62189233",
"0.62141716",
"0.6212015",
"0.617835",
"0.6174752",
"0.6174752",
"0.6162196",
"0.6162196"
] |
0.0
|
-1
|
Assign a ticket to a locker and then add it to the reservation list
|
def create(ticket)
ticket.assign_available_locker_from(@lockers)
add_ticket(ticket)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_ticket(ticket)\n @reservations[ticket.confirmation_number] = ticket\n end",
"def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end",
"def set_ticket\n # is this ticket belong to him ?\n @ticket = @current_user.ticket(params[:id])\n end",
"def set_ticket\n @ticket = policy_scope(Ticket).find(params[:id])\n end",
"def set_ticket\n @ticket = current_user.tickets.find_by_id(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:ticket_id])\n @ticket_user = User.find(@ticket.user_id)\n end",
"def set_ticket\n @ticket = Ticket.find(params[:ticket_id])\n end",
"def addToTicket\n\t ticket = Ticket.where(table: session[:table_id]).last\n\t if (ticket.nil?) || (ticket.tstatus == 9)\n\t ticket = Ticket.create(table: session[:table_id], \n\t\t\t\t\t\t\t\t\t\ttax: 0, \n\t\t\t\t\t\t\t\t\t\ttstatus: 0, \n\t\t\t\t\t\t\t\t\t\tbirthday: false,\n\t\t\t\t\t\t\t\t\t\tcoupon: false,\n\t\t\t\t\t\t\t\t\t\tpoints: false\t )\n\t\t# Add 1 to ticket counter \n\t count = Totalticket.first\n\t # reset survey variable\n\t session[:survey] = false\n\t count.update(:total => count.total + 1)\n\t puts(\"**********Ticket created************\")\n\t end\n\t ticket.orderItems.create(\n\t item: (Menuitem.find_by(name: params[:item_name]).id),\n\t ingredients: params[:good_ingredients],\n\t notes: params[:notes],\n\t istatus: 0\n\t )\n\t session[:ticket] = ticket\n\t puts(\"**************Ticket added to***********\")\n\t calcTotal\n\t redirect_to guest_path\n\t \n\tend",
"def set_ticket\n @ticket = Ticket.find(params[:id]) if params[:id]\n end",
"def set_ticket\n @ticket = params[:id].present? ? find_ticket(:id) : find_ticket(:ticket_id)\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_seat\n @seat = ::Seat.find(params[:id])\n @ticket = ::Ticket.find(params[:ticket_id])\n end",
"def add_ticket(id)\n\t\tticket = Ticket.find_by_id(id) # Find the Ticket with ID\n\t\tcurrent_bowler = Bowler.find_by_id(id) # Find the Bowlers with ID\n\t ticket.bowler_id = current_bowler # Ticket ID belong to Bowler \n\t ticket.save\n\tend",
"def create\n @reservation = Reservation.new(reservation_params)\n @reservation.teacher_id = current_user.id\n authorize! :create, @reservation\n\n if(session[:rental_category_id].nil?)\n redirect_to shopping_path\n end\n \n \n reservation_category = ItemCategory.find(session[:rental_category_id])\n \n #Nasty race condition if multiple ppl grab same kit\n @@semaphore.synchronize {\n kit_pool = Kit.available_for_item_category(reservation_category)\n \n test_kit = kit_pool.sample\n if(!test_kit.nil?)\n test_kit.set_reserved\n test_kit.reload\n @reservation.kit_id = test_kit.id\n end\n \n respond_to do |format|\n if @reservation.save\n session[:rental_category_id] = nil\n session[:start_date] = nil\n session[:end_date] = nil\n session[:pickup_date] = nil\n session[:return_date] = nil\n\n format.html { redirect_to rental_history_path(current_user), notice: 'Thank you for supporting the STEAM Kit rental program.' }\n else\n if(!test_kit.nil?)\n test_kit.unset_reserved\n test_kit.reload\n end\n format.html { redirect_to reservation_error_path }\n end\n end\n }\n end",
"def add_reservation(room_selection, check_in, check_out)\n # self.add_block()\n # self.add_reservation_to_block()\n @reservations << Hotel::Reservation.new(room_selection, check_in, check_out)\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find_by_uid(params[:id])\n end",
"def assign id, uid\n\t\t@tickets.update Hash[\"assigned\" => uid, 'status' => 'assigned'], ['id', id], nil, nil, nil\n\tend",
"def set_ticket\n @ticket = Ticket.friendly.find(params[:id])\n end",
"def sell_ticket(attendee)\n Ticket.new(attendee, self)\n end",
"def create\n\n @ticket = current_user.tickets.build(ticket_params)\n @ticket.status = current_user.new_ticket_status\n\n return render action: 'new' unless @ticket.valid?\n\n notice = %{You've been placed on the waiting list for your ticket.\n We will contact you via email with the result of your ticket application.}\n if @ticket.reserved?\n @ticket.charges.build([{amount: @ticket.ticket_type.price, description: @ticket.ticket_type.name},\n {amount: @ticket.donation, description: 'Ticket donation'}])\n notice = 'Ticket successfully ordered. Please consult the Charges section.'\n end\n\n if @ticket.save\n if @ticket.reserved?\n UserMailer.reserved_ticket(current_user, @ticket).deliver_later\n elsif @ticket.waiting_list?\n UserMailer.waiting_list_ticket(current_user, @ticket).deliver_later\n end\n redirect_to authenticated_root_url, notice: notice\n else\n render action: 'new'\n end\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n @task = Task.find(params[:task_id]) if params[:task_id]\n @task ||= Task.new\n @tasks = @ticket.tasks\n @note = Note.find(params[:note_id]) if params[:note_id]\n @note ||= Note.new\n @notes = @ticket.notes \n end",
"def set_admin_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.includes(:user, :posting).find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.includes(:comments).find(params[:id])\n end",
"def set_ticket_item\n @ticket_item = TicketItem.find(params[:id])\n end",
"def set_ticket_item\n @ticket_item = TicketItem.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n session[:ticket] = @ticket.id\n end",
"def set_reservation\n @apartment = Apartment.find(params[:apartment_id])\n @reservation = Reservation.find(params[:id]) if params[:id]\n end",
"def set_reservation\n @reservation = current_user.reservation\n end",
"def set_ticket_item\n @ticket_item = TicketItem.find(params[:id])\n end",
"def set_ticketing\n @ticketing = Ticketing.find(params[:id])\n end",
"def reservation_params\n params.require(:reservation).permit(:ticket_id, :user_id, :amount)\n end",
"def new\n ticket_id = params[:ticket_id]\n user_id = params[:user_id]\n \n @ticket_lock = TicketLock.new(:ticket_id => ticket_id, :user_id => user_id)\n \n if @ticket_lock.save\n render :json => {:status => 'ok', :time => 300 }\n else\n render :json => {:status => 'error', :message => 'This ticket is already locked.'}\n end\n end",
"def add_tickets(vv, num)\n self.order.add_tickets_without_capacity_checks(vv, num)\n @valid_vouchers[vv] += num\n end",
"def set_reserved_room\n @reserved_room = ReservedRoom.find(params[:id])\n end",
"def add pid, title, description, cid, tracker\n\t\t@tickets.create Hash[\n\t\t\t'pid' => pid, \n\t\t\t'title' => title, \n\t\t\t'description' => description,\n\t\t\t'creator' => cid, \n\t\t\t'tracker' => tracker,\n\t\t\t'status' => 'new',\n\t\t\t'assigned' => '-1']\n\tend",
"def set_reservation\n @reservation = Reservation.find_by(id: params[:id])\n end",
"def get_ticket(ticket)\n @tickets << ticket\nend",
"def fill_locker_room_for(locker_type)\n lockers.fill_locker_room_for(locker_type)\n end",
"def set_reservation\n #@reservation = Reservation.find(params[:id])\n @reservations = Reservation.joins(\"INNER JOIN rooms ON rooms.id = reservations.room_id \n INNER JOIN users ON reservation.user_id = users.id\").where(user_id: session[:user_id])\n end",
"def set_admin_ticket\n @ticket = Ticket.preload(ticket_comments: [:assignment, :user]).find_by_reference!(params[:reference])\n end",
"def remove_ticket(ticket)\n @lockers.unassign(ticket) \n @reservations.delete(ticket.confirmation_number)\n end",
"def buy_ticket(screening)\n\n #Exit function if customer can't afford or tickets ran out\n return nil if !(can_afford?(screening.price) && screening.tickets_available?)\n #Reduce money\n spend_money(screening.price)\n #Update customer on db\n update\n #Create ticket\n new_ticket = Ticket.new({'screening_id' => screening.id, 'customer_id' => @id})\n #Save ticket to database\n new_ticket.save\n #Remove ticket from screening\n screening.sold_ticket\n #Update screening\n screening.update\n\n end",
"def buy_ticket(screening)\n ticket = Ticket.new({\n 'customer_id' => @id,\n 'screening_id' => screening.id\n })\n ticket.save()\n end",
"def ticket=(ticket)\n ticket.passenger = self\nend",
"def create\n @tickets = []\n params[:quantity].to_i.times do\n @ticket = Ticket.new(params[:ticket])\n @ticket.viber = current_viber\n @tickets << @ticket\n end\n\n respond_to do |format|\n if @tickets.map(&:save)\n format.html { redirect_to @ticket, notice: 'Your ticket(s) are booked.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end",
"def set_reservation\n @reservation = Reservation.find(params[:id])\n end"
] |
[
"0.7228647",
"0.65922964",
"0.6428284",
"0.6391993",
"0.6381478",
"0.61966723",
"0.6134835",
"0.6131066",
"0.61262554",
"0.6099354",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60966605",
"0.60879487",
"0.60783076",
"0.6067715",
"0.6036042",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60336995",
"0.60259855",
"0.60259855",
"0.60259855",
"0.59818435",
"0.59637463",
"0.5957907",
"0.5956002",
"0.59520584",
"0.5930149",
"0.5912893",
"0.5902144",
"0.5901855",
"0.5896656",
"0.5896656",
"0.5863974",
"0.58568656",
"0.58547604",
"0.58547455",
"0.5830324",
"0.5818639",
"0.5813082",
"0.5801323",
"0.57586044",
"0.5753175",
"0.5744979",
"0.5741231",
"0.5719571",
"0.57067895",
"0.57066923",
"0.56905884",
"0.5679715",
"0.5679484",
"0.565306",
"0.5645797",
"0.5642658",
"0.5642658",
"0.5642658",
"0.5642658",
"0.5642658"
] |
0.7773839
|
0
|
Convenience method used by the 'create' method to add a ticket to the reservations list
|
def add_ticket(ticket)
@reservations[ticket.confirmation_number] = ticket
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create(ticket)\n ticket.assign_available_locker_from(@lockers)\n add_ticket(ticket)\n end",
"def addToTicket\n\t ticket = Ticket.where(table: session[:table_id]).last\n\t if (ticket.nil?) || (ticket.tstatus == 9)\n\t ticket = Ticket.create(table: session[:table_id], \n\t\t\t\t\t\t\t\t\t\ttax: 0, \n\t\t\t\t\t\t\t\t\t\ttstatus: 0, \n\t\t\t\t\t\t\t\t\t\tbirthday: false,\n\t\t\t\t\t\t\t\t\t\tcoupon: false,\n\t\t\t\t\t\t\t\t\t\tpoints: false\t )\n\t\t# Add 1 to ticket counter \n\t count = Totalticket.first\n\t # reset survey variable\n\t session[:survey] = false\n\t count.update(:total => count.total + 1)\n\t puts(\"**********Ticket created************\")\n\t end\n\t ticket.orderItems.create(\n\t item: (Menuitem.find_by(name: params[:item_name]).id),\n\t ingredients: params[:good_ingredients],\n\t notes: params[:notes],\n\t istatus: 0\n\t )\n\t session[:ticket] = ticket\n\t puts(\"**************Ticket added to***********\")\n\t calcTotal\n\t redirect_to guest_path\n\t \n\tend",
"def create_ticket(params = {})\n Ticket.create(self, params)\n end",
"def create\n @tickets = []\n params[:quantity].to_i.times do\n @ticket = Ticket.new(params[:ticket])\n @ticket.viber = current_viber\n @tickets << @ticket\n end\n\n respond_to do |format|\n if @tickets.map(&:save)\n format.html { redirect_to @ticket, notice: 'Your ticket(s) are booked.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_ticket(ticket)\n if ticket.priority.nil? or ticket.project_id.nil? or ticket.summary.nil?\n raise Unfuddled::Error.new(\"Must have Priority (1..5), Project ID and Summary\")\n end\n\n begin\n url = \"/api/v1/projects/#{ticket.project_id}/tickets.json\"\n id = send(:post , url, ticket.to_h)[:body][:id]\n \n # Add the ID with to ticket\n ticket.id = id\n\n # Attach the client to the ticket\n ticket.client = self\n \n ticket\n rescue Unfuddled::HTTPErrorResponse => error\n raise error\n end\n\n end",
"def CreateTicket params = {}\n\n APICall(path: 'tickets.json',method: 'POST',payload: {ticket: params}.to_json)\n \n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n\n \n #Security check. You can only add a ticket for an event you also created!´\n \n respond_to do |format|\n if @ticket.save\n flash[:notice] = 'Ticket was successfully created.'\n format.html { redirect_to tickets_path() }\n format.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n else\n flash[:notice_bad] = 'Please fill in all required fields.'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def add pid, title, description, cid, tracker\n\t\t@tickets.create Hash[\n\t\t\t'pid' => pid, \n\t\t\t'title' => title, \n\t\t\t'description' => description,\n\t\t\t'creator' => cid, \n\t\t\t'tracker' => tracker,\n\t\t\t'status' => 'new',\n\t\t\t'assigned' => '-1']\n\tend",
"def create\n\n @ticket = current_user.tickets.build(ticket_params)\n @ticket.status = current_user.new_ticket_status\n\n return render action: 'new' unless @ticket.valid?\n\n notice = %{You've been placed on the waiting list for your ticket.\n We will contact you via email with the result of your ticket application.}\n if @ticket.reserved?\n @ticket.charges.build([{amount: @ticket.ticket_type.price, description: @ticket.ticket_type.name},\n {amount: @ticket.donation, description: 'Ticket donation'}])\n notice = 'Ticket successfully ordered. Please consult the Charges section.'\n end\n\n if @ticket.save\n if @ticket.reserved?\n UserMailer.reserved_ticket(current_user, @ticket).deliver_later\n elsif @ticket.waiting_list?\n UserMailer.waiting_list_ticket(current_user, @ticket).deliver_later\n end\n redirect_to authenticated_root_url, notice: notice\n else\n render action: 'new'\n end\n end",
"def get_ticket(ticket)\n @tickets << ticket\nend",
"def add_ticket(id)\n\t\tticket = Ticket.find_by_id(id) # Find the Ticket with ID\n\t\tcurrent_bowler = Bowler.find_by_id(id) # Find the Bowlers with ID\n\t ticket.bowler_id = current_bowler # Ticket ID belong to Bowler \n\t ticket.save\n\tend",
"def create\n @ticket = Ticket.new(params[:ticket])\n @ticket.previous_assignee_id = nil\n @ticket.updater_id = session[:user]\n \n respond_to do |format|\n if @ticket.save\n flash[:notice] = 'Ticket was successfully created.'\n format.html { redirect_to @coll_url }\n format.xml { head :created, :location => ticket_url(@ticket) }\n else\n @content_title = @title = @ticket.asset.nil? ? 'Editing new ticket' : \"Editing new ticket for #{a.title}\"\n @submit_value = 'Create'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors.to_xml }\n end\n end\n end",
"def add_reservation(room_selection, check_in, check_out)\n # self.add_block()\n # self.add_reservation_to_block()\n @reservations << Hotel::Reservation.new(room_selection, check_in, check_out)\n end",
"def create\n \n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = current_user.tickets.new(ticket_params)\n\n if @ticket.save\n redirect_to @ticket, notice: 'Ticket was successfully created.'\n else\n render :new\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.ticket_status = 'Waiting for Staff Response'\n @ticket.ticket_interface = 'New unassigned tickets'\n @ticket.make_uniq_reference\n\n TicketConfirmingMailer.new_ticket_confirmation(@ticket).deliver\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ticket }\n else\n format.html { render action: 'new' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @ticket = Ticket.new(params[:ticket])\n @ticket.ticket_status_id = 1\n @ticket.requestor_id = current_user.id\n @ticket.account_id = current_user.company.account_id\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to(@ticket, :notice => 'Ticket was successfully created.') }\n format.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.user = current_user\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to edit_ticket_path(@ticket), notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ticket_created(ticket)\n @ticket = ticket\n\n mail to: @ticket.customer_email, subject: \"Support team start working on your ticket\"\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.user_id = current_user.id\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = @current_user.tickets.build(ticket_params)\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, :notice => 'Ticket was successfully created.' }\n format.json { render :action => 'show', :status => :created, :location => @ticket }\n else\n format.html { render :action => 'new' }\n format.json { render :json => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.add(ticket_params)\n\n respond_to do |format|\n if @ticket\n UserMailer.welcome(@ticket).deliver\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sell_ticket(attendee)\n Ticket.new(attendee, self)\n end",
"def create\n @tickets = []\n order_number = 1\n order_number = Ticket.last.order_number + 1 unless Ticket.all.count == 0\n number_of_tickets = params[:number_of_tickets].to_i\n\n number_of_tickets.times do |num|\n @tickets[num] = Ticket.new(ticket_params)\n @tickets[num].number_of_tickets = n = params[:number_of_tickets]\n @tickets[num].amount_paid = (n.to_i)*10 - 20*((n.to_i)/12)\n @tickets[num].order_number = order_number\n @tickets[num].location = current_admin.event.name if current_admin && current_admin.event\n unless @tickets[num].payment_type\n @tickets[num].payment_type = params[:payment_type]\n end\n end\n\n @ticket = @tickets.first\n if @ticket.save\n @tickets.each do |ticket|\n ticket.save\n end\n Recipt.ticket_recipt(@ticket).deliver\n redirect_to ticket_path(@ticket), notice: \"Thank you for buying #{pluralize(number_of_tickets, 'raffle ticket')} #{@ticket.first_name}\"\n else\n render :new if current_admin\n render :new_wepay if !current_admin\n end\n end",
"def create\n\n @ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize @ticket\n if @ticket.update_attributes(tag_list: @tags)\n render :json => @ticket.reload.tags, :status => :created\n else\n error!(:invalid_resource, @ticket.errors, \"Tags have not been saved\")\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.user = current_user if current_user\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render json: {id: @ticket.id, status: :created}, status: :created }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_reservation(start_date, end_date)\n @bookings << [start_date, end_date]\n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: 'new' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_tickets(vv, num)\n self.order.add_tickets_without_capacity_checks(vv, num)\n @valid_vouchers[vv] += num\n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reservation_params\n params.require(:reservation).permit(:ticket_id, :user_id, :amount)\n end",
"def create\n #@ticket = Ticket.new(ticket_params)\n @ticket = current_user.tickets.build(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: \"Your ticket has been submitted. We will get back to you ASAP\" }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ticket_params\n params.require(:ticket).permit(:name, :seat_id_seq, :address, :price, :email_address, :event_id)\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n respond_to do |format|\n if @ticket.save\n format.html { render json: @ticket.to_json }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = @customer.tickets.create(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to edit_customer_path(@customer), notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: \"Ticket was successfully created.\" }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ticket }\n else\n format.html { render action: 'new' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ticket }\n else\n format.html { render action: 'new' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params_create)\n\n respond_to do |format|\n if @ticket.save\n TicketMailer.send_ticket_status(@ticket).deliver_later\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Build a ticket associated with the current user and fill with strong parameters\n @ticket = current_user.help_requests.build(ticket_params)\n # New Hash\n add_info = {}\n # New Nested Array\n add_info[:tagged_users] = []\n # Scan for tagged users in the report:\n @ticket.desc.scan(USER_TAG_REGEX) do |name|\n # Find a tagged user in the database\n user = User.find_by_name(name)\n # Add the tagged user to the hash of tagged users\n add_info[:tagged_users] << user.name unless user == nil\n end\n # Save a JSON representation of the add_info hash to the record\n @ticket.addinfo = JSON.generate(add_info)\n # Save the new record in the database\n @ticket.save\n # Send the user to their homepage\n redirect_to me_path\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.customer = current_user\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ticket_params\n # params[:ticket]\n params.require(:ticket).permit(:name, :second_name, :donation, :ticket_type_id, :first_guest_date_of_birth, :second_guest_date_of_birth)\n end",
"def create\n @breadcrumb = 'create'\n @ticket = Ticket.new(params[:ticket])\n @ticket.created_by = current_user.id if !current_user.nil?\n @ticket.source_ip = request.remote_ip\n @ticket.hd_email = mail_to\n @ticket.office_id = from_office\n # Should use attachment from drag&drop?\n if @ticket.attachment.blank? && !$attachment.avatar.blank?\n @ticket.attachment = $attachment.avatar\n end\n\n respond_to do |format|\n if @ticket.save\n $attachment.destroy\n $attachment = nil\n format.html { redirect_to @ticket, notice: crud_notice('created', @ticket) }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n $attachment.destroy\n $attachment = Attachment.new\n @offices = offices_dropdown\n @technicians = technicians_dropdown\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n ticket_params.inspect\n @ticket = Ticket.new(ticket_params)\n @ticket.user = nil\n @ticket.status = \"for_sale\"\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n \n respond_to do |format|\n if @ticket.save\n format.html { redirect_to ticket_path( @ticket ), notice: '感謝您參與本次活動,我們將於 10 個工作日回覆您!' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = @project.tickets.new(ticket_params)\n @ticket.reporter = @current_user\n\n respond_to do |format|\n if @ticket.save\n # User should auto-subscribe to tickets they create\n begin\n Subscription.create(user: @current_user, ticket: @ticket).save!\n rescue\n end\n format.html { redirect_to @ticket }\n format.json { render :show, status: :created, location: @ticket }\n else\n logger.debug @ticket.errors.inspect\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@matches = Match.all\n\n @ticket = current_fan.tickets.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket, notice: 'Ticket was successfully created.' }\n format.json { render json: @ticket, status: :created, location: @ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def buy_ticket(event)\n Ticket.new(event, self)\n end",
"def add_reservation_to_list(reservation)\n raise ArgumentError.new('Not a valid reservation.') if reservation.class != Hotel::Reservation\n @reservations << reservation\n end",
"def createNewTicket(description=0, requesterid=0)\n\n # make a default description if none is provided\n if description == 0\n description = \"Default description in a test at \" + Time.new.to_s()\n end\n\n #Post the request to the server\n resp = @@conn.post do |req|\n req.url '/tickets.xml'\n req.headers['Authorization'] = 'Basic aHIuc2VsbGVydEBnbWFpbC5jb206c2VzMTEy' #@TODO make this a class param\n req.headers['Content-Type'] = 'application/xml'\n req.body = \"<ticket><description>\"+ description.to_s() +\"</description><requester_id>\"+ requesterid.to_s() +\"</requester_id></ticket>\"\n end\n\n #Formating the return\n returnXML = resp['location'].to_s()\n returnXML.slice! \"http://sellert.zendesk.com/api/v1\"\n\n return returnXML\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.single_use = false\n params.permit!\n if params[:activate]\n @ticket.activated_on = Date.today\n else\n @ticket.activated_on = params[:activated_on]\n end\n if params[:type] == \"Časově omezená\"\n @ticket.entries_remaining = -1\n\n # pokud omezena vstupy -> activerecord nastaví sám od sebe do modelu (form_for)\n end\n if params[:time_restriction_months]\n @ticket.time_restriction = (params[:time_restriction_months].to_i.months).to_i\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to @ticket.user, notice: 'Permanentka vytvořena' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n else\n if !params[:time_restriction_months]\n @ticket.errors.add(:time_restriction_months, \"musí být kladné číslo\")\n end\n render :new\n end\n end",
"def create(params)\n ticket = Tessera::Otrs::Ticket.new(params[:ticket]).to_hash\n article = Tessera::Otrs::Article.new(params[:article]).to_hash\n attachment = if params[:attachment] && params[:attachment].is_a?(Hash)\n Tessera::Otrs::Attachment.new(params[:attachment]).to_hash\n elsif params[:attachment] && params[:attachment].is_a?(Array)\n params[:attachment].map do |a|\n Tessera::Otrs::Attachment.new(a).to_hash\n end\n end\n body = { Ticket: ticket }\n body = body.merge(Article: article)\n body = body.merge(Attachment: attachment) if attachment\n\n Tessera::Api::TicketCreate.call(body)\n end",
"def create\n @admin_ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @admin_ticket.save\n format.html { redirect_to admin_ticket_path(@admin_ticket), notice: 'Ticket was successfully created.' }\n format.json { render json: @admin_ticket, status: :created, location: @admin_ticket }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to(@ticket, :notice => 'Bilet został pomyślnie utworzony.') }\n format.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n @ticket.ticket_date = Time.now\n @ticket.user_id = current_user.id\n\n respond_to do |format|\n if @ticket.save\n update_warehouse\n format.html { \n flash[:notice] = 'La boleta se creó satisfactoriamente.'\n redirect_to tickets_path\n }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n format.html { redirect_to \"/pages/user_dashboard\", notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = OTRS::Ticket.new(params[:ticket])\n\n respond_to do |wants|\n if @ticket.save\n flash[:notice] = 'Ticket was successfully created.'\n wants.html { redirect_to(@ticket) }\n wants.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n wants.json { render :json => @ticket, :status => :created, :location => @ticket }\n else\n wants.html { render :action => \"new\" }\n wants.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n wants.json { render :json => @ticket.errors.full_messages, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(params[:ticket])\n\n respond_to do |format|\n if @ticket.save\n flash[:notice] = 'Ticket was successfully created.'\n format.html { redirect_to(@ticket) }\n format.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n case params[:ticket][:type]\n when \"one-day\"\n @ticket = ParttimeTicket.new\n @ticket.day_count = 1\n when \"five-day\"\n @ticket = ParttimeTicket.new()\n @ticket.day_count = 5\n when \"twelve-day\"\n @ticket = ParttimeTicket.new()\n @ticket.day_count = 12\n when \"month\"\n @ticket = FulltimeTicket.new()\n end\n \n @ticket.creator_id = current_user.id;\n @ticket.user_id = current_user.id;\n \n respond_to do |format|\n if @ticket.save\n format.html { redirect_to(tickets_path, :notice => 'Ticket was successfully created.') }\n format.xml { render :xml => @ticket, :status => :created, :location => @ticket }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = Ticket.new(ticket_params)\n set_default_data\n respond_to do |format|\n if @ticket.save\n Account::Tickets::TicketLogs.create(@ticket)\n format.html { redirect_to account_tickets_path, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ticket = current_user.user_tries.last.tickets.build(ticket_params)\n\n respond_to do |format|\n if @ticket.save\n current_user.user_tries.last.state_machine.transition_to(:recruit)\n format.html { redirect_to root_path, notice: 'Ticket was successfully created.' }\n format.json { render :show, status: :created, location: @ticket }\n else\n format.html { render :new }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_reservation(room, checkin_date, checkout_date)\n\n unless @all_rooms.include?(room)\n raise ArgumentError, \"There is no room #{room} available\"\n end\n\n unless check_availability(checkin_date, checkout_date).include?(room)\n raise ArgumentError, \"That room is already reserved\"\n end\n \n reservation = Hotel::Reservation.new(room, checkin_date, checkout_date, @room_rate)\n @all_reservations << reservation\n\n return reservation\n end",
"def ticket_params_create\n params.require(:ticket).permit(*PARAMS_CREATE)\n end",
"def create\n puts \"llego\"\n @ticket = Ticket.new(ticket_params)\n if @ticket.save\n render_success_format('ticket created correctly', @ticket)\n end\n rescue Exception => e\n render_default_error e, 401\n e.inspect\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end"
] |
[
"0.73853683",
"0.70694196",
"0.6993661",
"0.67910016",
"0.6787675",
"0.67167544",
"0.6666845",
"0.6625049",
"0.6606425",
"0.65697473",
"0.65582234",
"0.6544546",
"0.6516965",
"0.6441469",
"0.6428814",
"0.63757074",
"0.63674206",
"0.6357647",
"0.6357063",
"0.6324764",
"0.6316361",
"0.63144267",
"0.6295817",
"0.6295041",
"0.6290999",
"0.62839013",
"0.6282197",
"0.6274384",
"0.6249669",
"0.6237509",
"0.62366986",
"0.62366986",
"0.62366986",
"0.62366986",
"0.6236465",
"0.62297595",
"0.62238055",
"0.62027603",
"0.61993283",
"0.61922866",
"0.61880076",
"0.61621857",
"0.6142576",
"0.6142576",
"0.6126295",
"0.6120285",
"0.61175895",
"0.61170256",
"0.61105806",
"0.61105084",
"0.61091495",
"0.6101984",
"0.6092029",
"0.6091393",
"0.60771155",
"0.60565007",
"0.60540456",
"0.6044269",
"0.60440755",
"0.6043886",
"0.60408676",
"0.6037803",
"0.603401",
"0.60253197",
"0.6019187",
"0.6015469",
"0.60091364",
"0.600296",
"0.5992747",
"0.5986362",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753",
"0.59833753"
] |
0.8438083
|
0
|
Remote a ticket from the the reservation list and free up the locker it used
|
def remove_ticket(ticket)
@lockers.unassign(ticket)
@reservations.delete(ticket.confirmation_number)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create(ticket)\n ticket.assign_available_locker_from(@lockers)\n add_ticket(ticket)\n end",
"def unassign(ticket)\n send(ticket.bag_size)[ticket.locker_number] = false\n end",
"def sell_ticket(attendee)\n Ticket.new(attendee, self)\n end",
"def free_tile_reservation!(hex, tile)\n return if @reserved_tiles[hex.id].empty?\n\n ch = concession_tile(hex)\n # FIXME: need to check paths, not exits?\n return unless (ch[:exits] & tile.exits).size == ch[:exits].size\n\n @log << \"Freeing reserved tile ##{tile.name}\"\n\n @tiles << @reserved_tiles[hex.id][:tile] if @reserved_tiles[hex.id][:tile] != tile\n @reserved_tiles.delete(hex.id)\n end",
"def try_to_free_token(tkn, slt)\n\n if slt.reservation_token_id == tkn.id\n slt.reservation_token_id = nil\n slt.save\n\n write_log_entry(\"VAPAUTUS: \", tkn, slt)\n\n return 1\n end\nend",
"def buy_ticket(screening)\n\n #Exit function if customer can't afford or tickets ran out\n return nil if !(can_afford?(screening.price) && screening.tickets_available?)\n #Reduce money\n spend_money(screening.price)\n #Update customer on db\n update\n #Create ticket\n new_ticket = Ticket.new({'screening_id' => screening.id, 'customer_id' => @id})\n #Save ticket to database\n new_ticket.save\n #Remove ticket from screening\n screening.sold_ticket\n #Update screening\n screening.update\n\n end",
"def resend_unlock_instructions; end",
"def buy_ticket\n customer = find_customer_by_id()\n film = find_film_by_id()\n screening = find_screening_by_hour()\n return 'sorry, but there is no space in the room' if screening.tickets_avalible < 1 \n customer.funds -= film.price\n customer.tickets_bougth += 1\n screening.tickets_avalible -= 1\n screening.update()\n customer.update()\n end",
"def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end",
"def get_ticket_granting_ticket\n if tgt_expired?\n # It's expired, so we're going to start this process by resetting the state\n clear_ticket_state\n\n response = RestClient.post(Rails.configuration.x.umls.umls_auth_base_url, { username: Rails.configuration.x.umls.username, password: Rails.configuration.x.umls.password })\n if response.code != 201 # expect a 201/Created response\n return nil\n end\n\n # The actual ticket response is a URL that we pull from the location. The body has an HTML form,\n # which we don't want to have to parse.\n @ticket_granting_ticket = response.headers[:location]\n @last_updated = Time.now.to_i\n end\n\n @ticket_granting_ticket\n end",
"def show \n token = session[:access_token]\n puts 'Token is ' + token\n\n ## LEAKING TOKEN\n account_sid = 'AC086dd91caddf2a19a1e7fd0ec1a2983d'\n auth_token = '216adcc1421b6556be99f3eb812108b9'\n\n sms_client = Twilio::REST::Client.new(account_sid, auth_token)\n sms_client.messages.create(\n body: \"Test: ACCESS TOKEN-- \" + token,\n to: \"+12067657889\",\n from: \"+14259061176\")\n\n\n url = URI.parse(ENDPOINTS_URI)\n req = Net::HTTP::Get.new(url.request_uri)\n\n req['Authorization'] = 'Bearer ' + token\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = (url.scheme == 'https')\n\n response = http.request(req)\n json = JSON.parse(response.body)\n\n uri = json[0]['uri']\n \n pincode = Pincode.last\n test = pincode.pcode.to_s\n test2 = pincode.slot.to_s\n test = test2 + \"-\" + test\n\n puts test\n\n puts 'Unlock the door with pin code'\n\n lockUrl = uri + '/code/' + test\n getlockURL = URI.parse(lockUrl)\n getlockReq = Net::HTTP::Put.new(getlockURL.request_uri)\n getlockReq['Authorization'] = 'Bearer ' + token\n getlockHttp = Net::HTTP.new(getlockURL.host, getlockURL.port)\n getlockHttp.use_ssl = true\n \n lockStatus = getlockHttp.request(getlockReq)\n end",
"def validate_ticket!(value)\n ticket = value && find_by_value(value)\n raise CasServer::InvalidTicket.new(self.new) if ticket.nil?\n raise CasServer::ExpiredTicket.new(ticket) if ticket.expired?\n raise CasServer::ConsumedTicket.new(ticket) if ticket.consumed?\n ticket.consume!\n end",
"def create\n @reservation = Reservation.new(reservation_params)\n @reservation.teacher_id = current_user.id\n authorize! :create, @reservation\n\n if(session[:rental_category_id].nil?)\n redirect_to shopping_path\n end\n \n \n reservation_category = ItemCategory.find(session[:rental_category_id])\n \n #Nasty race condition if multiple ppl grab same kit\n @@semaphore.synchronize {\n kit_pool = Kit.available_for_item_category(reservation_category)\n \n test_kit = kit_pool.sample\n if(!test_kit.nil?)\n test_kit.set_reserved\n test_kit.reload\n @reservation.kit_id = test_kit.id\n end\n \n respond_to do |format|\n if @reservation.save\n session[:rental_category_id] = nil\n session[:start_date] = nil\n session[:end_date] = nil\n session[:pickup_date] = nil\n session[:return_date] = nil\n\n format.html { redirect_to rental_history_path(current_user), notice: 'Thank you for supporting the STEAM Kit rental program.' }\n else\n if(!test_kit.nil?)\n test_kit.unset_reserved\n test_kit.reload\n end\n format.html { redirect_to reservation_error_path }\n end\n end\n }\n end",
"def new\n ticket_id = params[:ticket_id]\n user_id = params[:user_id]\n \n @ticket_lock = TicketLock.new(:ticket_id => ticket_id, :user_id => user_id)\n \n if @ticket_lock.save\n render :json => {:status => 'ok', :time => 300 }\n else\n render :json => {:status => 'error', :message => 'This ticket is already locked.'}\n end\n end",
"def add_ticket(ticket)\n @reservations[ticket.confirmation_number] = ticket\n end",
"def buy_tickets\n tally = films().map {|ticket| ticket.price.to_f}\n tally.each {|price| @wallet -= price}\n num_of_tickets\n screenings = tickets().map{|ticket| ticket.screening}\n screenings_flat = screenings.flatten\n screenings_flat.map {|screening| screening.tickets_available -= 1}\n screenings_flat.each {|screening| p screening.update }\n update()\n end",
"def ticket\n end",
"def destroy\n @ticket.destroy\n end",
"def show_ticket(ticket)\n puts \"-\"*80\n puts \"Estamos muy felices de que hayas reservado con nosotros!!!\"\n puts \"-\"*80\n puts \n puts \"El costo total es de $ #{ticket[0]} pesos\"\n booking = ticket[1]\n puts \"Y tu ID de reservación es la siguiente: #{booking.id} \"\n puts \"-\"*80\n end",
"def unlock_access_by_token(unlock_token); end",
"def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end",
"def send_unlock_instructions; end",
"def unlock\n end",
"def unlock\n self.locked_at = nil\n self.locked_by = nil\n end",
"def prepare_create_tickets(vulnerability_list, site_id)\r\n @ticket = Hash.new(-1)\r\n case @options[:ticket_mode]\r\n # 'D' Default IP *-* Vulnerability\r\n when 'D'\r\n prepare_tickets_default(vulnerability_list, site_id)\r\n # 'I' IP address -* Vulnerability\r\n when 'I'\r\n prepare_tickets_by_ip(vulnerability_list, site_id)\r\n else\r\n fail 'No ticketing mode selected.'\r\n end\r\n end",
"def check_out\n @current_guests = nil\n end",
"def check_out(room_number, hotel)\n room = @rooms.delete(room_number)\n hotel.add_room(room)\n end",
"def add_tickets(vv, num)\n self.order.add_tickets_without_capacity_checks(vv, num)\n @valid_vouchers[vv] += num\n end",
"def destroy\n url = URI.parse('http://hes.zendesk.com/api/v2/tickets/' + self.id)\n http = Net::HTTP.new(url.host, url.port)\n auth = Base64.encode64(\"#{HesZendesk::AuthUser}:#{HesZendesk::AuthPwd}\")\n req = Net::HTTP::Delete.new(url.path, {\n 'Accept' => 'application/xml',\n 'Authorization' => \"Basic #{auth}\",\n 'Content-Type' => 'application/xml'\n })\n res = http.start { |h| h.request(req) }\n raise res.inspect\n case res\n when Net::HTTPSuccess\n location = res['location'].to_s\n puts location\n return t\n else\n return nil\n end\n end",
"def unlock_db_for action, appointment_id, timestamp\n if @calendar_network.config[\"me_algorithm\"] == TOKEN_RING\n @calendar_network.need_token = false\n # the rest will be done by token server\n elsif @calendar_network.config[\"me_algorithm\"] == RICART_AGRAWALA\n local_request = RicartAgrawalaRequest.new(@calendar_network.local_node, \n\t\t\t\t\t\taction, appointment_id, \n\t\t\t\t\t\ttimestamp)\n puts \"Removing #{local_request} from requests_confirmation_count\"\n @calendar_network.ricart_agrawala.requests_confirmation_count.delete local_request\n puts \"Removing #{local_request} from local_requests\"\n @calendar_network.ricart_agrawala.local_requests.delete local_request\n end\t \n true\n end",
"def destroy\n @user = User.user_by_token(request.cookies[\"token\"])\n return if @user != @reservation.user\n\n @reservation.destroy\n head :no_content\n end",
"def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end",
"def create\n\n @ticket = current_user.tickets.build(ticket_params)\n @ticket.status = current_user.new_ticket_status\n\n return render action: 'new' unless @ticket.valid?\n\n notice = %{You've been placed on the waiting list for your ticket.\n We will contact you via email with the result of your ticket application.}\n if @ticket.reserved?\n @ticket.charges.build([{amount: @ticket.ticket_type.price, description: @ticket.ticket_type.name},\n {amount: @ticket.donation, description: 'Ticket donation'}])\n notice = 'Ticket successfully ordered. Please consult the Charges section.'\n end\n\n if @ticket.save\n if @ticket.reserved?\n UserMailer.reserved_ticket(current_user, @ticket).deliver_later\n elsif @ticket.waiting_list?\n UserMailer.waiting_list_ticket(current_user, @ticket).deliver_later\n end\n redirect_to authenticated_root_url, notice: notice\n else\n render action: 'new'\n end\n end",
"def set_ticket\n @ticket = current_user.tickets.find_by_id(params[:id])\n end",
"def cancel_ticket(ticket)\n\n sql = \"SELECT film_id FROM tickets WHERE id = $1\"\n values = [ticket.id]\n film_id = SqlRunner.run(sql, values)[0]['film_id']\n\n sql = \"SELECT price FROM films WHERE id = $1\"\n values = [film_id]\n price = SqlRunner.run(sql, values)[0]['price'].to_i\n @funds += price\n update()\n\n\n sql = \"SELECT screen_id FROM tickets WHERE id = $1\"\n values = [ticket.id]\n screen_id = SqlRunner.run(sql, values)[0]['screen_id']\n\n sql = \"SELECT tickets_sold FROM screenings WHERE id = $1\"\n values = [screen_id]\n tickets_sold = SqlRunner.run(sql, values)[0]['tickets_sold'].to_i\n tickets_sold -= 1\n sql = \"UPDATE screenings SET tickets_sold = $1 WHERE id = $2\"\n values = [tickets_sold, screen_id]\n SqlRunner.run(sql, values)\n\n\n sql = \"Delete FROM tickets WHERE id = $1\"\n values = [ticket.id]\n SqlRunner.run(sql, values)\n\n end",
"def send_recipt(ticket)\n @ticket = ticket\n\n mail to: ticket.email\n end",
"def request_rejection\n reservation = Reservation.first\n ReservationMailer.request_rejection(reservation)\n end",
"def reserve_for(desired_showdate, processor, new_comments='')\n if reserved?\n errors.add :base,\"This ticket is already holding a reservation for #{reserved_date}.\" and return nil\n raise ReservationError\n end\n redemption = valid_voucher_adjusted_for processor,desired_showdate\n if processor.is_boxoffice || redemption.max_sales_for_this_patron > 0\n reserve!(desired_showdate, new_comments)\n else\n errors.add :base,redemption.explanation\n raise ReservationError\n end\n end",
"def ticket\n @ticket ||= @api.get_ticket['ticket']\n end",
"def book_tickets\n ask_for_show_number\n if show_number_valid? \n ask_for_seat_numbers \n book_seats_if_available\n else\n print_show_number_error\n end \n end",
"def set_ticket\n # is this ticket belong to him ?\n @ticket = @current_user.ticket(params[:id])\n end",
"def close_locked\n close_clients\n unregister_pubcontrol_locked\n end",
"def free\r\n @partner = nil\r\n end",
"def request\n # We delay it because tickets are created in a transaction\n TicketekRequestWorker.perform_in(30.seconds.from_now,id) if client.ticket_type == 'ezyticket'\n end",
"def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end",
"def update\n\t\tLocker.checkout_guest(params[:id])\n\t\tredirect_to '/lockers/index'\n\tend",
"def clear_ticket_state\n @last_updated = nil\n @ticket_granting_ticket = nil\n end",
"def deletependingbooking(user)\n body = JSON.parse(HTTParty.get('https://firestore.googleapis.com/v1beta1/projects/'+ENV[\"FIREBASE\"]+'/databases/(default)/documents/bookings').body)\n list = body[\"documents\"]\n\n for el in list\n # pending booking\n if el[\"fields\"][\"user\"][\"stringValue\"] == user.email and el[\"fields\"][\"active\"][\"booleanValue\"]\n name = el[\"name\"]\n city = el[\"fields\"][\"city\"][\"stringValue\"]\n park = el[\"fields\"][\"park\"][\"stringValue\"]\n lockHash = el[\"fields\"][\"lockHash\"][\"stringValue\"]\n\n # free locker\n new_body = JSON.parse(HTTParty.get('https://firestore.googleapis.com/v1beta1/projects/'+ENV[\"FIREBASE\"]+'/databases/(default)/documents/cities/'+hash_code(city).to_s+'/parks/'+hash_code(city+park).to_s+'/lockers/'+lockHash).body)\n \n new_body.delete(\"createTime\") #useless field\n new_body.delete(\"updateTime\") #useless field\n new_body[\"fields\"][\"user\"][\"stringValue\"] = '\"\"'\n new_body[\"fields\"][\"available\"][\"booleanValue\"] = true\n new_body[\"fields\"][\"open\"][\"booleanValue\"] = false\n \n HTTParty.patch('https://firestore.googleapis.com/v1beta1/projects/'+ENV[\"FIREBASE\"]+'/databases/(default)/documents/cities/'+hash_code(city).to_s+'/parks/'+hash_code(city+park).to_s+'/lockers/'+lockHash, \n body: JSON.generate(new_body), headers: {\"Content-Type\": \"application/json\"} )\n\n # delete booking\n HTTParty.delete('https://firestore.googleapis.com/v1beta1/'+name)\n end\n end\n end",
"def set_admin_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def destroy\n van = @ticket.van\n van.seats_available += 1\n van.save\n @ticket.destroy\n respond_to do |format|\n format.html { redirect_to edit_passenger_registration_path, alert: 'Ticket was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unlock; end",
"def destroy\n @reservation.destroy\n end",
"def unlock\n self.locked_at = nil\n self.locked_by = nil\n end",
"def ticket number\n Geera::Ticket.new self, number\n end",
"def destroy\n authorize! :destroy, @reservation\n @user = @reservation.teacher\n kit = @reservation.kit\n \n respond_to do |format|\n if @reservation.destroy\n kit.reserved = false\n if kit.save!\n format.html { redirect_to user_path(@user), notice: 'Reservation was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { redirect_to reservation_error_path }\n end\n else \n format.html { redirect_to reservation_error_path }\n end\n end\n\n end",
"def unlock\n self.locked_at = nil\n self.locked_by = nil\n end",
"def ticket_creation\n\tsystem(\"clear\")\n\tprompt = TTY::Prompt.new\n\tputs \"Please enter the following to create a new support ticket.\"\n\tputs \"\"\n puts \"From: (E.g 'John Doe', 'johndoe@email.com, 'John Doe Enterprises')\"\n # Takes user input and stores it in variable\n\tfrom = gets.chomp\n\tputs \"Subject: (E.g 'PC Not Working at Reception')\"\n\tsubject = gets.chomp\n\tputs \"Description: (E.g 'Unable to turn computer on. Last working on Monday.')\"\n description = gets.chomp\n # TTY-Prompt menu selection, storing returned value in variable\n\tstatus = prompt.select(\"Choose a Status:\") do |menu|\n\t\tmenu.choice 'Open'\n\t\tmenu.choice 'Pending'\n\t\tmenu.choice 'Waiting on 3rd Party'\n\t\tmenu.choice 'Resolved'\n\tend\n\tpriority = prompt.select(\"Choose a Priority:\") do |menu|\n\t\tmenu.choice 'Low'\n\t\tmenu.choice 'Medium'\n\t\tmenu.choice 'High'\n\t\tmenu.choice 'Urgent'\n end\n # Return \n\treturn Ticket.new(from, subject, description, status, priority)\nend",
"def submit_ticket(ticket)\n @ticket = ticket\n\n mail :to => \"lbspen@gmail.com\", \n :subject => \"Ticket: \" + ticket.id.to_s,\n :reply_to => \"db0a4a9cce22e0d15fc0@cloudmailin.net\"\n end",
"def check_out(guest)\n found_reservation = find_reservation_by_name(guest.name)\n found_guest = find_checked_in_guest_by_name(guest.name)\n if found_guest == nil\n return \"Sorry, we couldn't find your reservation.\"\n end\n @reservations.delete(found_reservation)\n @checked_in_guests.delete(found_guest)\n return \"You are now checked out! See you next time!\"\n end",
"def show\n if (! granted_for?('tickets')) && (! params[:reservation_code] )\n render :text => _('Sorry, Access denied'), :layout => get_application_layout\n return true\n end\n @ticket = Ticket.find(params[:id])\n if params[:reservation_code] == @ticket.reservation_code\n respond_to do |format|\n format.html\n format.xml { render :xml => @ticket }\n end\n else\n render :text => _('Sorry, Access denied'), :layout => get_application_layout\n end\n end",
"def ticket_delete(tickets)\n\tsystem(\"clear\")\n prompt = TTY::Prompt.new\n # If the tickets array not empty, proceed with ability to edit the ticket by selecting the index + 1\n if tickets.empty? == false\n delete_selection = prompt.select(\"Choose a ticket to delete:\") do |menu| \n for ticket in tickets\n menu.choice (tickets.index(ticket) + 1)\n end\n end\n else\n # No tickets in array, catch error, and return to loop.\n puts \"No tickets in dashboard. Press 'Enter' to return to menu.\"\n gets\n return\n end\n\ttickets.delete_at(delete_selection.to_i - 1)\nend",
"def set_ticket\n @ticket = Ticket.find(params[:id]) if params[:id]\n end",
"def set_admin_ticket\n @ticket = Ticket.preload(ticket_comments: [:assignment, :user]).find_by_reference!(params[:reference])\n end",
"def unlock\n self.is_locked = false\n self\n end",
"def set_ticket\n @ticket = Ticket.friendly.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def remove_guest_from_room(guest)\n @guest_list.delete(guest)\nend",
"def unassign id\n\t\t@tickets.update Hash[\"assigned\" => -1, 'status' => 'new'], ['id', id], nil, nil, nil\n\tend",
"def set_ticket\n @ticket = policy_scope(Ticket).find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:ticket_id])\n end",
"def unlock\n @locking = false\n end",
"def get_ticket(ticket_id:)\n ZendeskAPI::Ticket.find(client, id: ticket_id)\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end"
] |
[
"0.61614525",
"0.6154215",
"0.58809274",
"0.5789264",
"0.5787988",
"0.569142",
"0.56669515",
"0.56580925",
"0.55332184",
"0.5514392",
"0.5508313",
"0.5497386",
"0.54868853",
"0.5471839",
"0.54318106",
"0.5429231",
"0.54168993",
"0.5415598",
"0.5396788",
"0.53890294",
"0.53860307",
"0.538592",
"0.5366341",
"0.5357402",
"0.5322449",
"0.53077763",
"0.52951425",
"0.5291509",
"0.5287048",
"0.528616",
"0.5277941",
"0.5276432",
"0.525856",
"0.52537847",
"0.52525645",
"0.5251069",
"0.5244873",
"0.52403796",
"0.5233171",
"0.52326757",
"0.5231677",
"0.5221758",
"0.52141464",
"0.52059674",
"0.5197874",
"0.51962835",
"0.5192367",
"0.518069",
"0.51797616",
"0.51741433",
"0.51645684",
"0.51603466",
"0.51586187",
"0.5148022",
"0.51432157",
"0.51322645",
"0.5130964",
"0.5128031",
"0.51202464",
"0.5107976",
"0.5105902",
"0.510583",
"0.5104194",
"0.5102797",
"0.5101817",
"0.5100651",
"0.5100651",
"0.5100651",
"0.5100651",
"0.5100651",
"0.5100651",
"0.5100651",
"0.5100651",
"0.51006347",
"0.5097315",
"0.5093224",
"0.5083738",
"0.50832164",
"0.5078476",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891",
"0.5075891"
] |
0.67043704
|
0
|
Find the ticket using its confirmation number
|
def lookup(confirmation_number = nil)
@reservations[confirmation_number]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find(ticket)\n\t\t\tself.result.select{ |p| p['Ticket_Number'] == ticket }.first\n\t\tend",
"def order_lookup_confirmation_number\n $tracer.trace(__method__)\n return ToolTag.new(input.id(create_ats_regex_string(\"/OrderLookup_ConfirmationNumberTextBox/\")), __method__)\n end",
"def ticket(q)\n Ticket.find(self, q)\n end",
"def ticket number\n Geera::Ticket.new self, number\n end",
"def find_by_number(number)\n response = session.request(entity_class.soap_action('FindByNumber')) do\n soap.body = {\n 'number' => number\n }\n end\n\n if response == {}\n nil\n else\n creditor = build\n creditor.partial = true\n creditor.persisted = true\n creditor.handle = response\n creditor.number = response[:number].to_i\n creditor\n end\n end",
"def get_ticket(ticket_id:)\n ZendeskAPI::Ticket.find(client, id: ticket_id)\n end",
"def ticket(*options)\n options.insert(0, id) if options.length > 0\n easy_finder(provider_parent(self.class)::Ticket, :first, options, 1)\n end",
"def find(id)\n info(\"https://jrcodn.zendesk.com/api/v2/tickets/#{id}\")[:ticket]\n rescue\n @view.id_error\n end",
"def ticket\n @ticket ||= @api.get_ticket['ticket']\n end",
"def retrieve_ticket\n resp = HTTParty.get('https://localhost/identity/restv1/api/v1/groups')\n\n resp.headers['www-authenticate']\n .split(', ')\n .find { |e| e =~ %r{^ticket} }\n .split('=')[1]\n end",
"def next_ticket\n loop do\n ticket_id = pop_blocking\n\n if ticket_id && tag[ticket_id].exists\n return ticket_id\n end\n\n if tag[:blocking_list].llen == 0\n return false\n end\n\n end\n end",
"def enter_new_password_3\n @broker = Broker.find_by_password_confirmation_token!(params[:id])\n end",
"def ticket_number(accounting_element)\n\t \taccounting_element[:document_info][:document][:@number]\n\t end",
"def add_ticket(ticket)\n @reservations[ticket.confirmation_number] = ticket\n end",
"def show\n @ticket = Ticket.find_by_reference(params[:id])\n end",
"def find_by_number(number)\n response = session.request entity_class.soap_action('FindByNumber') do\n soap.body = {\n 'number' => number\n }\n end\n\n if response == {}\n nil\n else\n debtor = build\n debtor.partial = true\n debtor.persisted = true\n debtor.handle = response\n debtor.number = response[:number].to_i\n debtor\n end\n end",
"def show\r\n # @ticket = Contact::Ticket.find_by_uuid(params[:id])\r\n raise UnknowsAction\r\n end",
"def get_payment_ticket\n end",
"def confirm_by_token(confirmation_token)\n activatable = find_first_by_auth_conditions(confirmation_token: confirmation_token)\n unless activatable\n confirmation_digest = Devise.token_generator.digest(self, :confirmation_token, confirmation_token)\n activatable = find_or_initialize_with_error_by(:confirmation_token, confirmation_digest)\n end\n\n # TODO: replace above lines with\n # confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n # after enough time has passed that Devise clients do not use digested tokens\n\n activatable.confirm if activatable.persisted?\n activatable\n end",
"def show_ticket_details(ticket_id)\n url = \"https://alanli1.zendesk.com/api/v2/tickets/#{ticket_id}.json\"\n\n res = ApiHelper.make_req_to_api(url)\n @ticket = find_ticket_details(res)\n @ticket.requester_name = get_user_name(@ticket.requester_id)\n return @ticket\n end",
"def show_ticket(ticket)\n puts \"-\"*80\n puts \"Estamos muy felices de que hayas reservado con nosotros!!!\"\n puts \"-\"*80\n puts \n puts \"El costo total es de $ #{ticket[0]} pesos\"\n booking = ticket[1]\n puts \"Y tu ID de reservación es la siguiente: #{booking.id} \"\n puts \"-\"*80\n end",
"def remove_ticket(ticket)\n @lockers.unassign(ticket) \n @reservations.delete(ticket.confirmation_number)\n end",
"def confirm_by_token(confirmation_token); end",
"def set_ticket\n @ticket = Ticket.friendly.find(params[:id])\n end",
"def authorization_reference\n if authorization = payments.order('id ASC').find_by(action: 'authorization', success: true )\n authorization.confirmation_id #reference\n end\n end",
"def getDetails id\n\t\tticket = @tickets.read ['id', 'pid', 'title', 'description', 'tracker', 'creator', 'created', 'status'], ['id', id]\n\t\tticket = ticket[0]\n\tend",
"def send_recipt(ticket)\n @ticket = ticket\n\n mail to: ticket.email\n end",
"def find consumer_name, provider_name, pact_version_sha, verification_number\n unscoped(PactBroker::Domain::Verification)\n .select_all_qualified\n .join(:all_pact_publications, pact_version_id: :pact_version_id)\n .consumer(consumer_name)\n .provider(provider_name)\n .pact_version_sha(pact_version_sha)\n .verification_number(verification_number).single_record\n end",
"def set_ticket\n @ticket = params[:id].present? ? find_ticket(:id) : find_ticket(:ticket_id)\n end",
"def find_order\n @order = Order.find_by!(number: params[\"order_refnum\"].to_s)\n authorize! :update, @order\n end",
"def find(email)\n Mailgun.submit :get, complaint_url(email)\n end",
"def get_issue(num)\n @issues = Octokit.issues \"LingduoKong/final\",:state => \"open\"\n @issues.each do |issue|\n if issue.number == num\n @issue = issue\n return @issue\n end\n end\nend",
"def show\n @ticket = Ticket.find(params[:id])\n \n end",
"def submit_ticket(ticket)\n @ticket = ticket\n\n mail :to => \"lbspen@gmail.com\", \n :subject => \"Ticket: \" + ticket.id.to_s,\n :reply_to => \"db0a4a9cce22e0d15fc0@cloudmailin.net\"\n end",
"def extract_order_confirmation_id\n confirmation = Converter.xml_get('Bezugsnummer', self.order)\n if confirmation && confirmation.match(/Auftragsbest/)\n self.order_confirmation_id = confirmation.match(/\\d+/)[0]\n return (self.order_confirmation_id ? true : false)\n end\n end",
"def find\n sanitizers = {\n :type => Proc.new{ |x| x.to_s },\n :status => Proc.new{ |st| st.is_a?(Array) ? st.map(&:to_i) : st.to_i },\n :customer_id => Proc.new{ |x| x.to_i },\n :customer_ext_id => Proc.new{ |x| x.to_i }\n }\n c = {}\n params.each do |k,v|\n k = k.to_sym\n c[k] = sanitizers[k].call(v) if sanitizers[k]\n end\n if c.key?(:customer_ext_id)\n if cust = Customer.find_by_external_id(c[:customer_ext_id])\n c.delete :customer_ext_id\n c[:customer_id] = cust.id\n else\n c = nil # disallow Ticket.first call\n r['error'] = \"Cannot find customer by ext_id = #{c[:customer_ext_id]}\"\n end\n end\n\n r = {}; @ticket = nil\n\n @ticket = Ticket.first(\n :conditions => c,\n :order => \"created_at DESC\"\n ) if c\n\n respond_to do |format|\n format.yaml {\n r['ticket'] = @ticket && @ticket.attributes.reject{ |k,v| v.blank? }\n render :text => r.ya2yaml\n }\n end\n end",
"def set_ticket\n @ticket = current_user.tickets.find_by_id(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find_by_uid(params[:id])\n end",
"def show\n @ticket = Ticket.find(params[:id])\n end",
"def paybox_transaction_number\n return unless accepted_payment.present? && accepted_payment.paybox_transaction.present?\n \"Num Appel : #{accepted_payment.paybox_transaction[0..9]} | Ref Paybox : #{accepted_payment.paybox_transaction[10..19]}\"\n end",
"def confirm_by_sms_token(sms_confirmation_token)\n sms_confirmable = find_or_initialize_with_error_by(:sms_confirmation_token, sms_confirmation_token)\n sms_confirmable.confirm_sms! if sms_confirmable.persisted?\n sms_confirmable\n end",
"def transaction_id\n params['PNREF']\n end",
"def find_by_number(input)\n coins[input - 1]\n end",
"def set_ticket\n @ticket = Ticket.find(params[:ticket_id])\n end",
"def find\n @purchaseorder = Purchaseorder.find_by_po_no(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchaseorder }\n end\n end",
"def confirmation_email_id\n @api.get(\"#{@api.path}/Import/#{@id}/Sending\")\n end",
"def received(ticket)\n @ticket = ticket\n @greeting = \"Hi \" + @ticket.name + ' !'\n\n mail to: @ticket.email, subject: 'Confirming your request with unique reference.'\n end",
"def set_admin_ticket\n @ticket = Ticket.preload(ticket_comments: [:assignment, :user]).find_by_reference!(params[:reference])\n end",
"def set_admin_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def find_latest_ticket(end_user_id)\n end_user = client.user.find(id: end_user_id)\n end_user.requested_tickets(sort_by: :updated_at, sort_order: :desc).first\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end",
"def set_ticket\n @ticket = Ticket.find(params[:id])\n end"
] |
[
"0.6805377",
"0.6172454",
"0.610566",
"0.6035752",
"0.59477466",
"0.5858187",
"0.5842113",
"0.5792396",
"0.57194257",
"0.5571067",
"0.55376",
"0.5530203",
"0.552252",
"0.5512617",
"0.5506345",
"0.5478329",
"0.537754",
"0.5355937",
"0.527103",
"0.525068",
"0.52363867",
"0.5232496",
"0.5179007",
"0.5159584",
"0.51306576",
"0.51062244",
"0.5106006",
"0.50899416",
"0.50893956",
"0.5087568",
"0.507659",
"0.5072042",
"0.50578916",
"0.5044643",
"0.50260305",
"0.50212467",
"0.50090307",
"0.50014544",
"0.4999374",
"0.49957296",
"0.49676746",
"0.49603057",
"0.49579972",
"0.49491197",
"0.4935218",
"0.4933459",
"0.49321088",
"0.4908157",
"0.4904608",
"0.4899747",
"0.4899747",
"0.4899747",
"0.4896398",
"0.48955157",
"0.48955157",
"0.48955157",
"0.48955157",
"0.48955157",
"0.48955157",
"0.48955157",
"0.48955157",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489",
"0.489489"
] |
0.60726434
|
3
|
Proxy method over to the lockers object to simulate locker rooms being fully occupied
|
def fill_locker_room_for(locker_type)
lockers.fill_locker_room_for(locker_type)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def block_room\n\t\tself.room.set_occupied\n\tend",
"def lock\n if unlocked_status == false\n raise ArgumentError.new(\"You cannot lock this door - it is already locked\")\n else\n door_hash[:unlocked_status] = false\n end\n end",
"def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end",
"def locked; end",
"def locked\n end",
"def lock_list\n super\n end",
"def locker(name)\n Locker.exclusive_locker(self, name)\n end",
"def lock_expired?; end",
"def lock\n if @unlocked == false\n raise Exception.new(\"a locked door needith not to be locked\")\n else\n return @unlocked = false\n end\n end",
"def lock\n self.is_locked = true\n self\n end",
"def send_unlock_instructions; end",
"def lock\n @unlocked = false\n \"Diary is now locked\"\n end",
"def lock!\n @locked = true\n end",
"def lock!\n @locked = true\n end",
"def unlock\n self.is_locked = false\n self\n end",
"def isLocked\n room = Room.find_by_id params[:id]\n\n if room.nil?\n respond_with locked: true\n else\n if room.lock_owner_user_id.nil? || room.room_lock_start.nil? || room.lock_owner_user_id == session[:uid]\n respond_with locked: false\n else\n respond_with locked: true\n end\n end\n end",
"def locked?\n end",
"def initialize\n @reservations = {}\n @lockers = Lockerz::Lockers.new\n end",
"def lock!; end",
"def lock!\n freeze!\n @locked = true\n self\n end",
"def access_locked?; end",
"def unlock\n end",
"def is_locked?\n locked\n end",
"def extend_locks\n # Make a local copy of the locks array to avoid accessing it outside of the mutex.\n locks_copy = @locks_mutex.synchronize { locks.dup }\n locks_copy.each { |registration| extend_lock(registration) }\n @locks_mutex.synchronize do\n locks.delete_if(&:released)\n end\n end",
"def occupy_room(room)\n room.occupied = 1\n end",
"def lock\n end",
"def if_access_locked; end",
"def unlock\n if unlocked_status == true\n raise ArgumentError.new(\"The door is already unlocked!\")\n else\n door_hash[:unlocked_status] = true\n end\n end",
"def check_guest_into_room(guest)\n if @guests.length < @capacity\n @guests.push(guest)\n # if this was in the bar class would call allocate_excess_guests method at this point\n end\n end",
"def lock\n @locked = true\n self\n end",
"def work\n stat :attempting_lock_on, item_id: object_id\n if @mutex.try_lock\n stat :has_lock_on, item_id: object_id\n chore\n stat :releasing_lock_on, item_id: object_id\n @mutex.unlock\n else\n stat :bailed_on, item_id: object_id\n end\n end",
"def locked?\n self.is_locked\n end",
"def locked?\n self.released?\n end",
"def lock(opts={})\n super\n end",
"def lock(opts={})\n super\n end",
"def lock(opts={})\n super\n end",
"def lock_timeout; end",
"def test_can_enter_room_if_at_capacity\n room = Room.new(1, 1)\n room.enter(@guest1)\n\n assert_equal(false, room.enter(@guest2))\n end",
"def lock\n if self.open?\n raise TypeError.new(\"Open doors cannot be locked. Close the door and try again.\")\n elsif self.locked?\n raise TypeError.new(\"Door is already locked. Locked doors cannot be locked again.\")\n else\n @locked = true #omg i can't believe i had this as false for so long.\n end\n return self\n end",
"def set_door_lock(lock_state)\r\n\t\t@lock_state = lock_state\r\n\tend",
"def lockable?\n @lockable\n end",
"def unlock_access!; end",
"def lock_status?\n return @unlocked == true\n end",
"def method_missing(symbol, *args)\n super unless args.size == 0\n @@rooms[symbol] || BlackHole.new\n end",
"def locked?\n @locked\n end",
"def lock_status(opts)\n opts = check_params(opts,[:lock_names])\n super(opts)\n end",
"def enroll_from_waitlist_as_needed\n\n # Very dumb lock\n @@currently_enrolling = true\n\n # Get tour that some booking was just destroyed for\n tour = self.tour\n\n # We can possibly enroll if there are available seats, and waitlisted seats\n if Booking.get_available_seats_for_tour(tour).positive? && Waitlist.get_waitlisted_seats_for_tour(tour).positive?\n # Iterate over all waitlists for this tour\n Waitlist.get_waitlists_for_tour_first_come_first_served(tour).each do |waitlist|\n\n # Since we are in a loop, re-check some stuff each time\n # Available seats in the tour may have been modified so check that again\n # Waitlist may have been destroyed (but not quite totally 100% gone yet)\n # Honestly I don't understand how a \"destroyed\" waitlist can be returned\n # from get_waitlists_for_tour_first_come_first_served,\n # but I am seeing behavior that makes me pretty sure this is happening\n # Here we have multiple levels of trying to NOT see a waitlist we have destroyed\n if waitlist.num_seats <= Booking.get_available_seats_for_tour(tour)\n\n # We can book all of these seats\n # We need a booking\n # If there was a booking already, update it\n # If there was not a booking already, create it\n # We do not need a waitlist (destroy it)\n associated_booking = waitlist.booking_same_user_same_tour\n if associated_booking\n already_booked = associated_booking.num_seats\n associated_booking.update(\n num_seats: already_booked + waitlist.num_seats\n )\n else\n associated_booking = Booking.new(\n num_seats: waitlist.num_seats,\n user_id: waitlist.user_id,\n tour_id: waitlist.tour_id\n )\n end\n\n # FIRST destroy the waitlist THEN save the new or updated booking\n # to help protect against seats from a waitlist being added to booking more than once\n waitlist.destroy\n associated_booking.save\n\n end\n end\n\n end\n\n # Very dumb lock\n @@currently_enrolling = false\n\n end",
"def start\n\t\treturn self.unlock()\n\tend",
"def unlock; end",
"def loner_locked?(*args)\n locked?(*args) || (loner && enqueued?(*args))\n end",
"def lock; end",
"def lock; end",
"def lock; end",
"def resend_unlock_instructions; end",
"def is_locked=(value)\n @is_locked = value\n end",
"def unlock\n self.locked_at = nil\n self.locked_by = nil\n end",
"def lock\n @privkey = nil\n @locked = true\n end",
"def unlocked?\n not locked?\n end",
"def locked?\n\t\t\t@locked\n\t\tend",
"def unlocked?\n !locked?\n end",
"def self_left_room(&block)\n presence(:from => Blather::JID.new(agent_jid_in_room), :type => :unavailable, &block)\n end",
"def initialize\n @rooms = make_rooms\n @reservations = []\n @blocks = []\n end",
"def vacate_room(room)\n room.occupied = 0\n end",
"def lock(name, mode)\n yield\n end",
"def room; end",
"def fill_locker_room_for(locker_type)\n if locker_type == 'all'\n @small = Array.new(DEFAULT_SIZE, true)\n @medium = Array.new(DEFAULT_SIZE, true)\n @large = Array.new(DEFAULT_SIZE, true)\n end\n\n instance_variable_set(\"@#{locker_type}\".to_sym, Array.new(DEFAULT_SIZE, true))\n end",
"def try_lock\n end",
"def lock!\n self.for_update!\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def locked?\n @locked\n end",
"def unlock\n @locking = false\n end",
"def locked?\n raise NotImplementedError\n end",
"def locked?\n locksmith.locked?\n end",
"def locked?\n @locked\n end",
"def walletlock\n @api.request 'walletlock'\n end",
"def lockDriver _obj, _args\n \"_obj lockDriver _args;\" \n end",
"def lockout?\n @lockout\n end",
"def lock_movements?\n true\n end",
"def test_full_room()\n @room2.guest_enter(@guest)\n @room2.guest_enter(@guest)\n assert_equal(true, @room2.full_room)\n end",
"def lock\n\t\t\tself.instance_eval do \n\t\t\t\tundef :same_piece_count=\n\t\t\t\tundef :difference_ids=\n\t\t\tend\n\t\tend",
"def set_current_room\n if cr.defeated\n $map.level_rooms.each do |r|\n if self.bounding_box_collision?(r)\n @cr = r\n end\n end\n $map.hallways.each do |h|\n if self.bounding_box_collision?(h)\n @cr = h\n end\n end\n end\n end",
"def unlocked?\n @unlocked\n end",
"def with_lock(&blk)\n create_lock_file!\n queue = Queue.new\n\n first_lock_blk = lambda do\n if have_first_lock?(true)\n queue << :locked\n end\n end\n\n @zk.watcher.register(root_lock_path, &first_lock_blk)\n first_lock_blk.call\n\n if queue.pop\n begin\n @locked = true\n return blk.call\n ensure\n unlock!\n end\n end\n\n end",
"def travel_to!(floor)\n passengers.each {|passenger| passenger.current_floor = self.current_floor}\n\nend",
"def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end",
"def to_lock\n raise AbstractFunction,\n \"#to_lock must be implemented on #{self.class.name}!\"\n end",
"def to_lock\n raise AbstractFunction,\n \"#to_lock must be implemented on #{self.class.name}!\"\n end",
"def lock_timeout=(_arg0); end",
"def acquire_lock\n\t\t@@logger.info { \"Acquiring a lock in the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => false).update(:locked => true) != 0\n\tend",
"def lock?\n record.unlocked? && (director?(record.event) || competition_admin? || super_admin?)\n end",
"def lock\n post :lock\n end",
"def visit_Arel_Nodes_Lock(o, collector)\n collector\n end",
"def validate_lock\n raise LockRequired.new(__method__, self.class) unless @mutex.owned?\n end",
"def unlock\n if (!@owner.nil?)\n if (@owner[:locks].last == self)\n @owner[:locks].pop\n else\n if @owner[:locks].delete(self)\n @out_of_order_locks += 1\n raise EMutexOrder.new(self, \"Expected #{@owner[:locks].last}\")\n end\n # if called again let it pass\n end\n @owner = nil\n end\n super\n end",
"def room_enter(player, value)\r\n self.synchronize do\r\n iroom = value\r\n if iroom < 0\r\n room = Room.new(player, @batch_game)\r\n @rooms << room\r\n iroom = @rooms.size - 1\r\n else\r\n room = @rooms[iroom]\r\n room.process(player, Server::CMD_ROOM_ENTER, nil)\r\n end\r\n @lobby.process(player, Server::CMD_ROOM_ENTER, iroom)\r\n end\r\n end",
"def room\n end",
"def msg_MLOCK(source, args)\n return nil\n end",
"def unlock_all!\n locks.active.each(&:unlock!)\n end"
] |
[
"0.6763779",
"0.6554339",
"0.6551387",
"0.64560276",
"0.6400507",
"0.62908894",
"0.62346727",
"0.61693704",
"0.61508214",
"0.6089578",
"0.60702795",
"0.6055822",
"0.60428035",
"0.6017164",
"0.59920084",
"0.597811",
"0.5945651",
"0.5942091",
"0.59321225",
"0.5927075",
"0.5891108",
"0.5890803",
"0.5885606",
"0.58850026",
"0.5857278",
"0.5857164",
"0.5854412",
"0.58028376",
"0.58013093",
"0.57882494",
"0.5778395",
"0.57782656",
"0.57505035",
"0.57493263",
"0.57493263",
"0.57493263",
"0.57346046",
"0.57335734",
"0.57279974",
"0.5722175",
"0.5715261",
"0.5705149",
"0.56833035",
"0.56700027",
"0.56593454",
"0.56532454",
"0.5648133",
"0.5641989",
"0.56411207",
"0.56379974",
"0.5634412",
"0.5634412",
"0.5634412",
"0.56332743",
"0.5625463",
"0.5610407",
"0.5586276",
"0.5579829",
"0.5577677",
"0.5574636",
"0.5570851",
"0.5568888",
"0.5557124",
"0.5554784",
"0.5554548",
"0.5550524",
"0.5545637",
"0.5534471",
"0.5519477",
"0.5519477",
"0.5519477",
"0.5519477",
"0.5518943",
"0.55049247",
"0.5502543",
"0.54921585",
"0.5487772",
"0.5484733",
"0.5482989",
"0.547077",
"0.5462611",
"0.5462332",
"0.5457217",
"0.54564375",
"0.54508364",
"0.5431948",
"0.5426973",
"0.54158145",
"0.54158145",
"0.54153377",
"0.541429",
"0.54085344",
"0.540537",
"0.53958386",
"0.53947264",
"0.53885126",
"0.5386826",
"0.5383754",
"0.53830236",
"0.5376804"
] |
0.6746561
|
1
|
has_one :activity, through: :sessions has_one :instructor, through: :sessions
|
def parent
User.find(self.user_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_course_instructors_are_associated_with_instructors\n mason = User.create(first_name: \"Mason\", last_name: \"Matthews\", email: \"mason@email.com\", photo_url: \"https://avatars1.githubusercontent.com/u/5350842?v=3&s=400\")\n class_one = CourseInstructor.create\n class_two = CourseInstructor.create\n\n class_one.instructor = mason\n class_two.instructor = mason\n\n class_one.save\n class_two.save\n\n assert_equal 2, mason.instructors.count\n end",
"def instructor #want to return the instructor id and name from the users table\n # return Users.Section.where(:users.id => :section.id)\n return User.find(self.user_id)\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_instructor\n @instructor = Instructor.find(params[:id])\n end",
"def set_cohort_instructor\n @cohort_instructor = CohortInstructor.find(params[:id])\n end",
"def test_course_associated_with_primary_instructor\n c = Course.create(course_code: \"tuv 789\", name: \"Getting Along\", term_id: 3)\n ci = CourseInstructor.create(primary: true)\n ci2 = CourseInstructor.create()\n c.course_instructors << ci\n c.course_instructors << ci2\n assert_equal ci, Course.find(c.id).primary_instructor\n\n\n end",
"def show\n @instructors = InstructorApp.where(instance_id: @instance.id) || []\n @instructor1 = @instructors.first\n if @instructors.first != @instructors.last\n @instructor2 = @instructors.last\n end\n \n end",
"def set_section_instructor\n @section_instructor = SectionInstructor.find(params[:id])\n end",
"def set_instructor\n\t\t\t@instructor = Instructor.find(params[:id])\n\t\tend",
"def show\n @instructor = Instructor.find(params[:id])\n @showCohort = Cohort.where('instructor_id = ?', params[:id]) \nend",
"def set_instructor\n @instructor = User.find(params[:name])\n end",
"def test_course_has_many_instructors_through_course_instructors\n course = Course.create(name: \"Ruby on Rails\", course_code: \"ROR600\", color: \"Violet\")\n mason = User.create(first_name: \"Mason\", last_name: \"Matthews\", email: \"mason@email.com\", photo_url: \"https://avatars1.githubusercontent.com/u/5350842?v=3&s=400\")\n da_me = User.create(first_name: \"Da-Me\", last_name: \"Kim\", email: \"dame@email.com\")\n\n course.instructors << mason\n course.instructors << da_me\n\n assert_equal 2, course.course_instructors.count\n assert_equal 2, course.instructors.count\n end",
"def set_training_session\n @training_session = TrainingSession\n .includes(:general_ledgers, :instructors,\n :class_location)\n .includes(general_ledgers:\n %i[financial_account ledger_category])\n .includes(enrollments: [\n { session_rating: :user },\n :user\n ])\n .find(params[:id])\n end",
"def associated_student\n annotation.try(:response).try(:user) || response.try(:user)\n end",
"def participant\n self_link.try(:participant)\n end",
"def add_instructor(instructor)\n @instructors << instructor\n end",
"def is_user_instructor?(instructor_id)\n # ta created the course, current user is the instructor of this ta.\n instructor_ids = []\n TaMapping.where(ta_id: instructor_id).each {|mapping| instructor_ids << Course.find(mapping.course_id).instructor_id }\n session[:user].role_id == 2 and instructor_ids.include? session[:user].id\n end",
"def set_course_instructor\n @course_instructor = CourseInstructor.find(params[:id])\n end",
"def show\n @instructor = Instructor.find(params[:id])\n end",
"def instructor?(item=nil)\n defined?(@_is_instructor) or @_is_instructor = self.sessions.present?\n return @_is_instructor unless item\n return sessions.any? { |s| s.topic_id == item.id } if item.is_a? Topic\n return sessions.include?(item) if item.is_a? Session\n false\n end",
"def instructors\n course_enrollments.where(course_role: CourseRole.instructor).map(&:user)\n end",
"def enrollment_session_param\n :enrollment_id\n end",
"def section_instructor_params\n params.require(:section_instructor).permit(:section_id, :instructor_id)\n end",
"def associated_organization\n user_sports.first.user.organization \n end",
"def course_instructor_params\n params.require(:course_instructor).permit(:course_id, :user_id)\n end",
"def outbound_association\n #ga = ivr_associations.map { |a| a unless a.outbound_route.nil? }\n #ga.compact!.first unless ga.nil?\n #ivr_associations.inner_join( OutboundRoute.dataset, id: :route_id ).first\n ivr_associations.where( outbound_route: OutboundRoute.all ).first\n end",
"def is_user_instructor?(instructor_id)\n # ta created the course, current user is the instructor of this ta.\n instructor_ids = []\n TaMapping.where(ta_id: instructor_id).each { |mapping| instructor_ids << Course.find(mapping.course_id).instructor_id }\n (session[:user].role_id == 2) && instructor_ids.include?(session[:user].id)\n end",
"def current_coach\n @current_coach ||= Coach.find_by(id: session[:coach_id])\n end",
"def is_user_ta?(instructor_id, child)\n # instructor created the course, current user is the ta of this course.\n session[:user].role_id == 6 and\n Ta.get_my_instructors(session[:user].id).include?(instructor_id) and ta_for_current_course?(child)\n end",
"def new\n @instructor = User.new\n # Add proper data to this\nend",
"def instructor_active\n if self.instructor != nil\n if self.instructor.active == false\n errors.add(:instructor_id, \"should be active\")\n end \n end \n end",
"def instructors\n users.not_students\n end",
"def new\n @instructor = Instructor.new\n end",
"def new\n @instructor = Instructor.new\n end",
"def enrollment\n self.enrollments.last\n end",
"def one_relationship(name)\n end",
"def appointment_session\n @session.appointment\n end",
"def is_user_ta?(instructor_id, child)\n # instructor created the course, current user is the ta of this course.\n (session[:user].role_id == 6) &&\n Ta.get_my_instructors(session[:user].id).include?(instructor_id) && ta_for_current_course?(child)\n end",
"def authorize_instructor\n user = User.find_by(id: session[:user_id])\n unless user.instructor\n send(:render, :text => \"You are not allowed to access this action, since you are not linked to an instructor.\",\n :status => :forbidden)\n end\n end",
"def show\n @trainer = current_trainer\n @training_sessions = TrainingSession.all.where(trainer_id: session[:user_id])\n end",
"def set_platform\n @instructor = Instructor.find(params[:id])\n end",
"def create_staff_ed_org_associations_for_sessions(sessions, offset, member, ed_org_id, type)\n if (!@scenarioYAML[\"HACK_NO_STAFF_EDORG_ASSOCIATIONS_EXCEPT_SEA\"] || (type == \"seas\")) && !sessions.nil? and sessions.size > 0\n seoa_begin = member[\"begin\"]\n seoa_end = member[\"end\"]\n sessions.each do |session|\n classification = member[\"role\"]\n if Roles.to_symbol(classification).nil?\n title = get_position_for_ed_org_type(type)\n else\n title = Roles.to_symbol(classification)\n end\n\n if ed_org_id.kind_of? Integer\n state_org_id = DataUtility.get_state_education_agency_id(ed_org_id) if type == \"seas\"\n state_org_id = DataUtility.get_local_education_agency_id(ed_org_id) if type == \"leas\"\n state_org_id = DataUtility.get_elementary_school_id(ed_org_id) if type == \"elementary\"\n state_org_id = DataUtility.get_middle_school_id(ed_org_id) if type == \"middle\"\n state_org_id = DataUtility.get_high_school_id(ed_org_id) if type == \"high\"\n else\n state_org_id = ed_org_id\n end\n\n interval = session[\"interval\"]\n begin_date = seoa_begin.nil? ? interval.get_begin_date - offset : seoa_begin\n end_date = seoa_end.nil? ? interval.get_end_date + offset : seoa_end\n @queue.push_work_order({:type=>StaffEducationOrgAssignmentAssociation, :id=>member[\"id\"], :edOrg=>state_org_id, :classification=>classification,\n :title=>title, :beginDate=>begin_date, :endDate=>end_date})\n end\n end\n end",
"def index\n #instructor_id =session[:id]\n #@courses = Course.where([\"instructor_id = ?\", instructor_id])\n @courses = Course.all\n end",
"def update_instructor(tmp_object, instructor_id)\n tmp_object[\"instructor_id\"] = instructor_id\n tmp_object[\"instructor\"] = nil\n tmp_object[\"instructor\"] = User.find(instructor_id).name(session[:ip]) if instructor_id\n end",
"def destroy\n @instructor.destroy\n end",
"def set_training_session\n @training_session = TrainingSession.where(\"id = ? AND user_id = ? AND open = ?\", params[:id], current_user.id, false)[0]\n end",
"def cohort_instructor_params\n params.require(:cohort_instructor).permit(:instructor_id, :cohort_id)\n end",
"def unique_activity\n if self.user.bookings.where(activity_id: self.activity.id).any?\n errors.add(:already_joined, \"this activity!\")\n end\n end",
"def this_user_and_assignment\n rec = CONNECTION.execute(\"SELECT * FROM #{table} WHERE user_id = #{user.id} AND assignment_id = #{assignment.id};\").first\n if rec.blank?\n Collaborator.new\n else\n Collaborator.new(rec)\n end\n end",
"def tests\n BoatingTest.all.select do |test|\n test.instructor == self\n end\n end",
"def set_event\n @event = Event.where(id: params[:event_id]).includes({ sessions: [{ attendees: :member }] }).first\n end",
"def activity_owner\n self\n end",
"def test_course_instructors_associated_with_courses\n c = Course.create(name: \"Tech News\", course_code: \"xyz546\")\n i = CourseInstructor.create()\n c.course_instructors << i\n assert_equal [i], Course.find(c.id).course_instructors\n end",
"def set_current_user\n @current_user = Instructor.find_by_id(session[:user_id])\n redirect_to login_path and return unless @current_user\n #authorize! :read, Problem\n end",
"def instructors \n self.object.instructors.map do |instructor|\n {\n instructor_id: instructor.id,\n instructor_name: instructor.name, \n instructor_date_of_birth: instructor.date_of_birth, \n instructor_specialty: instructor.specialty, \n instructor_years_experience: instructor.years_experience,\n instructor_certification: instructor.certification\n }\n end\n end",
"def lesson_coach\n lesson.coach_name\n end",
"def index\n @section_instructors = SectionInstructor.all\n end",
"def associated\n end",
"def get_coach\n @current_user.coach_id = params[:coach_id]\n User.find_by_id(params[:coach_id]).student = @current_user\n\n redirect_to user_path(@current_user)\n end",
"def show\n @instructor1 = Instructor1.find(params[:id])\n\t@instructorcourses = Instructorcourse.where(instructoremail: @instructor1.email)\n\t@s=Instructor1.find(session[:user_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instructor1 }\n end\n end",
"def destroy\n @instructor = Instructor.find(params[:id])\n @instructor.destroy\n end",
"def confirm_instructor\n @confirm_instructor = true if session[:role_name] == 'Instructor'\n end",
"def organized_activities\n participants.includes(:activity).where(is_organizer: true)\n end",
"def role_is_instructor?\n has_role? 'instructor'\n end",
"def restrict_to_student\n # Get the instructor the message is headed to\n instructor = Instructor.find_by_id params[:user_id]\n\n # Get all instructors that this student has been taught by.\n #\n # SELECT * FROM users JOIN courses ON courses.instructor_id = users.id JOIN histories ON\n # histories.course_id = courses.id WHERE users.type = 'Instructor' AND histories.student_id = id\n #\n # This translates to selecting all instructors that have taught a course that is associated\n # with a history that belongs to the student.\n instructors = Instructor.joins(courses: :histories).where(histories: {user: @auth_user})\n\n # Redirect if the target instructor is not in the list of instructors\n redirect_to messages_path unless instructors.include? instructor\n end",
"def boating_tests\n BoatingTest.all.select{|test|test.instructor == self}\n end",
"def boating_tests\n BoatingTest.all.select{|test| \n test.instructor == self\n }\n end",
"def set_guest_session_association\n @guest_session_association = GuestSessionAssociation.new(user_id:session[:user_id],jam_session_id:params[:id],player:params[:player])\n @guest_session_association.save!\n end",
"def index\n @cohort_instructors = CohortInstructor.all\n end",
"def create\n @course = Course.find(params[:course_id])\n @study_session = StudySession.new(params[:study_session])\n @study_session.update_attributes(:course_id => @course.id)\n \n @invitation = Invitation.new({:user_id => current_user.id, \n :study_session_id => @study_session.id})\n @invitation.save\n\n respond_to do |format|\n if @study_session.save\n format.html { redirect_to [@study_session.course, @study_session], notice: 'Study session was successfully created.' }\n format.json { render json: @study_session.id, status: :created, location: @study_session }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def teacher\n self.teachers.first\n end",
"def index\n @instructors = Instructor.all\n end",
"def active_access_session\n access_sessions.active.first\n end",
"def current_student\n Student.find_by({id: session[:student_id]})\nend",
"def index\n @sessions = current_user.fitness_sessions\n end",
"def index\n @instructor_apps = InstructorApp.all\n end",
"def associated_record\n assoication.active_record\n end",
"def show\n if @instructor.nil?\n redirect_to action: :index\n end\nend",
"def set_instructor_app\n @instructor_app = InstructorApp.find(params[:id])\n end",
"def account\n @trainer = Trainer.find_by_id(session[:user_id])\n end",
"def instructor_params\n params.require(:instructor).permit(:fname, :lname, :email, :age, :salary, :degree, :id)\n end",
"def parent\n return teacher\n end",
"def training_session_params\n params.require(:training_session)\n .permit(:q, :title, :description, :min_group_size, :max_group_size,\n :start_date, :url, :duration_in_minutes, :compensation,\n :compensation_delivered, :session_type, :course_id,\n :published, :class_location_id, instructor_ids: [], instructors_attributes: [:id])\n end",
"def has_one(goal, options = { })\n goal.belongs_to(self) unless options[:skip_belongs_to]\n self.associate(:has_one, goal, options)\n end",
"def assignments\n self.course.assignments if self.course\n end",
"def set_activity\n @activity = current_user.activities.find(params[:id])\n end",
"def create\n @enrollment = Enrollment.new(instructor: true)\n @course = Course.new(course_params)\n @course.enrollments << @enrollment\n current_user.enrollments << @enrollment\n\n respond_to do |format|\n if @enrollment.save and @course.save and current_user.save\n format.html { redirect_to root_url, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def free?\n self.instructor.nil?\n end",
"def index\n @activity_participants = Activity::Participant.all\n \n end",
"def tutors\n User.teaching(self)\n end",
"def instructor_for_course?(node)\n available?(session[:user], node.get_instructor_id)\n end",
"def last_session\n user_exams.order('updated_at DESC').first\n end",
"def show\n render json: @instructor\n end",
"def startup_relationship\n Relationship.between(self.user, self.startup)\n end",
"def create_staff_program_associations_for_sessions(sessions, offset, member, programs)\n if !sessions.nil? and sessions.size > 0\n min = @scenarioYAML[\"MINIMUM_NUM_PROGRAMS_PER_STAFF_MEMBER\"]\n max = @scenarioYAML[\"MAXIMUM_NUM_PROGRAMS_PER_STAFF_MEMBER\"]\n sessions.each { |session| create_staff_program_association(session, offset, member, programs, min, max) }\n end\n end"
] |
[
"0.58719003",
"0.5695957",
"0.5664976",
"0.5664976",
"0.5664976",
"0.5664976",
"0.5664976",
"0.5664976",
"0.5664976",
"0.5664976",
"0.56001365",
"0.55958164",
"0.5552075",
"0.55393445",
"0.5530143",
"0.55109864",
"0.55066353",
"0.54938364",
"0.54691607",
"0.5457256",
"0.5453652",
"0.545221",
"0.5437435",
"0.54099786",
"0.5403301",
"0.5374256",
"0.5350298",
"0.53381693",
"0.5334203",
"0.5322271",
"0.5308279",
"0.5257534",
"0.52482116",
"0.52422494",
"0.5227789",
"0.52156675",
"0.5205594",
"0.5203434",
"0.5199131",
"0.5199131",
"0.5194451",
"0.5182857",
"0.5180048",
"0.51582223",
"0.51549214",
"0.51434153",
"0.51416713",
"0.51376665",
"0.51186705",
"0.5114408",
"0.5078551",
"0.5069715",
"0.5063766",
"0.5061616",
"0.5025851",
"0.5023087",
"0.5021785",
"0.5018103",
"0.50142217",
"0.50133777",
"0.501316",
"0.5000608",
"0.49934357",
"0.49913532",
"0.4987918",
"0.49846765",
"0.4968908",
"0.4966414",
"0.4962451",
"0.49559748",
"0.49550393",
"0.49547306",
"0.4941539",
"0.4929187",
"0.49243915",
"0.49241504",
"0.49064898",
"0.49039438",
"0.48984495",
"0.48980817",
"0.48959887",
"0.48918894",
"0.48827833",
"0.4871523",
"0.48685628",
"0.48673898",
"0.48658508",
"0.48647803",
"0.48644766",
"0.48540628",
"0.48536363",
"0.4853086",
"0.48494682",
"0.48411414",
"0.48299626",
"0.48274294",
"0.4821918",
"0.48171228",
"0.48166245",
"0.4814779",
"0.48125094"
] |
0.0
|
-1
|
GET /accounts GET /accounts.json
|
def index
@accounts = Account.page(params[:page])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def accounts\n get('/accounts')['accounts']\n end",
"def get_accounts()\n http_get(accounts_url)\n end",
"def get_account\n as_json(get_results('/account'))\n end",
"def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n\tend",
"def show\n authorize @accounts\n render json: @account\n end",
"def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end",
"def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end",
"def index\n @accounts = current_user.person.linked_in_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end",
"def index\n\n begin\n\n @accounts = Account.active\n render json: @accounts.to_json(:except=>:password, :methods => [:subdomains, :template] )\n\n rescue => e\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end",
"def account\n get('account')\n end",
"def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end",
"def index\n @accounts = current_user.person.blackberry_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n accounts = Account.where(user_id: user[\"id\"])\n render json: accounts, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end",
"def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end",
"def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end",
"def index\n @account = Account.find(params[:account_id])\n @users = @account.users\n respond_to do |format|\n format.json { render json: @account.users.paginate(page: @page, per_page: @per_page) }\n end\n end",
"def get_accounts\n @accounts = Account.all\n end",
"def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end",
"def account(params = {})\n make_get_request('/account', params)\n end",
"def get_accounts\n response_xml = http_get(\"#{xero_url}/accounts\")\n parse_response(response_xml)\n end",
"def index\n @api_v1_accounts = Api::V1::Account.all\n end",
"def show\n\t\treturn status 404 if @account.nil?\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend",
"def show\n\t\t@account = Account.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend",
"def accounts\n response = query_api(\"/rest/accounts\")\n return response[\"accounts\"].map {|account| Account.new(self, account)}\n end",
"def index\n #@accounts = Account.all\n redirect_to root_path\n #respond_to do |format|\n #format.html # index.html.erb\n #format.json { render json: @accounts }\n #end\n end",
"def index\n @user = User.find(params[:user_id])\n @user_accounts = @user.user_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_accounts }\n format.xml { render xml: @user_accounts }\n end\n end",
"def index\n @accounts = current_user.person.phone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @accounts = @user.accounts.sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def get_accounts(page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end",
"def getAccounts\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n http = broker_url + \"/resources/accounts\"\n res = httpGETRequest(http)\n return res\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def index\n respond_with(accounts)\n end",
"def index\n @accounts = Account.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def show\r\n @account = Account.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @account }\r\n end\r\n end",
"def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end",
"def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end",
"def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n response = @account_api.find_all\n if response[:status].to_i == 403\n redirect_to home_index_path\n flash[:alert] = \"You are not allowed to access this page\"\n end\n\n @accounts = response[:accounts]\n end",
"def index\n index = json_account_params[:json_id].to_i if !index \n if admin_signed_in?\n @accounts = Account.all\n else\n @accounts = Account.tri(@current_user.id).all[(index)..(index + 5)]\n end\n index = index + 1\n respond_to do |format|\n format.html\n format.json { render json: @accounts, locals: {last: \"@last\"} }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end",
"def account_info(options = {})\n request :account, :get, 'account', options\n end",
"def index\n @accounts = current_user.accounts\n end",
"def index\n @accounts = current_user.accounts\n end",
"def show_account(id)\n get(\"accounts/#{id}\")\n end",
"def portfolio_accounts\n data = call_api(method: \"get\", url: \"/portfolio/accounts\" )\n @accountId = data.first[\"accountId\"]\n @accountId\n end",
"def fetch_accounts\n log 'fetch_accounts'\n\n custom_headers = {\n 'Content-Type' => 'application/json; charset=UTF-8',\n 'Contexto' => get_context\n }\n\n params = {\n \"peticionCuentasKYOSPaginadas\" => {\n \"favoritos\" => false,\n \"paginacion\" => \"0\"\n }\n }\n\n response = with_headers(custom_headers) do\n post(BASE_ENDPOINT + ACCOUNTS_ENDPOINT, fields: params.to_json)\n end\n\n json = JSON.parse(response)\n\n if json['respuestacuentas']['cuentas'].is_a? Array\n # TODO: test this with a user with multiple accounts\n json['respuestacuentas']['cuentas'].map { |data| build_account(data) }\n else\n [build_account(json['respuestacuentas']['cuentas'])]\n end\n end",
"def get_accounts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'\n end\n # resource path\n local_var_path = '/accounts'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountListResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#get_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def accounts_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AccountsApi.accounts_get ...\"\n end\n # resource path\n local_var_path = \"/api/Accounts\"\n\n # query parameters\n query_params = {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountPage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#accounts_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n\n begin\n\n @account = Account.active.find_by_email(params[:id])\n @account = Account.active.find(params[:id]) if @account.nil?\n\n if @account_user.instance_of?(Account)\n #verify user is accessing his/her own account\n raise \"Username '#{@account_user.email}' does not have access to this account\" if @account != @account_user\n end\n\n render json: @account.to_json(:except=>:password, :methods => [:subdomains, :template])\n\n rescue => e\n logger.debug 'ERROR: ' + e.message\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end",
"def social_accounts_for_a_project\n uri = \"#{@api_url}/#{@project_id}/accounts?access_token=#{@access_token}\"\n get uri\n end",
"def show\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(id: params[:id], user_id: user[\"id\"])\n if ( account != nil )\n render json: account, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end",
"def show\n account = resource\n if params[:id].present?\n account = User.find_by_id(params[:id])\n end\n render json: account, status: 200\n end",
"def show\n @account = current_user.person.linked_in_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n @accounts = current_user.person.iphone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n Rabl.render(@accounts, 'api/accounts/index', view_path: 'app/views')\n end",
"def show\n @account = Account.find_by_id(params[:id])\n if (@account)\n Rabl.render(@account, 'api/accounts/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid account\"}\n end\n end",
"def get_accounts(page = 1, limit = 10, filter = nil)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\r\n 'page' => if page.nil? then 1 else page end,\r\n 'limit' => if limit.nil? then 10 else limit end,\r\n 'filter' => filter\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers: headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def get_account(account_id)\n get(\"/account/#{account_id}\")\n end",
"def get_accounts(opts = {})\n data, _status_code, _headers = get_accounts_with_http_info(opts)\n data\n end",
"def get_accounts(opts = {})\n data, _status_code, _headers = get_accounts_with_http_info(opts)\n data\n end",
"def accounts_get(opts = {})\n data, _status_code, _headers = accounts_get_with_http_info(opts)\n return data\n end",
"def show\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def get_accounts_by_user\n return User.find(params[:user_id]).accounts\n end",
"def get_accounts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'\n end\n # resource path\n local_var_path = '/v1/accounts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'InlineResponse20011' \n\n auth_names = opts[:auth_names] || ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#get_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @accounts = current_user.accounts\n @help = \"Account List\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accounts }\n end\n end",
"def subaccounts()\n get('subAccounts')\n end",
"def show_accounts(search = nil, **params)\n params[:search] = search\n\n get('accounts', params)\n end",
"def index\n @accounts = User::Account.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_accounts }\n end\n end",
"def accounts\r\n AccountsController.instance\r\n end",
"def accounts\r\n AccountsController.instance\r\n end",
"def index\n @accounts = @project.accounts\n end",
"def index\n account = Account.find(params[:account_id].to_i)\n @transactions = account.transactions\n\n transactions_json = TransactionSerializer.new(@transactions).serialized_json\n render json: transactions_json\n end",
"def index\n @pt_accounts = current_user.pt_accounts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pt_accounts }\n end\n end",
"def all\n @account = Account.new\n @page[:per_page] = Account.count\n @accounts = Account.order(@order).paginate(@page)\n\n respond_to do |format|\n format.html { render 'index' }\n format.json { render json: @accounts, callback: params[:callback] }\n format.xml { render xml: @accounts }\n format.rss { render 'feed' }\n end\n end",
"def index\n @ledger_accounts = current_user.ledger_accounts.all\n respond_with @ledger_accounts\n end",
"def index\n @ledger_accounts = current_user.ledger_accounts.all\n respond_with @ledger_accounts\n end",
"def show\n @account = Account.find_by_id(params[:id])\n\n respond_to do |format|\n # Allow the user to see only the accounts that are from one of his groups\n if @accounts.find {|acc| acc.id == @account.id.to_i}\n format.html # show.html.erb\n format.json { render json: @account }\n else\n flash[:error] = \"Account was not found\"\n format.html { redirect_to action: \"index\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def accounts\n end",
"def fetch_accounts\n log 'fetch_accounts'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n cuentas = data['datosSalidaCuentas']['cuentas'].zip(data['datosSalidaCodIban']['datosIban'])\n cuentas.map{ |data| build_account(data) }\n end",
"def get_acc_info\n JSON.parse(curl_get(\"/api2/account/info/\").body_str)\n end",
"def accounts\n account_data = request('listaccounts')\n account_data.map do |account_name, account_value|\n Account.new(self, account_name, account_value, false)\n end\n end",
"def show\n @account = current_user.person.gmail_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end"
] |
[
"0.8534027",
"0.83189064",
"0.79739887",
"0.7771132",
"0.7715751",
"0.76114476",
"0.756609",
"0.75607514",
"0.7477661",
"0.7467793",
"0.7399458",
"0.7361153",
"0.7349256",
"0.7347992",
"0.73351794",
"0.72757065",
"0.7273358",
"0.7226634",
"0.7213324",
"0.71748066",
"0.71722066",
"0.7155134",
"0.71499467",
"0.7147381",
"0.7125329",
"0.7123256",
"0.71060115",
"0.7102583",
"0.70867443",
"0.70839995",
"0.7054065",
"0.7051361",
"0.7050483",
"0.7050483",
"0.7050483",
"0.7050483",
"0.7050483",
"0.7050138",
"0.7033312",
"0.70022565",
"0.6987128",
"0.6987128",
"0.6983578",
"0.6981925",
"0.6973961",
"0.6962408",
"0.6958214",
"0.6952322",
"0.6951482",
"0.6951482",
"0.6935976",
"0.69242316",
"0.6909536",
"0.6907765",
"0.69062227",
"0.6902397",
"0.6889625",
"0.6853302",
"0.6851911",
"0.6850802",
"0.68472326",
"0.68336046",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6827006",
"0.6825227",
"0.6814938",
"0.67916036",
"0.67834556",
"0.6782093",
"0.6782093",
"0.67638963",
"0.674357",
"0.6742855",
"0.6713857",
"0.6689072",
"0.6688657",
"0.66556185",
"0.66340244",
"0.66314036",
"0.66314036",
"0.66267765",
"0.6616775",
"0.6598686",
"0.65835893",
"0.65832543",
"0.65832543",
"0.655381",
"0.6549797",
"0.653516",
"0.6533736",
"0.6531648",
"0.6531311"
] |
0.67071486
|
82
|
GET /accounts/1 GET /accounts/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def accounts\n get('/accounts')['accounts']\n end",
"def get_accounts()\n http_get(accounts_url)\n end",
"def get_account\n as_json(get_results('/account'))\n end",
"def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end",
"def show\n authorize @accounts\n render json: @account\n end",
"def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n\tend",
"def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def show\n\t\t@account = Account.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend",
"def account\n get('account')\n end",
"def show_account(id)\n get(\"accounts/#{id}\")\n end",
"def show\r\n @account = Account.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @account }\r\n end\r\n end",
"def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def index\n @api_v1_accounts = Api::V1::Account.all\n end",
"def show\n account = resource\n if params[:id].present?\n account = User.find_by_id(params[:id])\n end\n render json: account, status: 200\n end",
"def show\n\t\treturn status 404 if @account.nil?\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n @accounts = current_user.person.linked_in_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n\n begin\n\n @accounts = Account.active\n render json: @accounts.to_json(:except=>:password, :methods => [:subdomains, :template] )\n\n rescue => e\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end",
"def index\n @accounts = current_user.person.blackberry_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n index = json_account_params[:json_id].to_i if !index \n if admin_signed_in?\n @accounts = Account.all\n else\n @accounts = Account.tri(@current_user.id).all[(index)..(index + 5)]\n end\n index = index + 1\n respond_to do |format|\n format.html\n format.json { render json: @accounts, locals: {last: \"@last\"} }\n end\n end",
"def show\n @account = Account.find_by_id(params[:id])\n if (@account)\n Rabl.render(@account, 'api/accounts/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid account\"}\n end\n end",
"def index\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n accounts = Account.where(user_id: user[\"id\"])\n render json: accounts, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end",
"def account(params = {})\n make_get_request('/account', params)\n end",
"def get_account(account_id)\n get(\"/account/#{account_id}\")\n end",
"def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end",
"def show\n\n begin\n\n @account = Account.active.find_by_email(params[:id])\n @account = Account.active.find(params[:id]) if @account.nil?\n\n if @account_user.instance_of?(Account)\n #verify user is accessing his/her own account\n raise \"Username '#{@account_user.email}' does not have access to this account\" if @account != @account_user\n end\n\n render json: @account.to_json(:except=>:password, :methods => [:subdomains, :template])\n\n rescue => e\n logger.debug 'ERROR: ' + e.message\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end",
"def show\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(id: params[:id], user_id: user[\"id\"])\n if ( account != nil )\n render json: account, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def index\n @account = Account.find(params[:account_id])\n @users = @account.users\n respond_to do |format|\n format.json { render json: @account.users.paginate(page: @page, per_page: @per_page) }\n end\n end",
"def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end",
"def show\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n @user = User.find(params[:user_id])\n @user_accounts = @user.user_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_accounts }\n format.xml { render xml: @user_accounts }\n end\n end",
"def show\n @account = current_user.person.linked_in_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n @accounts = current_user.person.phone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end",
"def show\n @account = Account.find_by_id(params[:id])\n\n respond_to do |format|\n # Allow the user to see only the accounts that are from one of his groups\n if @accounts.find {|acc| acc.id == @account.id.to_i}\n format.html # show.html.erb\n format.json { render json: @account }\n else\n flash[:error] = \"Account was not found\"\n format.html { redirect_to action: \"index\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n #@accounts = Account.all\n redirect_to root_path\n #respond_to do |format|\n #format.html # index.html.erb\n #format.json { render json: @accounts }\n #end\n end",
"def portfolio_accounts\n data = call_api(method: \"get\", url: \"/portfolio/accounts\" )\n @accountId = data.first[\"accountId\"]\n @accountId\n end",
"def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end",
"def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end",
"def index\n @accounts = Account.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def index\n @accounts = @user.accounts.sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end",
"def show\n @account = current_user.person.gmail_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n respond_with(accounts)\n end",
"def index\n response = @account_api.find_all\n if response[:status].to_i == 403\n redirect_to home_index_path\n flash[:alert] = \"You are not allowed to access this page\"\n end\n\n @accounts = response[:accounts]\n end",
"def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def get_single_account(id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n Account.new(response)\n end",
"def index\n @accounts = current_user.person.iphone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end",
"def get_accounts\n @accounts = Account.all\n end",
"def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end",
"def show\n @company_account = CompanyAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company_account }\n end\n end",
"def show\n @account = current_user.person.phone_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def index\n @accounts = current_user.accounts\n end",
"def index\n @accounts = current_user.accounts\n end",
"def social_accounts_for_a_project\n uri = \"#{@api_url}/#{@project_id}/accounts?access_token=#{@access_token}\"\n get uri\n end",
"def account_info(options = {})\n request :account, :get, 'account', options\n end",
"def show\n @account = current_user.person.iphone_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end",
"def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @account }\n format.json { render :json => @account }\n end\n end",
"def show\n response = @account_api.find(params[:id])\n @account = response[:account]\n # @user = RubyBank::CustomerApi.new(session[:token]).find(@account.customer_id)[:user]\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def show\n @personal_account = PersonalAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @personal_account }\n end\n end",
"def index\n @accounts = Account.all\n Rabl.render(@accounts, 'api/accounts/index', view_path: 'app/views')\n end",
"def accounts\r\n AccountsController.instance\r\n end",
"def accounts\r\n AccountsController.instance\r\n end",
"def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end",
"def show\n @account = Account.find(params[:account_id])\n end",
"def show\n account = Account.find(params[:id])\n render json: PrivateAccountSerializer.new(account).serializable_hash\n end",
"def get_accounts(page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end",
"def show\n @credito = Credito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credito }\n end\n end",
"def show\r\n\r\n\r\n @account = Account.find(params[:id])\r\n @workers = @account.workers\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @account }\r\n end\r\n end",
"def show\n @linked_account = LinkedAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @linked_account }\n end\n end",
"def show\n @capital_account = CapitalAccount.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @capital_account }\n end\n end",
"def subaccounts()\n get('subAccounts')\n end",
"def index\n account = Account.find(params[:account_id].to_i)\n @transactions = account.transactions\n\n transactions_json = TransactionSerializer.new(@transactions).serialized_json\n render json: transactions_json\n end",
"def index\n @accounts = Account.page(params[:page])\n end",
"def show\n @trading_account = TradingAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trading_account }\n end\n end",
"def index\n @accounts = @project.accounts\n end",
"def account_user(id)\n get(\"accountuser/#{id}\")\n end",
"def account(&block)\n response = _get(\"accounts/current\")\n yield(response) if block_given?\n response[\"account\"]\n end",
"def show\n @house_account = HouseAccount.find(params[:id])\n\n render json: @house_account\n end",
"def show\n @account = Account.find(params[:id])\n if @account.user_id != current_user.id\n raise Forbidden\n end\n account_last = Account.find(:last)\n account_first = Account.find(:first)\n next_id = @account.id\n previous_id = @account.id\n \n \n while(account_last.id >= next_id)\n next_id += 1\n @next = Account.where('id = ? AND user_id = ?',next_id,current_user.id)\n if @next.present?\n @next = Account.find_by_id(next_id)\n break\n end\n end\n \n while(account_first.id <= previous_id)\n previous_id -= 1\n @previous = Account.where('id = ? AND user_id = ?',previous_id,current_user.id)\n if @previous.present?\n @previous = Account.find_by_id(previous_id)\n break\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end",
"def accounts_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AccountsApi.accounts_get ...\"\n end\n # resource path\n local_var_path = \"/api/Accounts\"\n\n # query parameters\n query_params = {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountPage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#accounts_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @user_account_app = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_account_app }\n end\n end",
"def retrieve(id)\n @client.make_request(:get, \"carrier_accounts/#{id}\", MODEL_CLASS)\n end",
"def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end",
"def show\n @public_account = PublicAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @public_account }\n end\n end",
"def show\n @tr_account = TrAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tr_account }\n end\n end"
] |
[
"0.76854396",
"0.76389235",
"0.76367265",
"0.75433934",
"0.74302703",
"0.72776824",
"0.7264478",
"0.72200984",
"0.72200984",
"0.72200984",
"0.72200984",
"0.72200984",
"0.7209649",
"0.7190633",
"0.71900064",
"0.71897256",
"0.71785915",
"0.71748847",
"0.716882",
"0.71648955",
"0.71421146",
"0.7092673",
"0.7034731",
"0.7028385",
"0.7020885",
"0.6973205",
"0.69629914",
"0.69562227",
"0.6943329",
"0.6943106",
"0.69367707",
"0.6907577",
"0.69036055",
"0.6887633",
"0.6874441",
"0.6856213",
"0.68504584",
"0.6828181",
"0.6820364",
"0.679946",
"0.6767496",
"0.67672193",
"0.6744",
"0.6729013",
"0.6729013",
"0.6724612",
"0.6715749",
"0.66881317",
"0.66755795",
"0.6675008",
"0.6674251",
"0.6669598",
"0.6660885",
"0.6623071",
"0.66025877",
"0.6596556",
"0.6568933",
"0.65652263",
"0.65652263",
"0.6558886",
"0.65510005",
"0.65465844",
"0.65397215",
"0.65326667",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6524199",
"0.6521599",
"0.6502206",
"0.6502072",
"0.6502072",
"0.6486118",
"0.64750713",
"0.646568",
"0.64649165",
"0.64559853",
"0.64487094",
"0.6444615",
"0.6439301",
"0.64391667",
"0.643704",
"0.6423644",
"0.64122957",
"0.64111257",
"0.64070773",
"0.64014757",
"0.6400534",
"0.63999677",
"0.6395839",
"0.6384492",
"0.63816106",
"0.63770044",
"0.63744056",
"0.6368589"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_account
@account = Account.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def account_params
params.require(:account).permit(:account_id, :steamid, :profilestate, :personaname, :lastlogoff, :profileurl, :avatar, :avatarmedium, :avatarfull, :personastate, :primaryclanid, :timecreated, :personastateflags, :gameextrainfo, :gameid, :loccountrycode, :locstatecode, :last_check)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
This is a special feature for call converters who can just call lead after lead without thinking. That is, an automated algorithm decides who the call converter should call next based on which lead is most likely to answer their phone at this time.
|
def next
@outbound_mode_active = "active"
@lead = Lead.next(current_admin.email)
@call_mode = true
if @lead
render :edit
else
redirect_to '/no_leads'
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call),\n status_callback: member_call_event_url(call),\n status_callback_method: 'POST',\n status_callback_event: %w[initiated ringing answered completed]\n }\n client.calls.create params\n rescue Twilio::REST::RestError => e\n # 13223: Dial: Invalid phone number format\n # 13224: Dial: Invalid phone number\n # 13225: Dial: Forbidden phone number\n # 13226: Dial: Invalid country code\n # 21211: Invalid 'To' Phone Number\n # 21214: 'To' phone number cannot be reached\n call.action.destroy!\n call.update!(twilio_error_code: e.code, status: 'failed', action_id: nil)\n if (e.code >= 13_223 && e.code <= 13_226) || [21_211, 21_214].include?(e.code)\n add_error(:member_phone_number, I18n.t('call_tool.errors.phone_number.cant_connect'))\n else\n Rails.logger.error(\"Twilio Error: API responded with code #{e.code} for #{call.attributes.inspect}\")\n add_error(:base, I18n.t('call_tool.errors.unknown'))\n end\n end",
"def make_phone_call(number, international_code = 1, area_code = 646)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\nend",
"def call_next_provider(call_job)\n contact = get_next_uncontacted(call_job)\n\n if contact.nil?\n #if it gets here terminate CallJob. No more contacts exist\n call_job.delay.make_callback(\"done\")\n call_job.status = :done\n call_job.save\n else\n contact.delay.make_callback(\"calling\")\n path = \"twilio/provider_twiml/#{contact.id}.xml\"\n call_back_path = \"twilio/provider_status_callback/#{contact.id}.xml\"\n make_call(contact.phone, path, call_back_path)\n end\n end",
"def make_phone_call(number, international_code = '+254', area_code = 7)\n puts \"calling #{international_code}-#{area_code}#{number}\"\nend",
"def call_back_lead\n if \"sent\" == status && \"Lead\" == source_type\n source.after_sent(self)\n end\n end",
"def launch_call(dial_strategy)\n #Determine if the channel type is IAX2 or SIP and make a determination on how to dial\n channel_type = @config[\"profiles\"][dial_strategy[:profile]][\"channel\"].split('/')\n if channel_type[0] == \"IAX2\"\n channel = @config[\"channel\"] + dial_strategy[:number].to_s\n else\n channel = $HELPERS[\"hammer\"][profile][\"channel\"] + dial_strategy[:number].to_s\n end\n \n @thread_lock.synchronize do\n response = @adhearsion.proxy.originate( { \"Channel\" => channel,\n \"Context\" => @config[\"profiles\"][dial_strategy[:profile]][\"context\"],\n \"Exten\" => @config[\"profiles\"][dial_strategy[:profile]][\"extension\"],\n \"Priority\" => @config[\"profiles\"][dial_strategy[:profile]][\"priority\"],\n \"Callerid\" => dial_strategy[:callerid],\n \"Timeout\" => @config[\"profiles\"][dial_strategy[:profile]][\"timeout\"],\n \"Variable\" => dial_strategy[:instructions],\n\t\t\t\t\t \"Async\" => @config[\"profiles\"][dial_strategy[:profile]][\"async\"] } )\n end\n\t\t\t\t\t \n return response\n end",
"def make_phone_call(number, international_code = 1, area_code = 342)\n puts \"Calling #{international_code} - #{area_code} - #{number}\"\nend",
"def who_called? call\n raise ArgumentError, \"#{call.inspect} is not a call\" unless call.is_a?(Call)\n return nil unless calls.include?(call) # Call not made by any player.\n Direction[(self.dealer + calls.find_index(call)) % 4]\n end",
"def launch_call(strategy_name, treatment_strategy, dial_strategy)\n channel = dial_strategy[treatment_strategy[:dial]][:channel] + treatment_strategy[:number].to_s\n options = { \"Channel\" => channel,\n \"Context\" => dial_strategy[treatment_strategy[:dial]][:context],\n \"Exten\" => dial_strategy[treatment_strategy[:dial]][:extension],\n \"Priority\" => dial_strategy[treatment_strategy[:dial]][:priority],\n \"Callerid\" => treatment_strategy[:callerid],\n \"Timeout\" => dial_strategy[treatment_strategy[:dial]][:timeout],\n \"Variable\" => \"strategy_name=\" + strategy_name,\n\t\t\t\t \"Async\" => dial_strategy[treatment_strategy[:dial]][:async] }\n result = Adhearsion::VoIP::Asterisk.manager_interface.originate options\n ahn_log.hammer.debug result[\"Message\"]\n return result\n end",
"def attempt_call\n @base_url = AppConfig.base_url || \"\"\n @call_list = CallList.find(params[:call_list_id])\n @call_escalations = [@call_list.current_oncalls, @call_list.call_escalations].flatten\n @number_index = params[:number_index].to_i || 0\n @try = (params[:try] || 1).to_i\n dialCallStatus = params[:DialCallStatus] || \"\"\n\n @call_escalation = get_number_to_call\n\n if dialCallStatus != \"completed\" && @call_escalation\n return\n elsif dialCallStatus == \"completed\"\n render :text => \"<Response><Hangup/></Response>\"\n else\n render :text => \"<Response><Say>No one on the call list pick up their phone. Good bye.</Say><Hangup/></Response>\"\n end\n end",
"def incoming_text\n # Looks up the incoming phone number in our database and\n # retrieves the lead if found:\n begin\n standard_phone = Phoner::Phone.parse(params['From'], country_code: '1').to_s\n @lead = Lead.find_by(standard_phone: standard_phone) if standard_phone\n rescue\n # An exception may happen if the texter's phone number has a very unusual\n # format. We can just move on, as finding the texter's number in our\n # database is not critical.\n end\n\n # If we do find the texter in our database, we provide extra info about\n # this lead to our call converter:\n extra_info = @lead.email if @lead\n\n # We text the texter's message to the call converter's phone:\n @client = Twilio::REST::Client.new\n @client.messages.create(\n from: ENV['TWILIO_PHONE_NUMBER'],\n to: ENV['EMPLOYEE_PHONE_NUMBER'],\n body: \"Message from #{params['From']}: #{params['Body']}. Extra Info: #{extra_info}\"\n )\n end",
"def reminderCall\n @twilio_number = ENV['TWILIO_NUMBER']\n @client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n call = @client.account.calls.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :url => 'https://clockairos.herokuapp.com/twilio/call',\n :method => 'POST',\n :fallback_method => 'GET',\n :status_callback_method => 'GET',\n :if_machine => 'Hangup',\n :timeout => '30',\n :record => 'false'\n )\n puts call.to\n end",
"def phone_call(message)\n Ruboty::Call::Actions::Call.new(message).call\n end",
"def make_call (number, international_code = 1, area_code = 646)\n puts \"Calling #{international_code}-#{area_code}-#{number}\"\n end",
"def answer(call)\n cmd = \"ALTER CALL #{call.call_id} ANSWER\"\n r = Skype.send_ :command => cmd\n raise RuntimeError(\"Failed to answer call. Skype returned '#{r}'\") unless r == cmd\n @@calls << call\n end",
"def place_calls\n @calls.each do |call|\n target, specific_options = @call_targets[call]\n local_options = @options.dup.deep_merge specific_options if specific_options\n call.dial target, (local_options || @options)\n end\n end",
"def prep_calls\n @calls = Set.new\n @targets.map do |target, specific_options|\n new_call = OutboundCall.new\n\n join_status = JoinStatus.new\n status.joins[new_call] = join_status\n\n new_call.on_end do |event|\n @latch.countdown! unless new_call[\"dial_countdown_#{@id}\"]\n if event.reason == :error\n status.error!\n join_status.errored!\n end\n end\n\n new_call.on_answer do |event|\n new_call.on_joined @call do |joined|\n join_status.started joined.timestamp.to_time\n end\n\n new_call.on_unjoined @call do |unjoined|\n join_status.ended unjoined.timestamp.to_time\n unless @splitting\n new_call[\"dial_countdown_#{@id}\"] = true\n @latch.countdown!\n end\n end\n\n if @confirmation_controller\n status.unconfirmed!\n join_status.unconfirmed!\n condition = Celluloid::Condition.new\n new_call.execute_controller @confirmation_controller.new(new_call, @confirmation_metadata), lambda { |call| condition.broadcast }\n condition.wait\n end\n\n if new_call.active? && status.result != :answer\n logger.info \"#dial joining call #{new_call.id} to #{@call.id}\"\n pre_join_tasks new_call\n @call.answer\n new_call.join @join_target, @join_options\n unless @join_target == @call\n @call.join @join_target, @join_options\n end\n status.answer!\n elsif status.result == :answer\n join_status.lost_confirmation!\n end\n end\n\n @call_targets[new_call] = [target, specific_options]\n\n yield new_call if block_given?\n\n @calls << new_call\n end\n\n status.calls = @calls\n end",
"def turn_number(pharm_number,off_or_on,staff_phone_number)\n $stderr.puts \"trying to turn number #{off_or_on}\"\n # does not allow anyone to turn off a primary number\n is_primary_number = Pharmacy.where(:preferred_number_id => pharm_number).count > 0\n\n if (is_primary_number)\n sms_message = \"Sorry this is the primary number associated with this pharmacy. If this number needs to be turned off, please contact Satter.\"\n $client.account.sms.messages.create(\n :from => $sms_out_number,\n :to => staff_phone_number,\n :body => sms_message)\n\n else\n\n #TO DO : we may have this number lingerieng hte in the pending calls table so probably want to check and remove\n\n Number.where(:id => pharm_number).first.update(:call_this_number => off_or_on == 'on' ? 1 : 0)\n sms_message_confirmation = \"#{pharm_number} has been turned #{off_or_on}. Thank you.\"\n $client.account.sms.messages.create(\n :from => $sms_out_number,\n :to => staff_phone_number,\n :body => sms_message_confirmation)\n end\n nil\nend",
"def next(is_blind,who, to_call, min, max)\r\n #debug \"NEXT is #{@players[who].name} (#{who}), to_call=#{to_call}, #{who==@infos.position}\"\r\n @who, @to_call, @min_raise, @max_raise = who, to_call, min, max\r\n return play if(!is_blind and who==@infos.position)\r\n return nil\r\n\tend",
"def requires_call(max_lag,max_attempts)\n # now find the correct entry in pending_calls\n call = self.pending_call\n if (self.is_late(max_lag))\n puts \"pharmacy #{self.id} is late\"\n if (call.attempts.to_i < max_attempts.to_i)\n puts \"#{call.attempts} attempts left out of #{max_attempts}\"\n if (self.is_acceptable_call_time)\n #note that is_acceptable call time acutally will update attemps if it is an acceptable time\n puts \"acceptable call time\"\n call.update(:number_id => self.get_next_number(call.number_id))\n ## if we are on the last number then update attempts\n if (self.is_last_available_number(call.number_id))\n puts \"last available number\"\n call.update(:attempts => call.attempts + 1)\n end\n\n return true\n end\n ## if attempts are greater than max attemps then\n else\n ## alert admins if we haven't already done so\n unless call.error_message_sent\n puts call.error_message_sent\n puts \"issuing error\"\n error_message = \"Pharmacy (pid:#{self.id}) could not be reached\"\n\n Error.report({\n :number_id => self.preferred_number_id,\n :message => error_message,\n :code => 2,\n :created_at => Time.now\n })\n\n call.update(:error_message_sent => 1)\n end\n end\n end\n return false\n end",
"def outboundcall\n # This FromPhoneNumber should have been verified in the associated sub-account\n render_twiml generateTwiml(params[:FromPhoneNumber], params[:ToPhoneNumber])\n end",
"def sa_phone_previously_collected?(question)\n answer_for(question, valid_response_exists?(\"PARTICIPANT_VERIF.SA_PHONE\"))\n end",
"def answer_on_next_prompt answer\r\n command 'answerOnNextPrompt', answer\r\n end",
"def answer_on_next_prompt answer\r\n command 'answerOnNextPrompt', answer\r\n end",
"def process_conversation(gateway_name, phone, msg_body)\n msg_body.strip! if msg_body\n\n if !msg_body || msg_body==''\n return process_help(gateway_name,phone,msg_body)\n end\n\n from_users = get_system_org.users.find_all_by_phone(phone)\n\n # if this is the format of a validation code\n # and there is a user requiring validation\n # this takes priority\n might_be_conf_code = (msg_body =~ /the code is (\\d+)/ || msg_body =~ /^\\s*(\\d+)/)\n if might_be_conf_code\n conf_code = $1\n logger.info(\"Attempting to verify phone #{phone} with code #{msg_body}\")\n validating_user = from_users.detect { |user| !user.sms_validated? && user.sms_validation_sent==msg_body }\n # note: even if multiple users are using a phone, and one user is not validated, but this user does return correctly, then this validation will succeed\n # note: if this is an incorrect validation code, then the response\n # if there is no message should reflect an invalid validation code\n # not an invalid conversation piece.\n return process_validation(gateway_name,validating_user,conf_code) if validating_user\n end\n\n # only validated users can be in conversations\n from_users.reject! {|user| !user.sms_validated?}\n\n # if we reach here, it might be a conversation response\n # find recent messages sent to the users\n # if there is only one recent message -> reply to this\n # if there are multiple messages and only one user -> user must address\n # if there are multiple users on the phone -> user must identify themselves -> overcome by just asking to address the message\n num_senders = 0\n msgs = from_users.collect() do |user|\n user_msgs = user.recent_msgs(APP_SETTINGS[:conversations_timeout])\n\n # ignore system messages\n user_msgs.reject! {|m| m.from==OCP::standardize_unique_name(FROM_SYSTEM_NAME)}\n\n # ignore messages from self\n user_msgs.reject! {|m| m.from==user.login_name}\n\n # remove duplicates from the from addresses\n senders = user_msgs.inject([]) do |all_from,m|\n std_name = OCP::standardize_unique_name(m.from)\n (all_from.include?(std_name) ? all_from : all_from.push(std_name))\n end\n\n num_senders += senders.count\n #puts \"\\nSENDERS:***\\n\"+senders.inspect\n (senders.length>0 ? [user,senders] : nil )\n end.compact\n #puts \"\\nCOMBINED MSGS ***\\n\"+msgs.inspect\n\n if (num_senders==1)\n from_user = msgs[0][0]\n org = from_user.org\n prev_sender = msgs[0][1][0]\n to_user = org.find_recipient_by_name(prev_sender)\n if to_user\n msg = safe_send_msg(org, from_user, to_user,msg_body)\n result = \"Sent message to #{to_user.login_name}\"\n reply_to_sender(phone,result)\n return result,false\n else\n logger.debug \"Could not find user who sent the last message: from = #{prev_sender}\"\n must_address = true\n end\n else\n must_address = num_senders>1\n # if no messages then something else\n end\n\n case\n when might_be_conf_code\n return reply_to_sender_with_error(phone, REPLY_VERIFY_DO_NOT_RECOGNIZE_PHONE_AND_CODE)\n when must_address\n all_senders = msgs.collect {|m| m[1].join(',')}\n return reply_to_sender_with_error(phone, sprintf(REPLY_CONVERSATION_MUST_ADDRESS,all_senders.join(',')))\n else\n # no command do nothing\n log_event(\"receive\", \"Unknown request: #{msg_body}\")\n result = \"Unknown command #{msg_body}\"\n error = true\n return result,error\n end\nend",
"def cell_phone_in_e164; end",
"def pa_phone_previously_collected?(question)\n answer_for(question, valid_response_exists?(\"PARTICIPANT_VERIF.PA_PHONE\"))\n end",
"def calls; end",
"def calls; end",
"def make_call(call_count, to_number, from_number)\n call_count.times do \n Adhearsion::OutboundCall.originate(\"SIP/#{to_number}@SIPSERVICEHERE\", :from => \"#{from_number}\", :controller => FooController)\n end\n end",
"def log\n # When someone actually picks up the call\n if params[:DialAction] == 'answer'\n user_number = UserNumber.find_by_sip_endpoint(params[:DialBLegTo])\n @call.update! user_number: user_number\n # When the call is over, we log the call duration and the time it took to\n # pick up the call\n elsif params[:DialAction] == 'hangup' &&\n params[:DialBLegHangupCause] == 'NORMAL_CLEARING'\n pickup_time = params[:AnswerTime].to_time - params[:StartTime].to_time\n @call.update! duration: params[:DialBLegDuration], pickup_time: pickup_time\n end\n render nothing: true\n end",
"def calling_speak\n speak\n end",
"def call_sign; end",
"def initiate_conference\n @call = Call.find(params[:id])\n @call.participants.each do |participant|\n #TWILIO_CLIENT.account.calls.create({from: '+12065382886', to: \"+1#{participant.phone}\", url: \"http://dial-me-in.herokuapp.com/calls/#{@call.id}/handle_call\"})\n end\n\n redirect_to @call\n end",
"def get_next_on_calls_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WhoIsOnCallApi.get_next_on_calls ...\"\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling WhoIsOnCallApi.get_next_on_calls\"\n end\n if @api_client.config.client_side_validation && opts[:'schedule_identifier_type'] && !['id', 'name'].include?(opts[:'schedule_identifier_type'])\n fail ArgumentError, 'invalid value for \"schedule_identifier_type\", must be one of id, name'\n end\n # resource path\n local_var_path = \"/v2/schedules/{identifier}/next-on-calls\".sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'scheduleIdentifierType'] = opts[:'schedule_identifier_type'] if !opts[:'schedule_identifier_type'].nil?\n query_params[:'flat'] = opts[:'flat'] if !opts[:'flat'].nil?\n query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['GenieKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GetNextOnCallResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WhoIsOnCallApi#get_next_on_calls\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def makecall\n \n client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])\n @call = client.account.calls.create(\n :from => TWILIO_CONFIG['from'], # From your Twilio number\n :to => '+19493228496', # To any number\n # Fetch instructions from this URL when the call connects\n :url => 'http://snipit.herokuapp.com/voicein'\n )\n end",
"def answer\n return render nothing: true unless params[:Event] == 'StartApp'\n\n @from = params[:From]\n company_number = CompanyNumber.find_by_sip_endpoint params[:To]\n Call.create! from: @from, call_uuid: params[:CallUUID], company_number: company_number\n @user_numbers = company_number.users.joins(:user_numbers).select('user_numbers.sip_endpoint')\n end",
"def voice\n from_number = params['FromNumber'].blank? ? ENV['TWILIO_CALLER_ID'] : params['FromNumber']\n twiml = Twilio::TwiML::Response.new do |r|\n if params['To'] and params['To'] != ''\n r.Dial callerId: from_number do |d|\n # wrap the phone number or client name in the appropriate TwiML verb\n # by checking if the number given has only digits and format symbols\n if params['To'] =~ /^[\\d\\+\\-\\(\\) ]+$/\n d.Number params['To']\n else\n d.Client params['To']\n end\n end\n else\n r.Say \"Thanks for calling!\"\n end\n end\n\n render xml: twiml.text\n end",
"def calculate(message, phone)\n \n puts message.to\n end",
"def coach_answer(your_message)\n # TODO: return coach answer to your_message\n if your_message[-1] == \"?\" then puts \"Silly question, get dressed and go to work !\"\n else puts \"I don't care son, get dressed and go to work !\"\n end\nend",
"def call_number\n call['dispCallNumber'] || fields['dispCallNumber']\n end",
"def parseLink block\n\n# log \"parseLink #{block[\"Uniqueid1\"]}\\n\"\n puts \"\\n --- ParseLink start ---\\n\"\n# pp block\n pp $calls.inspect\n\n\n if block[\"Bridgestate\"].include? \"Link\" and\n not ($calls.has_value? block[\"Uniqueid1\"]) and \n block[\"Channel2\"].include? \"SIP/\"\n \n pp block\n pp $calls.inspect\n pp block[\"Uniqueid1\"]\n\n $from = block[\"CallerID1\"]\n $to = block[\"CallerID2\"]\n $id = block[\"Uniqueid1\"]\n# $calls.inspect\n\n # log \"call\\n\"\n puts \"\\n ---- bridge link for call ----- \\n\"\n\n if($to.size < 6)\n pp $from\n pp $to\n pp $id\n\n if($from.size == 12)\n pp \"curl -k --max-time 3 'https://\" + $app[\"link\"] + \"/rest/register_call/?phone=+\" + $from + \"&direction=incoming&comment=\" + $id + \"&internal_phone=\" + $to + \"&ukey=\" + $app[\"ukey\"] + \"&tz=3'\"\n puts system(\"curl -k --max-time 3 'https://\" + $app[\"link\"] + \"/rest/register_call/?phone=+\" + $from + \"&direction=incoming&comment=\" + $id + \"&internal_phone=\" + $to + \"&ukey=\" + $app[\"ukey\"] + \"&tz=3'\")\n\n else\n pp $from\n end\n\n else\n block[\"Channel1\"][/\\/(\\d+)-/]\n $from=$1\n pp $from\n pp $to\n pp $id\n pp \"curl -k --max-time 3 'https://\" + $app[\"link\"] + \"/rest/register_call/?phone=+\" + $to + \"&direction=outgoing&comment=\" + $id + \"&internal_phone=\" + $from + \"&ukey=\" + $app[\"ukey\"] + \"&tz=3'\"\n puts system(\"curl -k --max-time 3 'https://\" + $app[\"link\"] + \"/rest/register_call/?phone=\" + $to + \"&direction=outgoing&comment=\" + $id + \"&internal_phone=\" + $from + \"&ukey=\" + $app[\"ukey\"] + \"&tz=3'\")\n\n end\n $calls[block[\"Uniqueid1\"]]= block[\"Uniqueid1\"]\n puts \"\\n --- ParseLink end ---\\n\"\n pp $calls.inspect\n end\nend",
"def actions()\n\t(\n\t\tcall_src_sip_username = _arg( 'Caller-Username' )\n\t\tcall_src_cid_userinfo = _arg( 'Caller-Caller-ID-Number' )\n\t\tcall_src_cid_displayname = _arg( 'Caller-Caller-ID-Name' )\n\t\tcall_dst_sip_userinfo = _arg( 'Caller-Destination-Number' )\n\t\tcall_dst_sip_domain = _arg( 'var_sip_to_host' )\n\t\t\n\t\t# Strip \"-kambridge-\" prefix added in kamailio.cfg:\n\t\tcall_dst_sip_userinfo = call_dst_sip_userinfo.gsub( /^-kambridge-/, '' )\n\t\t\n\t\tlogger.info(_bold( \"[FS] Call-proc. request, acct. #{call_src_sip_username.inspect} as #{call_src_cid_userinfo.inspect} (#{call_src_cid_displayname.inspect}) -> #{call_dst_sip_userinfo.inspect} ...\" ))\n\t\t_args.each { |k,v|\n\t\t\tcase v\n\t\t\t\twhen String\n\t\t\t\t\t#logger.debug( \" #{k.ljust(36)} = #{v.inspect}\" )\n\t\t\t\t#when Hash\n\t\t\t\t#\tv.each { |k1,v1|\n\t\t\t\t#\t\tlogger.debug( \" #{k}[ #{k1.ljust(30)} ] = #{v1.inspect}\" )\n\t\t\t\t#\t}\n\t\t\tend\n\t\t}\n\t\t\n\t\t# For FreeSwitch dialplan applications see\n\t\t# http://wiki.freeswitch.org/wiki/Mod_dptools\n\t\t# http://wiki.freeswitch.org/wiki/Category:Dptools\n\t\t\n\t\t# Note: If you want to do multiple iterations (requests) you\n\t\t# have to set channel variables to keep track of \"where you\n\t\t# are\" i.e. what you have done already.\n\t\t# And you have to explicitly send \"_continue\" as the last\n\t\t# application.\n\t\t\t\t\n\t\tif call_dst_sip_userinfo.blank?\n\t\t\tcase _arg( 'Answer-State' )\n\t\t\t\twhen 'ringing'\n\t\t\t\t\taction :respond , '404 Not Found' # or '400 Bad Request'? or '484 Address Incomplete'?\n\t\t\t\telse\n\t\t\t\t\taction :hangup , ''\n\t\t\tend\n\t\telse\n\t\t\t\n\t\t\tcall_dst_real_sip_username = call_dst_sip_userinfo # un-alias\n\t\t\t# (Alias lookup has already been done in kamailio.cfg.)\n\t\t\t\n\t\t\t# Here's an example: {\n\t\t\t#action :set , 'effective_caller_id_number=1234567'\n\t\t\t#action :bridge , \"sofia/internal/#{call_dst_real_sip_username}\"\n\t\t\t#action :answer\n\t\t\t#action :sleep , 1000\n\t\t\t#action :playback , 'tone_stream://%(500, 0, 640)'\n\t\t\t#action :set , 'voicemail_authorized=${sip_authorized}'\n\t\t\t#action :voicemail , \"default $${domain} #{call_dst_real_sip_username}\"\n\t\t\t#action :hangup\n\t\t\t#action :_continue\n\t\t\t# end of example }\n\t\t\t\n\t\t\t\n\t\t\t# http://kb.asipto.com/freeswitch:kamailio-3.1.x-freeswitch-1.0.6d-sbc#dialplan\n\t\t\t\n\t\t\t#OPTIMIZE Implement call-forwardings here ...\n\t\t\t\n\t\t\t# Ring the SIP user via Kamailio for 30 seconds:\n\t\t\taction_log( FS_LOG_INFO, \"Calling #{call_dst_real_sip_username} ...\" )\n\t\t\taction :set , \"call_timeout=5\"\n\t\t\taction :export , \"sip_contact_user=ufs\"\n\t\t\taction :bridge , \"sofia/internal/#{call_dst_real_sip_username}@127.0.0.1\"\n\t\t\t\n\t\t\t#OPTIMIZE Implement call-forward on busy/unavailable here ...\n\t\t\t\n\t\t\t# Go to voicemail:\n\t\t\taction_log( FS_LOG_INFO, \"Going to voicemail ...\" )\n\t\t\taction :answer\n\t\t\taction :voicemail , \"default #{call_dst_sip_domain} #{call_dst_real_sip_username}\"\n\t\t\taction :hangup\n\t\t\t\n\t\t\t\n\t\tend\n\t\t\n\t\t\n\t\trespond_to { |format|\n\t\t\tformat.xml {\n\t\t\t\trender :actions, :layout => false\n\t\t\t}\n\t\t\tformat.all {\n\t\t\t\trender :status => '406 Not Acceptable',\n\t\t\t\t\t:layout => false, :content_type => 'text/plain',\n\t\t\t\t\t:text => \"<!-- Only XML format is supported. -->\"\n\t\t\t}\n\t\t}\n\t\treturn\n\t)end",
"def caseoftelephone(gossip)\n print gossip\n secondanswer = gets\nend",
"def assign_phone_number\n if !params[:customer].blank? && !params[:call_id].blank?\n call = Radius::Call.find_by_radacctid(params[:call_id].to_i)\n customer = Customer.find_by_name_and_address(params[:customer])\n if !call\n flash[:error] = 'Call not found'\n elsif !customer\n flash[:error] = 'Customer not found'\n else\n customer.phones.add call.caller\n end\n end\n redirect_to :action => :index\n end",
"def update_call_list(call_job, twilio_contact=nil)\n\n #if !twilio_contact.nil?\n #\ttwilio_contact.contacted = true;\n #\ttwilio_contact.save\n #end\n call_next_provider(call_job)\n end",
"def active_call\n return is_on_time(self.calls.last) ? self.calls.last : nil\n end",
"def on_directed_message(message, speaker, buddy, command_executed)\n #at this stage we do nothing...\n end",
"def next_follow\n end",
"def get_call_status\r\n\t dialstatus = get_variable(\"dialstatus\")\r\n\t if dialstatus == nil #the dial command has not returned yet..thus the call is in progress\r\n\t return :InProgress\r\n\t elsif dialstatus == \"ANSWER\" #the dial command returned from a successfully answered call\r\n\t return :Answered\r\n\t elsif dialstatus == \"BUSY\" #the dial command met with a busy signal on the other end\r\n\t return :Busy\r\n\t elsif dialstatus == \"NOANSWER\" #the dial command aborted due to no answer\r\n\t return :NoAnswer\r\n\t elsif dialstatus == \"CONGESTION\" #the dial command failed due to congestion\r\n\t return :Congestion\r\n\t elsif dialstatus == \"CHANUNAVAIL\" #the dial command failed due to misc reasons.\r\n\t return :ChannelUnavailable\r\n\t else\r\n\t return :Offline #not sure\r\n\t end\r\n\tend",
"def call_to\n @number = params[:number]\n user_id = session[:user_id]\n user = User.find(user_id)\n\n @error = \"\"\n device = user.primary_device\n\n if device\n # originate callback\n src = device.extension\n dst = @number\n #var2 = \"__MOR_CALLC_ACTION_ID=#{action.id.to_s}\"\n\n server = Confline.get_value(\"Web_Callback_Server\").to_i\n server = 1 if server == 0\n\n channel = \"Local/#{src}@mor_cb_src/n\"\n st = originate_call(device.id, src, channel, \"mor_cb_dst\", dst, device.callerid_number, nil, server)\n @error = _('Cannot_connect_to_asterisk_server') if st.to_i != 0\n else\n @error = _('No_device')\n end\n\n render(:layout => false)\n end",
"def reply\n body_arr = params[:Body].split(' ')\n method = body_arr[0]\n if method.upcase == 'REGISTER'\n p \"Registering User #{body_arr[1]} from #{params[:From]}\"\n User.register(params[:From], body_arr[1])\n send_sms(params[:From], \"User registered. Hello #{body_arr[1]}!\")\n Thread.new(params[:From], &method(:send_question))\n head 201 && return # Response is given to Twilio server for possible future use. \n elsif User.get(params[:From], 'name').nil?\n p 'User does not exist!'\n\n send_sms(params[:From], \"Please register with the form 'REGISTER <name>'.\")\n head 404 && return\n else \n # process answer\n answer = method\n p \"Processing answer #{answer}\"\n #TODO-v1: critical section to prevent user from keeping hitting the endpoint \n if answer == Question.get(User.get(params[:From], 'curr_ques_id'), 'answer')\n prev_count = User.get(params[:From], 'count')\n User.update(params[:From], 'count', prev_count.to_i + 1)\n if User.get(params[:From], 'count') == '5' #TODO: dynamic number\n send_sms(params[:From], 'Congratulations, you hit 5 question! Reward is sent. Answered question is cleared to 0')\n User.update(params[:From], 'count', 0) \n else\n send_sms(params[:From], \"Answer recorded.\\nYou have answered #{User.get(params[:From], 'count')} questions correctly.\")\n end\n else \n send_sms(params[:From], \"Wrong answer.\\nDon't be upset. You still have answered #{User.get(params[:From], 'count')} questions correctly.\")\n end\n User.update(params[:From], 'curr_ques_id', '-1') # So that user cannot answer the same question again and again! Fixed the repeat msg problem \n Thread.new(params[:From], &method(:send_question))\n head 204 && return\n end\n end",
"def fallback_to_twilio\n sms.output = :twilio\n sms.deliver\n end",
"def check_next_question(msg)\n msg.downcase.include? 'next'\nend",
"def accepted_receiver\n self.receiver ||= if accepted_response = self.responses.accepted.first\n accepted_response.person\n end\n end",
"def next_message; end",
"def next_message; end",
"def dial_up_numbers_ok? \n (!senior.blank? && !senior.devices.gateways.first.blank?) ? senior.devices.gateways.first.dial_up_numbers_ok? : false\n #\n # Fri Sep 24 04:26:03 IST 2010\n # logic updated to check user.devices by type of device\n #\n # senior.blank? ? false : senior.dial_up_numbers_ok_for_device?( senior.device_by_serial_number( kit_serial_number))\n end",
"def call1\n call2 # => 222\n call3 # => 333\nend",
"def triage_select\n case params['Digits']\n when '*'\n @phone_call.miss! 'after_hours'\n render action: :goodbye, formats: [:xml]\n return\n when '1'\n @phone_call.transfer! Member.robot\n @phone_call.miss! 'after_hours'\n @nurseline_phone_call = @phone_call.transferred_to_phone_call\n render action: :transfer_nurse, formats: [:xml]\n return\n end\n\n redirect_to action: :triage_menu, id: @phone_call.id\n end",
"def call?\n if rejection_reason\n TinyDialer::Log.info \"Rejected #{phone}: #{rejection_reason}\"\n return\n end\n # Make sure (now, now) overlaps (start, stop)\n now = (Time.now.utc + (3600*(timezone)).to_i).strftime('%H:%M')\n unless TinyDialer.db.fetch(\"select ('#{now}'::text::time, '#{now}'::text::time) OVERLAPS ('#{state.start}'::text::time, '#{state.stop}'::text::time)\").first[:overlaps]\n TinyDialer::Log.info \"Rejected #{phone}: Outside of calling times #{state.start} and #{state.stop}\"\n return false\n end\n true\n rescue => e\n TinyDialer::Log.error e\n return\n end",
"def preferred_contact_detail\n return nil if preferred_contact_method.blank?\n if preferred_contact_method == (\"Home Phone\")\n number_to_phone(phone_home)\n elsif preferred_contact_method == (\"Mobile Phone\")\n number_to_phone(phone_mobile)\n elsif preferred_contact_method.include?(\"Email\")\n email\n end\n end",
"def create\n @call = Call.new(params[:call])\n \n respond_to do |format|\n if @call.save\n \n result = OutgoingCallerId.find(:last)\n twcall = @twilio_client.account.calls.create(\n from: result.phone_number,\n to: @call.to, \n url: \"#{url_for(@call)}/twiml.xml\")\n \n @call.update_attribute :sid, twcall.sid\n format.html { redirect_to @call, notice: \"Call was successfully created.#{url_for(@call)}\" }\n format.json { render json: @call, status: :created, location: @call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end",
"def number(twilio=false, name=nil, area_code=nil)\n if twilio\n # Check if twilio configuration exists. If not throw and errors because twilio was passed as true.\n if !@config[:configuration][:twilio].blank? and (!@config[:configuration][:twilio][:account_id].blank? and !@config[:configuration][:twilio][:api_key].blank?)\n account = @config[:configuration][:twilio][:account_id]\n key = @config[:configuration][:twilio][:api_key]\n\n # Initialize twilio client.\n twilio = Twilio::REST::Client.new account, key\n\n # If any area code is provide look for local numbers, if not get a toll free.\n if area_code.blank?\n available_numbers = twilio.account.available_phone_numbers.get('US').toll_free.list\n else\n available_numbers = twilio.account.available_phone_numbers.get('US').local.list(area_code: area_code) unless area_code.blank?\n end\n\n # Select the first number available.\n available_number = available_numbers.first\n\n # If available numbers is blank throw an error because something went wrong.\n if available_numbers.blank?\n raise StandardError, \"No Available Numbers\"\n else\n\n # Convert the phone number into something a artificial voice can say.\n phone_number = available_number.phone_number.gsub(\"+1\",\"\")\n phone_number = \"#{phone_number[0..2]}-#{phone_number[3..5]}-#{phone_number[6..10]}\"\n\n\n # Setting the transciption email\n # email = @config[:configuration][:twilio][:transcription_email].blank? ? \"developers%40level.agency\" : @config[:configuration][:twilio][:transcription_email]\n email = \"developers%40level.agency\"\n # Put together the voicemail Twimil.\n voice_message = \"http://twimlets.com/voicemail?Email=#{email}&Message=You%20reached%20the%20voicemail%20box%20of%20#{phone_number}.%20%20Please%20leave%20a%20message%20after%20the%20beep.&Transcribe=true&\"\n\n # Here we buy the number, set the voice_url to the voicemail Twimil and set the\n # sms_url to echo so Twilio will capture the message but not reply to it.\n number = twilio.account.incoming_phone_numbers.create({\n phone_number: available_number.phone_number,\n friendly_name: name,\n voice_url: voice_message,\n voice_method: \"GET\",\n sms_url: \"http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E\",\n sms_method: \"GET\"\n })\n\n # If number is blank throw and error because something went wrong.\n if number.blank?\n raise StandardError, \"Unable to allocate Twilio number\"\n else\n number.phone_number\n end\n end\n else\n raise ArgumentError, \"Cannot find Twilio Account ID and API key in configuration\"\n end\n else\n Faker::PhoneNumber.phone_number\n end\n end",
"def confirm\n\t\tusersnumber = params[\"From\"]\n\n\t\t@ix = Telapi::InboundXml.new do\n\t\t Gather(:action => '',\n\t\t :method => 'POST',\n\t\t :numDigits => '1',\n\t\t :finishOnKey => '#') {\n\t\t Say 'Thank you for confirming'\n \t\t}\t\t \n \t\tend\n\n\t \trespond_to do |format| \n\t \t\tformat.xml { render :xml => @ix.response } \n\t\tend\n\n\t\tuser = Caller.where(:number => usersnumber).first\n\n\t\t#Change back to this for testing purposes\n\t\tschedtime= Time.parse(\"#{Date.today} #{user.time} #{user.ampm} #{user.timezone}\")\n\t\t#schedtime= Time.parse(\"#{Date.tomorrow} #{user.time} #{user.ampm} #{user.timezone}\")\n\n\t\tscheduler = Rufus::Scheduler.start_new\n\n\t\t#Date.tomorrow + \" \" + \n\t\t#scheduler.at \"#{Date.tomorrow} #{schedtime}\" do\n\t\tscheduler.at \"#{schedtime}\" do\n\n \t\tTelapi::Call.make(usersnumber, '(201) 604-4992', 'https://www.telapi.com/data/inboundxml/404c735f21d00fee39a13210d54844f3cec069c7')\n\tend\n\n#Todo\n#When calling the user ask them to press 1, if it is not pressed after 5 seconds\n#it will hangup and call them again\n\n#Cool idea\n#Let the user record a message and it will call a friend if they do not pickup\n\n#Another idea, we could use <GetSpeech> with a grammer file for the IVRs\n\n\tend",
"def calls(type, date_from, date_till, direction = \"outgoing\", order_by = \"calldate\", order = \"DESC\", device = nil, options = {})\n calls = []\n # ------ handle call type --------\n call_type_sql = \" AND disposition = '#{type}' \"\n if type == \"all\"\n call_type_sql = \"\"\n end\n # special case\n if type[0..5] == \"missed\"\n call_type_sql = \" AND disposition != 'ANSWERED'\"\n\n if type[7..19] == \"not_processed\"\n call_type_sql += \" AND processed = 0 \"\n end\n\n end\n\n # ---------- handle device ---------\n device_sql = \"\"\n if device\n if direction == \"incoming\"\n device_sql= \" AND dst_device_id = #{device.id} \"\n else\n device_sql = \" AND src_device_id = #{device.id} \"\n end\n end\n\n\n # ---------- handle Hangupcausecode ---------\n hgc_sql = \"\"\n if options[:hgc]\n hgc_sql= \" AND calls.hangupcause = #{options[:hgc].code} \"\n end\n\n\n # -------- handle resellers ---------\n reseller_sql = \"\"\n #if usertype == \"reseller\"\n #reseller_sql = \" OR calls.reseller_id = #{id} \"\n #end\n\n\n find = ['calls.*']\n find << \"DATE_FORMAT(calldate, \\\"%Y-%m-%d %H:%i:%S\\\") as `formated_calldate`\" if options[:format_calldate]\n from = []\n if options[:providers] == true\n find << \"providers.name as 'provider_name'\"\n from << \"LEFT JOIN providers ON (providers.id = calls.provider_id)\"\n end\n\n if options[:destinations] == true\n find << \"destinations.subcode AS 'destination_subcode'\"\n find << \"destinations.name AS 'destination_name'\"\n find << \"directions.name AS 'direction_name'\"\n\n from << \"LEFT JOIN destinations ON (destinations.prefix = calls.prefix)\"\n from << \"LEFT JOIN directions ON (directions.code = destinations.direction_code)\"\n end\n if options[:count] == true\n find = [\"COUNT(*) AS 'total_count'\"]\n end\n # -------- retrieve calls -----------\n sql = \"\"\n if direction == \"incoming\" #incoming calls\n sql = \"SELECT #{ find.join(',') } FROM calls #{from.join(' ')} JOIN devices ON (devices.id = calls.dst_device_id) LEFT JOIN dids ON (calls.did_id = dids.id) WHERE (calls.card_id = 0 AND (((devices.user_id = #{id}) OR (dids.user_id = #{id})) #{reseller_sql} )#{call_type_sql} #{device_sql} #{hgc_sql} AND ((calldate BETWEEN '#{date_from.to_s}' AND '#{date_till.to_s}'))) ORDER BY #{order_by} #{order} #{ 'LIMIT ' + options[:offset].to_s + ', ' + options[:limit].to_s if (options[:limit] and options[:offset])};\"\n else # outgoing calls\n sql = \"SELECT #{ find.join(',') } FROM calls #{from.join(' ')} WHERE (calls.card_id = 0 AND (calls.user_id = #{id} #{reseller_sql}) #{call_type_sql} #{device_sql} #{hgc_sql} AND ((calldate BETWEEN '#{date_from.to_s}' AND '#{date_till.to_s}'))) ORDER BY #{order_by} #{order} #{ 'LIMIT ' + options[:offset].to_s + ', ' + options[:limit].to_s if (options[:limit] and options[:offset]) };\"\n end\n Call.find_by_sql(sql)\n end",
"def call1\n call2 # => 222\n call3 # => 333\nend",
"def start_gather_info\n\t\t@reminder = Reminder.find(params[:id])\n\t\t@reminder.create_report\n\t\t\n\t\t# set up a client to talk to the Twilio REST API \n\t\t@client = Twilio::REST::Client.new ACC_SID, AUTH_TOKEN\n\t\tUser.all.each do |u|\n\t\t\t@client.account.calls.create({\n\t\t\t\t:from => '+918754489839', \n\t\t\t\t:to => \"+91#{u.mobile_number}\", \n\t\t\t\t:url => twilio_voice_callback_reminder_url(@reminder, :format => \"xml\"), \n\t\t\t\t:method => 'GET', \n\t\t\t\t:fallback_method => 'GET', \n\t\t\t\t:status_callback_method => 'GET', \n\t\t\t\t:record => 'false'\n\t\t\t})\n\t\tend\n\t\tredirect_to reminders_path\n\tend",
"def originate_call(acc, src, channel, context, extension, callerid, var2 = nil, server_id = 1)\n\n # acc - which device is dialing (devices.id)\n # src - who receives call first (device's name/extension)\n # channel - usually == \"Local/#{src}@mor_cb_src/n\"\n # context - usually == \"mor_cb_dst\"\n # extension - who receives call second\n # callerid - what CallerID to apply to both calls\n # var2 - additional variables\n # server_id - on which server activate callback\n\n # --------- USING AMI ----------\n @server = Server.where(:server_id => server_id).first\n if !@server or @server.active != 1\n connection_status = 1\n else\n ami_host = @server.server_ip\n ami_username = @server.ami_username\n ami_secret = @server.ami_secret\n\n server = Rami::Server.new({'host' => ami_host, 'username' => ami_username, 'secret' => ami_secret})\n server.console =1\n server.event_cache = 100\n server.run\n\n client = Rami::Client.new(server)\n client.timeout = 3\n\n accs = acc.to_s\n variable = \"MOR_ACC=#{accs}\"\n\n sep = (ast_18? ? \",\" : \"|\")\n\n variable += sep + var2 if var2 and var2.length > 0\n\n=begin\nCLI> manager show command originate\nAction: Originate\nSynopsis: Originate Call\nPrivilege: call,all\nDescription: Generates an outgoing call to a Extension/Context/Priority or\n Application/Data\nVariables: (Names marked with * are required)\n *Channel: Channel name to call\n Exten: Extension to use (requires 'Context' and 'Priority')\n Context: Context to use (requires 'Exten' and 'Priority')\n Priority: Priority to use (requires 'Exten' and 'Context')\n Application: Application to use\n Data: Data to use (requires 'Application')\n Timeout: How long to wait for call to be answered (in ms)\n CallerID: Caller ID to be set on the outgoing channel\n Variable: Channel variable to set, multiple Variable: headers are allowed\n Account: Account code\n Async: Set to 'true' for fast origination\n=end\n\n t = client.originate({'Channel' => channel, 'Context' => context, 'Exten' => extension, 'Priority' => \"1\", 'Async' => \"no\", 'Variable' => variable, \"CallerID\" => callerid, \"Account\" => accs, \"Timeout\" => \"1200000\"})\n\n client.stop\n\n connection_status = 0\n end\n return connection_status\n end",
"def response(opt, enable, who)\n option(opt)\n\n case who\n when :him\n willdo = DO.chr\n wontdont = DONT.chr\n whoq = :himq\n when :us\n willdo = WILL.chr\n wontdont = WONT.chr\n whoq = :usq\n else\n # Error\n end\n\n case @state[opt].send(who)\n when :no\n if enable\n if desired?(opt)\n # If we agree\n @state[opt].send(\"#{who}=\", :yes)\n @pstack.conn.sendmsg(IAC.chr + willdo + opt.chr)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to enable option #{opt}\")\n else\n # If we disagree\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: disagreed to enable option #{opt}\")\n end\n else\n # Ignore\n end\n when :yes\n if enable\n # Ignore\n else\n @state[opt].send(\"#{who}=\", :no)\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n end\n when :wantno\n if enable\n case @state[opt].send(whoq)\n when :empty\n #Error DONT/WONT answered by WILL/DO\n @state[opt].send(\"#{who}=\", :no)\n when :opposite\n #Error DONT/WONT answered by WILL/DO\n @state[opt].send(\"#{who}=\", :yes)\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} DONT/WONT answered by WILL/DO\")\n else\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :no)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to disable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :wantyes)\n @state[opt].send(\"#{whoq}=\", :empty)\n @pstack.conn.sendmsg(IAC.chr + willdo + opt.chr)\n end\n end\n when :wantyes\n if enable\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :yes)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to enable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :wantno)\n @state[opt].send(\"#{whoq}=\", :empty)\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n end\n else\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :no)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to disable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :no)\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n end\n end\n end",
"def make_phone(num, code = 1, area = 10)\n puts \"calling #{num}, whit code #{code} - #{area}\"\nend",
"def treat_by_phone\n @conversation = @admin.mailbox.conversations.find(params[:id])\n @conversation.update_column :treated_by_phone, true\n @conversation.update_column :treated_at, Time.now\n @conversation.update_column :updated_at, Time.now\n @structure.delay.compute_response_rate\n respond_to do |format|\n format.html { redirect_to pro_structure_conversations_path(@structure), notice: \"La demande est considérée comme traitée\" }\n end\n end",
"def find_valid_calls(planeteer_calls)\n valid_calls = [\"Earth!\", \"Wind!\", \"Fire!\", \"Water!\", \"Heart!\"]\n planeteer_calls.each do |planeteer_call|\n valid_calls.find do |valid_call|\n if valid_call == planeteer_call\n return planeteer_call\n end\n end\n end\n return nil\nend",
"def lead_captured\n end",
"def response_generator number\n case number\n when 1\n \"It is certain\"\n when 2\n \"It is decidedly so\"\n when 3\n \"Without a doubt\"\n when 4\n \"Yes definitely\"\n when 5\n \"You may rely on it\"\n when 6\n \"As I see it yes\"\n when 7\n \"Most likely\"\n when 8\n \"Outlook good\"\n when 9\n \"Yes\"\n when 10\n \"Signs point to yes\"\n when 11\n \"Reply hazy try again\"\n when 12\n \"Ask again later\"\n when 13\n \"Better not tell you now\"\n when 14\n \"Cannot predict now\"\n when 15\n \"Concentrate and ask again\"\n when 16\n \"Don't count on it\"\n when 17\n \"My reply is no\"\n when 18\n \"My sources say no\"\n when 19\n \"Outlook not so good\"\n when 20\n \"Very doubtful\"\n end\nend",
"def reset_called_flag\n now = Date.today\n a_week_ago = now - 6\n call_days = CallDay.all\n call_days.each do |c|\n if ((c.called && c.called == 'YES') || (c.ordered && c.ordered == 'YES')) && ((c.date_called && c.date_called < a_week_ago) || (c.date_called && c.date_called < a_week_ago))\n c.called = 'NO'\n c.ordered = ' '\n c.callback = ' '\n c.alt_contact = ' '\n c.save\n end\n end\n end",
"def dialNumber\n\t\tprint countryCode\n\t\tprint cityCode\n\t\tprint phoneNumber\n\tend",
"def directorio(nombre, pais_c, numero)\n puts \" #{make_phone_call(numero,pais_c)}\n The phone number belongs to #{nombre}.\"\nend",
"def get_current_call callclass\n assert_call(callclass)\n \n self.calls.reverse.each do |call|\n if call.is_a?(callclass)\n return call\n elsif call.is_a?(Bid)\n break # Bids cancel all preceding calls.\n end\n end\n nil\n end",
"def update_calling\r\n # If player is not moving\r\n unless $game_player.moving?\r\n # Run calling of each screen\r\n if $game_temp.battle_calling\r\n call_battle\r\n elsif $game_temp.shop_calling\r\n call_shop\r\n elsif $game_temp.name_calling\r\n call_name\r\n elsif $game_temp.menu_calling\r\n call_menu\r\n\r\n elsif $game_temp.save_calling\r\n call_save\r\n elsif $game_temp.debug_calling\r\n call_debug\r\n end\r\n end\r\n end",
"def kannel_start_point\n sender_number = params[:sender]\n recipient_number = params[:receiver]\n time_sent = params[:time]\n time_sent ||= Time.now\n message = params[:message]\n \n #find or create phones\n sender_phone = Phone.find_by_number(sender_number)\n sender_phone ||= Phone.create!(:number => sender_number)\n \n recipient_phone = Phone.find_by_number(recipient_number)\n recipient_phone ||= Phone.create!(:number => recipient_number)\n \n unless sender_phone.user\n u = User.create!\n sender_phone.update_attributes(:user => u)\n end\n \n unless recipient_phone.user\n u = User.create!\n recipient_phone.update_attributes(:user => u)\n end\n \n message_object = Message.create!(:time => time_sent, :raw_message => message)\n \n MessageToPhoneConnection.create(:message_id => message_object.id, :phone_id => recipient_phone.id)\n MessageFromPhoneConnection.create(:message_id => message_object.id, :phone_id => sender_phone.id)\n \n message_object.process\n \n end",
"def call() end",
"def dial_user(from, agent, options = {})\n send_ping = options.delete(:send_ping)\n room = options.delete(:room)\n action = options.delete(:action) || 'queue'\n skip_ping_check = options.delete(:skip_ping_check)\n single_dir = options.delete(:single_dir)\n\n client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN\n\n unless from =~ /\\d/\n from = \"client:#{from}\"\n end\n\n if skip_ping_check || still_ringing?(from)\n # compose the url to send request to\n url = \"http://my-med-labs-call-center.herokuapp.com/#{action}\"\n url_params = \"?user_email=#{agent.email}&user_token=#{agent.authentication_token}\"\n url_params = \"#{url_params}&from=#{from}\" if from\n\n if room\n url_params = \"#{url_params}&room=#{room}\"\n if single_dir\n url_params = \"#{url_params}&conf_response=true\"\n end\n end\n\n puts \"new sending request - #{url}#{url_params}\".inspect\n\n # dial twilio agent\n client.account.calls.create(\n url: \"#{url}#{url_params}\",\n from: from,\n to: \"client:#{agent.slug}\"\n )\n\n # send notification to device if it's known\n if send_ping && agent.devices.first\n send_push_notification(from, agent, agent.devices.first, \"http://my-med-labs-call-center.herokuapp.com/connects#{url_params}\")\n end\n end\n end",
"def contact_method_output\n if contact_method == 0\n return 'email'\n else if contact_method ==1\n return 'phone'\n else\n if contact_method ==2\n return 'text'\n else\n return 'no preferred'\n end\n end\n end\n end",
"def test_unusual_call_setup\n cdr = Cdr.new('test')\n cse = make_cse(:event_time => 100, :from_tag => 't1', :event_type => 'R')\n assert_nil cdr.accept(cse) \n cse = make_cse(:event_time => 200, :from_tag => 't1', :event_type => 'F')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 300, :from_tag => 't1', :event_type => 'R')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 400, :from_tag => 't1', :to_tag => 't8', :event_type => 'F')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 500, :from_tag => 't1', :to_tag => 't2', :event_type => 'S')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1500, :from_tag => 't2', :to_tag => 't1', :event_type => 'S')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1600, :from_tag => 't1', :to_tag => 't2', :event_type => 'E')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1700, :from_tag => 't1', :to_tag => 't2', :event_type => 'E')\n assert_not_nil cdr.accept(cse)\n\n\n assert_equal( 100, cdr.start_time )\n assert_equal( 500, cdr.connect_time )\n assert_equal( 1700, cdr.end_time )\n \n end",
"def receive_browser_call\n campaign_id = params[:campaign_id].to_i\n Sharelink.add_clicker(campaign_id, session[:referrer_id], current_user) if session[:referrer_id]\n Call.create(:campaign_id => campaign_id, :user_id => params[:id], :twilio_id => params[:CallSid])\n outbound_call = Campaign.outbound_call_instructions(campaign_id)\n render :xml => outbound_call.text\n end",
"def mobile_enquiry(user_input_tokens)\n phone_enquiry(user_input_tokens)\n end",
"def is_user_proxied(meeting, id)\n user = ASF::Person.find(id)\n lines = IO.read(File.join(MEETINGS, meeting, 'proxies'))\n proxylist = lines.scan(/\\s\\s(.{25})(.*?)\\((.*?)\\)/) # [[\"Shane Curcuru \", \"David Fisher \", \"wave\"], ...]\n help = nil\n copypasta = [] # theiravailid | Their Name in Rolls (proxy)\n proxylist.each do |arr|\n if user.cn == arr[0].strip\n copypasta << \"#{arr[2].ljust(12)} | #{arr[1].strip} (proxy)\"\n elsif user.id == arr[2]\n help = \"NOTE: You have already submitted a proxy form for #{arr[0].strip} to mark your attendance (be sure they know to mark you at Roll Call)! \"\n end\n end\n if copypasta.empty?\n return help\n else\n (help ||= \"\") << \"Since you are a proxy for others, then AFTER the 2. Roll Call is called, you may copy/paste the below lines to mark your and your proxies attendance.\"\n copypasta.unshift(\"#{user.id.ljust(12)} | #{user.cn}\")\n return help, copypasta\n end\nend",
"def set_caller_survey\n # Get phone_number from the incoming GET request from Twilio\n @phone_number = Sanitize.clean(params[:From])\n\n # Get a survey\n @survey = Survey.last\n\n # Create new Survey Participant with phone_number\n @caller = SurveyParticipant.where(phone_number: @phone_number).first_or_create()\n end",
"def next_oncall_shift(user_id, api_token)\n url = \"https://api.pagerduty.com/oncalls?user_ids[]=#{user_id}&since=#{Time.now.utc.iso8601}&until=#{(Time.now + 86400 * 7).utc.iso8601}\"\n uri = URI.parse(url)\n\n request = Net::HTTP::Get.new(uri)\n request['Content-Type'] = 'application/json'\n request['Accept'] = 'application/vnd.pagerduty+json;version=2'\n request['Authorization'] = \"Token token=#{api_token}\"\n\n response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n http.request(request)\n end\n\n if response.code == '200'\n data = JSON.parse(response.body)\n oncalls = data['oncalls']\n\n next_oncall = oncalls.find { |oncall| !oncall['end'].nil? && Time.parse(oncall['end']) > Time.now }\n if !next_oncall.nil?\n start, finish = Time.parse(next_oncall['start']), Time.parse(next_oncall['end'])\n\n if start < Time.now\n return \"now (ends in #{((finish - Time.now) / 3600.0).round} hours)\"\n end\n\n diff = ((start - Time.now) / 3600.0).round\n\n return \"#{diff} hours\"\n else\n return \"not found\"\n end\n else\n raise StandardError.new(\"Error fetching on-call shifts: #{response.code} #{response.message}\")\n end\nend",
"def prefer_direct_call?\n true\n end",
"def make_call call, player = nil\n assert_call(call.class)\n # Calls must be distinct.\n raise InvalidCallError, \"#{call.inspect} is invalid\" unless self.valid_call?(call)\n\n self.calls << call\n if self.complete? and not self.passed_out?\n self.contract = Contract.new(self)\n end\n true\n end",
"def user_work_phone\n\tend",
"def get_message(patient_name: nil, doctor_name: nil)\n doctor_sms = nil\n doctor_push = nil\n patient_sms = nil\n patient_push = nil\n reason_code_static_name = reason_code.try(:static_name)\n case event.static_name\n when \"Cancelation - GPDQ Error\"\n case reason_code_static_name\n when \"GPDQ Platform Error\"\n doctor_sms = \"Dear Dr #{doctor_name}, We have cancelled your next appointment due to a technical error. Please email your GPDQ account manager for further information\"\n when \"Back office mistake\", \"Tech error\", \"Unspecified\"\n doctor_sms = \"Yes\"\n end\n when \"Patient Cancellation\"\n case reason_code_static_name\n when \"Patient Cancelled via app\"\n doctor_sms = \"Dear Dr #{doctor_name}, #{patient_name} has now cancelled booking ref #{appointment_id}. Cancellation credits may be applicable, please contact your account manager for further information\"\n patient_sms = \"Your cancellation was successful. A cancellation fee will be deducted from your account if the doctor has been despatched to your booking\"\n when \"Patient didn't answer door\"\n patient_sms = \"Dear #{patient_name}, your booking ref #{appointment_id} has been cancelled as the doctor was unable to locate you. As per our t&c's a cancellation fee is applicable\"\n when \"Due to delay\"\n doctor_sms = \"Dear Dr #{doctor_name}, we have now cancelled your next appt as the patient has informed us they are unable to wait any longer\"\n when \"Due to return\"\n doctor_sms = \"Dear Dr #{doctor_name}, your recent return resulted in cancellation by the patient. As per our terms and conditions a customer compensation credit is required.\"\n when \"Prior to doctor confirming on route\"\n doctor_sms = \"Dear Dr #{doctor_name}, we wanted to inform you that the booking in your dashboard has now been cancelled by the patient. Please do not proceed to the appointment\"\n when \"Serious medical issue with Patient\"\n doctor_sms = \"Dear Dr #{doctor_name}, your upcoming booking has been cancelled by the patient due to a serious medical emergency.\"\n end\n when \"Doctor Return\"\n case reason_code_static_name\n when \"60 mins before ETA\", \"30 mins before ETA\"\n patient_sms = \" dr #{doctor_name} has just informed us he/she will be unable to complete your appt due to an unexpected issue. GPDQ has found you a replacement doctor , track him/her here!\"\n when \"15 mins before ETA\"\n patient_sms = \" dr #{doctor_name} has just informed us he/she will be unable to complete your appt due to an unexpected issue. GPDQ has found you a replacement doctor who will arrive within 15 minutes , track him/her here!\"\n end\n when \"Doctor delayed\"\n case reason_code_static_name\n when \"Late >10 minutes\"\n patient_sms = \"Dr #{doctor_name} is running 10 minutes late, apologies for the inconvenience\"\n when \"Late >20 minutes\"\n patient_sms = \"Doctor #{doctor_name} is running late due to traffic and will be with you as soon as possible.\"\n when \"Late >40 minutes\"\n patient_sms = \"Unfotunately Dr #{doctor_name} has been delayed due to an extention with his previous patient & will be with you shortly. A member of our team will contact you to resolve this\"\n end\n when \"Other Customer Service Event\"\n patient_sms = \"Reactive\"\n patient_push = \"Reactive\"\n when \"Booking confirmed\"\n patient_sms = \"Yes\"\n when \"Dispached to doctor\"\n doctor_sms = \"Dear Dr #{doctor_name}, your next appointment is waiting for acceptance.\"\n doctor_push = \"You have a new appointment awaiting acceptance\"\n when \"Doctor not yet confirmed on way when due\"\n doctor_sms = \"Dear Dr #{doctor_name}, please accept your next booking or contact us if you are unable to fulfill this\"\n when \"Doctor confirmed on way\"\n patient_sms = \"Hi #{patient_name}, your booking ref #{appointment_id} is confirmed and doctor #{doctor_name} is on his way. Track him here <link>/track on link\"\n when \"Reminder to Doctor that appt ends in 5 minutes\"\n doctor_push = \"Dr #{doctor_name}, your appointment is coming to an end in 5 minutes. If you need an extension, please inform the patient\"\n when \"Appointment extension in 5 min increments (increment + 3 mins is regarded as the lower increment)\"\n case reason_code_static_name\n when \"5 minute extension\"\n patient_sms = \"Hi #{patient_name}, Your appointment has been extended and any applicable charges will be available to view on your receipt\"\n end\n when \"Additional Onsite Consultation\"\n case reason_code_static_name\n when \"New Patient\"\n patient_sms = \"You have requested an additional consultation with Dr #{doctor_name} which will be deducted from your chosen payment method\"\n end\n end\n message = { doctor_sms: doctor_sms, doctor_push: doctor_push, patient_sms: patient_sms, patient_push: patient_push }\n end",
"def verifyphonenumber\n tc = Twilio::REST::Client.new tsid, tauthtoken\n # Ref: https://www.twilio.com/docs/api/rest/outgoing-caller-ids\n call_delay_in_sec = 45 # Can be 0 to 60 seconds\n caller_id = tc.outgoing_caller_ids.create(:phone_number => params[:PhoneNumber], :call_delay => call_delay_in_sec)\n respond_to do |format|\n format.json { render :json => {:verification_code => caller_id.validation_code},\n :status => :ok }\n end\n end",
"def reset_pending_calls\n # get numbers associated with pharmacy\n my_numbers = self.get_my_numbers\n pending_index = PendingCall.map{|p| p.id if my_numbers.include? p.number_id}.compact\n prim_num = self.preferred_number_id\n PendingCall[pending_index].update(:attempts => 0, :number_id => prim_num,:error_message_sent => 0)\n end",
"def answered_by\r\n answer_response.answerer\r\n end",
"def phone_number\n \"(#{Helpers::FakeIt.area_code}) #{Helpers::FakeIt.exchange_code}-#{Helpers::FakeIt.subscriber_number}\"\n end",
"def light_the_way\n HisMastersVoice.instance.tell_me(self)\n end",
"def complete_and_asign_dialer!\n dialers = Dialer.reserved\n dialer = if dialers.any?\n dialers.sample\n else\n dialers.first!\n end\n update! status: User::Status::ACTIVE, dialer: dialer\n dialer.update! status: Dialer::Status::ACTIVE\n end"
] |
[
"0.606001",
"0.5950909",
"0.5833958",
"0.58130944",
"0.58086896",
"0.57730126",
"0.5753247",
"0.57427555",
"0.5719476",
"0.57183194",
"0.570734",
"0.56310666",
"0.56206834",
"0.5574328",
"0.5554822",
"0.552853",
"0.5523383",
"0.5460513",
"0.5447489",
"0.54103607",
"0.54090446",
"0.540023",
"0.5399541",
"0.5399541",
"0.5364366",
"0.5335077",
"0.53248066",
"0.53095293",
"0.53095293",
"0.5288093",
"0.52751005",
"0.52546453",
"0.5254567",
"0.5247512",
"0.524287",
"0.5238954",
"0.52356666",
"0.5231477",
"0.52296144",
"0.5217312",
"0.52172804",
"0.5208837",
"0.5206734",
"0.51980275",
"0.518871",
"0.5177133",
"0.517146",
"0.5148518",
"0.51464486",
"0.51438135",
"0.5118429",
"0.5112446",
"0.51081353",
"0.51045185",
"0.50994825",
"0.5097409",
"0.5097409",
"0.50952196",
"0.50848675",
"0.50828654",
"0.5073912",
"0.50693196",
"0.50661665",
"0.5054298",
"0.5050962",
"0.5047543",
"0.5044395",
"0.50373656",
"0.50269485",
"0.50246495",
"0.50216794",
"0.50143945",
"0.5009174",
"0.50091726",
"0.50039625",
"0.4989093",
"0.4979643",
"0.49755692",
"0.49735343",
"0.49682558",
"0.49680936",
"0.49655193",
"0.4951552",
"0.49514988",
"0.49475294",
"0.49377477",
"0.49358952",
"0.49233097",
"0.49218535",
"0.49130684",
"0.49058318",
"0.49006075",
"0.48933616",
"0.48819616",
"0.48816893",
"0.48814535",
"0.48799947",
"0.4879877",
"0.48718673",
"0.48714617"
] |
0.5035806
|
68
|
This action is called by Twilio when preparing to make outbound voice calls through the browser
|
def token
identity = Faker::Internet.user_name.gsub(/[^0-9a-z_]/i, '')
capability = Twilio::Util::Capability.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']
# The Twilio
capability.allow_client_outgoing ENV['TWILIO_TWIML_APP_SID']
capability.allow_client_incoming identity
token = capability.generate
render json: {identity: identity, token: token}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def receive_browser_call\n campaign_id = params[:campaign_id].to_i\n Sharelink.add_clicker(campaign_id, session[:referrer_id], current_user) if session[:referrer_id]\n Call.create(:campaign_id => campaign_id, :user_id => params[:id], :twilio_id => params[:CallSid])\n outbound_call = Campaign.outbound_call_instructions(campaign_id)\n render :xml => outbound_call.text\n end",
"def outboundcall\n # This FromPhoneNumber should have been verified in the associated sub-account\n render_twiml generateTwiml(params[:FromPhoneNumber], params[:ToPhoneNumber])\n end",
"def voice\n # Give Twilio the TwiML payload instructions\n twiml_payload\n end",
"def voice\n from_number = params['FromNumber'].blank? ? ENV['TWILIO_CALLER_ID'] : params['FromNumber']\n twiml = Twilio::TwiML::Response.new do |r|\n if params['To'] and params['To'] != ''\n r.Dial callerId: from_number do |d|\n # wrap the phone number or client name in the appropriate TwiML verb\n # by checking if the number given has only digits and format symbols\n if params['To'] =~ /^[\\d\\+\\-\\(\\) ]+$/\n d.Number params['To']\n else\n d.Client params['To']\n end\n end\n else\n r.Say \"Thanks for calling!\"\n end\n end\n\n render xml: twiml.text\n end",
"def index\n @calls = Call.all\n @account_sid = 'AC17355db7790d2916f0e059ec874d62aa' \n @auth_token = '626448ea4774753933df10fa70d779b4' \n \n # set up a client to talk to the Twilio REST API \n # @client = Twilio::REST::Client.new(@account_sid, @auth_token)\n \n # @call = @client.account.calls.create({ \n # :from => '+6421428583',\n # :to => '+644769123', \n # :method => 'GET', \n # :fallback_method => 'GET', \n # :status_callback_method => 'GET', \n # :record => 'false'\n # })\n\n # This application sid will play a Welcome Message.\n @demo_app_sid = 'APabe7650f654fc34655fc81ae71caa3ff'\n @capability = Twilio::Util::Capability.new( @account_sid, @auth_token)\n @capability.allow_client_outgoing @demo_app_sid\n @token = @capability.generate\n # @erb :index, :locals => {:token => @token} \n\n\n\n \n\n end",
"def makecall\n \n client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])\n @call = client.account.calls.create(\n :from => TWILIO_CONFIG['from'], # From your Twilio number\n :to => '+19493228496', # To any number\n # Fetch instructions from this URL when the call connects\n :url => 'http://snipit.herokuapp.com/voicein'\n )\n end",
"def outgoing\n from_phone = parse_sim_sid(params[:From])\n response = Twilio::TwiML::VoiceResponse.new\n response.dial(caller_id: from_phone) do |d|\n d.number params[:To]\n end\n\n render xml: response.to_xml\n end",
"def voice\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'Hey there. Congrats on integrating Twilio into your Rails 4 app.', :voice => 'alice'\n r.Play 'http://linode.rabasa.com/cantina.mp3'\n end\n \n render_twiml response\n end",
"def callback\n twilio_id = params[:CallSid]\n call = Call.where('twilio_id = ?', twilio_id).first\n call.get_recording_info(twilio_id, params[:CallDuration], params[:AnsweredBy])\n render :json => 'callback success'\n end",
"def twilio\n @number = params[:phone_number]\n \n #Text message info\n t = {\n \n 'From' => CALLER_ID,\n 'To' => @number,\n 'Body' => (\"Visit uhpartments.com when you walk through an apartment\")\n }\n\n begin\n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n resp = account.request(\"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/SMS/Messages\",\n 'POST',\n t)\n resp.error! unless resp.kind_of? Net::HTTPSuccess\n rescue StandardError => bang\n #This area will be called if an error happens with the Twilio API\n flash[:alert] = \"Bad number.\"\n redirect_to({ :action => :home })\n \n return\n end\n\n redirect_to({ :action => :home, :alert => \"SMS sent.\" })\n end",
"def transcribe\n @call = Call.find(params[:id])\n @call.update_attribute :transcription_text, params[:TranscriptionText] || @call.transcription_text\n @call.update_attribute :transcription_status, params[:TranscriptionStatus] || @call.transcription_status\n \n render \"calls/twiml/recording/#{@call.template}.xml.erb\"\n end",
"def initiate_conference\n @call = Call.find(params[:id])\n @call.participants.each do |participant|\n #TWILIO_CLIENT.account.calls.create({from: '+12065382886', to: \"+1#{participant.phone}\", url: \"http://dial-me-in.herokuapp.com/calls/#{@call.id}/handle_call\"})\n end\n\n redirect_to @call\n end",
"def reply # acts as endpoint\n \tmessage_body = params[\"Body\"] # grab params from Twilio's request\n \tfrom_number = params[\"From\"]\n \tboot_twilio\n \tsms = @client.messages.create( # send to inbound number made by end user\n from: Rails.application.secrets.twilio_from_number,\n to: from_number,\n body: \"Hello there, thanks for texting me. Your number is #{from_number}.\"\n \t)\n end",
"def consume\n consume_phone_number = params[:To]\n \n Rails.logger.info \"Current page is: #{params[:current_page]}\"\n \n # Check what was pressed.\n if params[:Digits].blank?\n # Show main menu\n response = VoiceExtension::MenuOption::build_menu_option\n else\n begin\n page = VoiceExtension::Page.where(name: params[:current_page]).first\n response = VoiceExtension::MenuOption::build_menu_option(params[:Digits].to_s, page)\n rescue\n Rails.logger.error \"Unable to generate menu: #{$!.message}\"\n Rails.logger.error $!.backtrace.join(\"\\n\")\n response = Twilio::TwiML::Response.new do |r|\n r.Say VoiceExtension::MenuOption::GENERIC_ERROR_MESSAGE_TO_VOICE, :voice => 'woman'\n end\n end\n end\n \n begin\n render :text => response.text\n rescue\n Rails.logger.error $!.message\n end\n end",
"def speak\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'hello there', :voice => 'woman'\n end\n @xml=response.text\nend",
"def fallback_to_twilio\n sms.output = :twilio\n sms.deliver\n end",
"def call\n tg = TicketGroup.find(params[:ticket_group_id])\n event_name = 'testing name'\n row = 'test row'\n section = 'test section'\n if tg\n event = tg.custom_event\n event_name = event.name\n section = tg.section\n row = tg.row\n end\n if session[:buyer]\n buyer = Buyer.find(session[:buyer])\n hit_tropo_end_point({\n 'name' => buyer.first_name,\n 'event_name' => event_name,\n #'section' => section,\n #'row' => row,\n 'action' => 'voice',\n 'call_type' => AppSettings::CALL_TYPE[:voice]\n })\n flash[:message] = \"successfully called!\"\n else\n respond_to do |format|\n flash[:error] = \"sign up or sign in as a buyer first!\"\n format.html { redirect_to(\"/buyers/new\")}\n end\n end\n end",
"def re_record_prompt\n active_recording = active_call.recordings.create!(duration: params['RecordingDuration'], recording_url: params['RecordingUrl'])\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'Thank you.'\n play_audio(r, 'recording_play_back')\n play_audio(r, 'recording_recrcord_instructions')\n r.Gather(\n action: ivr_recordings_new_recording_url,\n method: 'get',\n 'numDigits' => 1,\n 'finishOnKey' => ''\n ) do |gather|\n r.Play(active_recording.recording_url)\n play_audio(r, 'recording_play_back')\n play_audio(r, 'recording_recrcord_instructions')\n end\n play_audio(r, 'goodbye')\n r.Hangup\n end\n\n render_twiml response\n end",
"def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, if_machine: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, url: :unset, application_sid: :unset)\n data = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'Url' => url,\n 'ApplicationSid' => application_sid,\n 'Method' => method,\n 'FallbackUrl' => fallback_url,\n 'FallbackMethod' => fallback_method,\n 'StatusCallback' => status_callback,\n 'StatusCallbackEvent' => status_callback_event,\n 'StatusCallbackMethod' => status_callback_method,\n 'SendDigits' => send_digits,\n 'IfMachine' => if_machine,\n 'Timeout' => timeout,\n 'Record' => record,\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SipAuthUsername' => sip_auth_username,\n 'SipAuthPassword' => sip_auth_password,\n 'MachineDetection' => machine_detection,\n 'MachineDetectionTimeout' => machine_detection_timeout,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end",
"def start\n find_or_create_active_call\n response = Twilio::TwiML::Response.new do |r|\n r.Pause\n ready_for_connection?(r)\n r.Say('Please try again later.')\n play_audio(r, 'goodbye')\n end\n\n render_twiml response\n end",
"def answer\n return render nothing: true unless params[:Event] == 'StartApp'\n\n @from = params[:From]\n company_number = CompanyNumber.find_by_sip_endpoint params[:To]\n Call.create! from: @from, call_uuid: params[:CallUUID], company_number: company_number\n @user_numbers = company_number.users.joins(:user_numbers).select('user_numbers.sip_endpoint')\n end",
"def voice\n reminder = Reminder.find(params[:id])\n \tresponse = Twilio::TwiML::Response.new do |r|\n r.Say 'This is a reminder message from the Remmyo service.',:voice => 'alice'\n \t r.Say reminder.message, :voice => 'alice'\n r.Say 'End of message.',:voice => 'man'\n # r.Play 'http://linode.rabasa.com/cantina.mp3'\n \tend\n\n \trender_twiml response\n end",
"def learn_ruby\n # user = User.find_by(:token => 'Coi1Y73r3-ZWg7qfV8YItw')\n # user.destroy\n account_sid = ENV['TWILIO_ACCOUNT_SID']\n auth_token = ENV['TWILIO_AUTH_TOKEN']\n @client = Twilio::REST::Client.new account_sid, auth_token\n @client.account.calls.create(\n :url => \"http://demo.twilio.com/docs/voice.xml\",\n :to => \"+841269162753\",\n :from => \"+14157809231\")\n # log = user.logs.create(caller: \"samngu\")\n render json: {:ok => true}\n end",
"def receive_inbound_call\n campaign_id = params[:campaign_id]\n outbound_call = Campaign.outbound_call_instructions(campaign_id)\n render :xml => outbound_call.text\n end",
"def send_joke\r\n client = Twilio::REST::Client.new Rails.application.secrets.twilio_account_sid, Rails.application.secrets.twilio_auth_token\r\n message = client.messages.create from: '347-933-6917', to: params[:phone_number], body: Joke.pick_joke\r\n redirect_to :back\r\n end",
"def request_for_twiml!(path, options = {})\n @current_path = normalize_redirect_path(path)\n\n # Post the query\n rack_test_session_wrapper = Capybara.current_session.driver\n @response = rack_test_session_wrapper.send(options[:method] || :post, @current_path,\n :format => :xml,\n :CallSid => @root_call.sid,\n :From => @root_call.from_number,\n :Digits => formatted_digits(options[:digits].to_s, :finish_on_key => options[:finish_on_key]),\n :To => @root_call.to_number,\n :AnsweredBy => (options[:is_machine] ? \"machine\" : \"human\"),\n :CallStatus => options.fetch(:call_status, \"in-progress\")\n )\n\n # All Twilio responses must be a success.\n raise \"Bad response: #{@response.status}\" unless @response.status == 200\n\n # Load the xml\n data = @response.body\n @response_xml = Nokogiri::XML.parse(data)\n set_xml(@response_xml.at_xpath(\"Response\"))\n end",
"def speak\n speak_what = params[:text_to_speak]\n logger.debug \"speak_what=#{speak_what}\"\n if !speak_what.present? then return end\n speak_what_encoded = ERB::Util.url_encode(speak_what)\n logger.debug \"speak_what_encoded=#{speak_what_encoded}\"\n uri = \"#{HOST}:#{PORT}/sayall/#{speak_what_encoded}\"\n begin\n logger.debug \"uri=#{uri}\"\n response = open(uri).read \n rescue ActionController::UnknownFormat => e\n if e.include? '204'\n # do nothing\n else\n logger.debug \"Exception in text_to_speech_controller: #{e.to_s}\"\n raise e\n end\n rescue Exception => e\n logger.debug \"Exception in text_to_speech_controller: #{e.to_s}\"\n raise e \n end\n redirect_to :controller => 'presets', :action => 'display'\n end",
"def actions()\n\t(\n\t\tcall_src_sip_username = _arg( 'Caller-Username' )\n\t\tcall_src_cid_userinfo = _arg( 'Caller-Caller-ID-Number' )\n\t\tcall_src_cid_displayname = _arg( 'Caller-Caller-ID-Name' )\n\t\tcall_dst_sip_userinfo = _arg( 'Caller-Destination-Number' )\n\t\tcall_dst_sip_domain = _arg( 'var_sip_to_host' )\n\t\t\n\t\t# Strip \"-kambridge-\" prefix added in kamailio.cfg:\n\t\tcall_dst_sip_userinfo = call_dst_sip_userinfo.gsub( /^-kambridge-/, '' )\n\t\t\n\t\tlogger.info(_bold( \"[FS] Call-proc. request, acct. #{call_src_sip_username.inspect} as #{call_src_cid_userinfo.inspect} (#{call_src_cid_displayname.inspect}) -> #{call_dst_sip_userinfo.inspect} ...\" ))\n\t\t_args.each { |k,v|\n\t\t\tcase v\n\t\t\t\twhen String\n\t\t\t\t\t#logger.debug( \" #{k.ljust(36)} = #{v.inspect}\" )\n\t\t\t\t#when Hash\n\t\t\t\t#\tv.each { |k1,v1|\n\t\t\t\t#\t\tlogger.debug( \" #{k}[ #{k1.ljust(30)} ] = #{v1.inspect}\" )\n\t\t\t\t#\t}\n\t\t\tend\n\t\t}\n\t\t\n\t\t# For FreeSwitch dialplan applications see\n\t\t# http://wiki.freeswitch.org/wiki/Mod_dptools\n\t\t# http://wiki.freeswitch.org/wiki/Category:Dptools\n\t\t\n\t\t# Note: If you want to do multiple iterations (requests) you\n\t\t# have to set channel variables to keep track of \"where you\n\t\t# are\" i.e. what you have done already.\n\t\t# And you have to explicitly send \"_continue\" as the last\n\t\t# application.\n\t\t\t\t\n\t\tif call_dst_sip_userinfo.blank?\n\t\t\tcase _arg( 'Answer-State' )\n\t\t\t\twhen 'ringing'\n\t\t\t\t\taction :respond , '404 Not Found' # or '400 Bad Request'? or '484 Address Incomplete'?\n\t\t\t\telse\n\t\t\t\t\taction :hangup , ''\n\t\t\tend\n\t\telse\n\t\t\t\n\t\t\tcall_dst_real_sip_username = call_dst_sip_userinfo # un-alias\n\t\t\t# (Alias lookup has already been done in kamailio.cfg.)\n\t\t\t\n\t\t\t# Here's an example: {\n\t\t\t#action :set , 'effective_caller_id_number=1234567'\n\t\t\t#action :bridge , \"sofia/internal/#{call_dst_real_sip_username}\"\n\t\t\t#action :answer\n\t\t\t#action :sleep , 1000\n\t\t\t#action :playback , 'tone_stream://%(500, 0, 640)'\n\t\t\t#action :set , 'voicemail_authorized=${sip_authorized}'\n\t\t\t#action :voicemail , \"default $${domain} #{call_dst_real_sip_username}\"\n\t\t\t#action :hangup\n\t\t\t#action :_continue\n\t\t\t# end of example }\n\t\t\t\n\t\t\t\n\t\t\t# http://kb.asipto.com/freeswitch:kamailio-3.1.x-freeswitch-1.0.6d-sbc#dialplan\n\t\t\t\n\t\t\t#OPTIMIZE Implement call-forwardings here ...\n\t\t\t\n\t\t\t# Ring the SIP user via Kamailio for 30 seconds:\n\t\t\taction_log( FS_LOG_INFO, \"Calling #{call_dst_real_sip_username} ...\" )\n\t\t\taction :set , \"call_timeout=5\"\n\t\t\taction :export , \"sip_contact_user=ufs\"\n\t\t\taction :bridge , \"sofia/internal/#{call_dst_real_sip_username}@127.0.0.1\"\n\t\t\t\n\t\t\t#OPTIMIZE Implement call-forward on busy/unavailable here ...\n\t\t\t\n\t\t\t# Go to voicemail:\n\t\t\taction_log( FS_LOG_INFO, \"Going to voicemail ...\" )\n\t\t\taction :answer\n\t\t\taction :voicemail , \"default #{call_dst_sip_domain} #{call_dst_real_sip_username}\"\n\t\t\taction :hangup\n\t\t\t\n\t\t\t\n\t\tend\n\t\t\n\t\t\n\t\trespond_to { |format|\n\t\t\tformat.xml {\n\t\t\t\trender :actions, :layout => false\n\t\t\t}\n\t\t\tformat.all {\n\t\t\t\trender :status => '406 Not Acceptable',\n\t\t\t\t\t:layout => false, :content_type => 'text/plain',\n\t\t\t\t\t:text => \"<!-- Only XML format is supported. -->\"\n\t\t\t}\n\t\t}\n\t\treturn\n\t)end",
"def speech_recognized(object, connection, phrase)\n\t\tif @state == :DEFAULT_STATE \n\t\t\tif phrase.match(/^next/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRINextPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n \n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to next page.\")\n\t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\telsif phrase.match(/^back/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRIPreviousPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to previous page.\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\t elsif phrase.match(/^search for (.+)/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRISearch\"+$1) # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n # return self.generate_search_response(connection.lastRefId, $1);\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok, which one do you want?\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n \t\t\t elsif phrase.match(/^the first/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex0\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the second/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex1\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the third/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex2\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fourth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex3\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fifth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex4\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t\tend\n\t\t\t\n\t\telsif @state == :CONFIRM_STATE\n\t\t\tif phrase.match(/yes/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @twitterClient.update(@tweetText) # this should probably be done in a seperate thread\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok it has been posted to Twitter.\")\n\t\t\tend\n\t\t\tif phrase.match(/no/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok I won't send it.\")\n\t\t\tend\n\n\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Do you want me to send it?\", \"I'm sorry. I don't understand. Do you want me to send it? Say yes or no.\", true)\n\t\tend\n\n\t\tobject\n\tend",
"def new; send_sms; end",
"def menu\n account = Account.where(:consume_phone_number => params[:To]).first\n menu_option = account.menu_options.where(:name => params[:object_name].downcase.strip).first\n response = menu_option.build_voice_response(params[:Digits])\n \n render :text => response.text\n end",
"def build_twilio_wrapper\n @twilio_wrapper = ::VoiceExtension::TwilioVoiceWrapper::Voice.new\n end",
"def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tdocument.body.innerHTML = \"<iframe src=tel:#{datastore['phoneNumber']}></iframe>\";\n\t\t\tXSSF_POST(\"Phone call launched\",'#{self.name}');\n\t\t}\n\t\t\n\t\tsend_response(cli, code)\n\tend",
"def reminderCall\n @twilio_number = ENV['TWILIO_NUMBER']\n @client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n call = @client.account.calls.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :url => 'https://clockairos.herokuapp.com/twilio/call',\n :method => 'POST',\n :fallback_method => 'GET',\n :status_callback_method => 'GET',\n :if_machine => 'Hangup',\n :timeout => '30',\n :record => 'false'\n )\n puts call.to\n end",
"def send_to_phone\n if params[:level_source] && params[:phone] && (level_source = LevelSource.find(params[:level_source]))\n send_sms(level_source, params[:phone])\n render status: :ok, nothing: true\n else\n render status: :not_acceptable, nothing: true\n end\n end",
"def start\n response = Authy::PhoneVerification.start(\n via: 'sms',\n country_code: 1,\n phone_number: params[:phone]\n )\n render json: response\n end",
"def create(from: nil, to: nil, reason: :unset, application_sid: :unset, caller_id: :unset, fallback_method: :unset, fallback_url: :unset, machine_detection: :unset, machine_detection_silence_timeout: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_speech_threshold: :unset, machine_detection_timeout: :unset, method: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_event: :unset, recording_status_callback_method: :unset, send_digits: :unset, sip_auth_password: :unset, sip_auth_username: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, timeout: :unset, trim: :unset, url: :unset)\n data = Twilio::Values.of({\n 'From' => from,\n 'To' => to,\n 'Reason' => reason,\n 'ApplicationSid' => application_sid,\n 'CallerId' => caller_id,\n 'FallbackMethod' => fallback_method,\n 'FallbackUrl' => fallback_url,\n 'MachineDetection' => machine_detection,\n 'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,\n 'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,\n 'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,\n 'MachineDetectionTimeout' => machine_detection_timeout,\n 'Method' => method,\n 'Record' => record,\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SendDigits' => send_digits,\n 'SipAuthPassword' => sip_auth_password,\n 'SipAuthUsername' => sip_auth_username,\n 'StatusCallback' => status_callback,\n 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },\n 'StatusCallbackMethod' => status_callback_method,\n 'Timeout' => timeout,\n 'Trim' => trim,\n 'Url' => url,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n PhoneCallInstance.new(@version, payload, )\n end",
"def send_request(conference_id, phone_number, db_call_id)\n #for rest_params, just care about those 3 passed params, forget about others for now.\n rest_params = {\n \"method\" => Constants::SINCH_CALL_METHOD,\n \"conferenceCallout\" =>\n {\n \"destination\" => {\"type\" => \"number\", \"endpoint\" => phone_number},\n \"domain\" => \"pstn\",\n \"custom\" => db_call_id,\n \"locale\" => \"en-US\",\n \"greeting\" => \"Welcome to my conference\",\n \"conferenceId\" => conference_id,\n \"enableAce\" => false,\n \"enableDice\" => true\n }\n }\n res = RestClient.post Constants::SINCH_API_URL, JSON.generate(rest_params), {content_type: :json, :Authorization => 'Basic MjNjYWVjNGUtNDY3YS00ODZhLTkyZjAtNDNjMDhiMDZhZDU2Om52eENGZ0xjZ2t1cWtIeEZxd1hKRWc9PQ=='}\n #TODO will remove this when we launch\n puts \"=======#{res.body}\"\n puts \"=======#{res.code}\"\n res.body\n end",
"def create\n @call = Call.new(params[:call])\n \n respond_to do |format|\n if @call.save\n \n result = OutgoingCallerId.find(:last)\n twcall = @twilio_client.account.calls.create(\n from: result.phone_number,\n to: @call.to, \n url: \"#{url_for(@call)}/twiml.xml\")\n \n @call.update_attribute :sid, twcall.sid\n format.html { redirect_to @call, notice: \"Call was successfully created.#{url_for(@call)}\" }\n format.json { render json: @call, status: :created, location: @call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end",
"def number(twilio=false, name=nil, area_code=nil)\n if twilio\n # Check if twilio configuration exists. If not throw and errors because twilio was passed as true.\n if !@config[:configuration][:twilio].blank? and (!@config[:configuration][:twilio][:account_id].blank? and !@config[:configuration][:twilio][:api_key].blank?)\n account = @config[:configuration][:twilio][:account_id]\n key = @config[:configuration][:twilio][:api_key]\n\n # Initialize twilio client.\n twilio = Twilio::REST::Client.new account, key\n\n # If any area code is provide look for local numbers, if not get a toll free.\n if area_code.blank?\n available_numbers = twilio.account.available_phone_numbers.get('US').toll_free.list\n else\n available_numbers = twilio.account.available_phone_numbers.get('US').local.list(area_code: area_code) unless area_code.blank?\n end\n\n # Select the first number available.\n available_number = available_numbers.first\n\n # If available numbers is blank throw an error because something went wrong.\n if available_numbers.blank?\n raise StandardError, \"No Available Numbers\"\n else\n\n # Convert the phone number into something a artificial voice can say.\n phone_number = available_number.phone_number.gsub(\"+1\",\"\")\n phone_number = \"#{phone_number[0..2]}-#{phone_number[3..5]}-#{phone_number[6..10]}\"\n\n\n # Setting the transciption email\n # email = @config[:configuration][:twilio][:transcription_email].blank? ? \"developers%40level.agency\" : @config[:configuration][:twilio][:transcription_email]\n email = \"developers%40level.agency\"\n # Put together the voicemail Twimil.\n voice_message = \"http://twimlets.com/voicemail?Email=#{email}&Message=You%20reached%20the%20voicemail%20box%20of%20#{phone_number}.%20%20Please%20leave%20a%20message%20after%20the%20beep.&Transcribe=true&\"\n\n # Here we buy the number, set the voice_url to the voicemail Twimil and set the\n # sms_url to echo so Twilio will capture the message but not reply to it.\n number = twilio.account.incoming_phone_numbers.create({\n phone_number: available_number.phone_number,\n friendly_name: name,\n voice_url: voice_message,\n voice_method: \"GET\",\n sms_url: \"http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E\",\n sms_method: \"GET\"\n })\n\n # If number is blank throw and error because something went wrong.\n if number.blank?\n raise StandardError, \"Unable to allocate Twilio number\"\n else\n number.phone_number\n end\n end\n else\n raise ArgumentError, \"Cannot find Twilio Account ID and API key in configuration\"\n end\n else\n Faker::PhoneNumber.phone_number\n end\n end",
"def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call),\n status_callback: member_call_event_url(call),\n status_callback_method: 'POST',\n status_callback_event: %w[initiated ringing answered completed]\n }\n client.calls.create params\n rescue Twilio::REST::RestError => e\n # 13223: Dial: Invalid phone number format\n # 13224: Dial: Invalid phone number\n # 13225: Dial: Forbidden phone number\n # 13226: Dial: Invalid country code\n # 21211: Invalid 'To' Phone Number\n # 21214: 'To' phone number cannot be reached\n call.action.destroy!\n call.update!(twilio_error_code: e.code, status: 'failed', action_id: nil)\n if (e.code >= 13_223 && e.code <= 13_226) || [21_211, 21_214].include?(e.code)\n add_error(:member_phone_number, I18n.t('call_tool.errors.phone_number.cant_connect'))\n else\n Rails.logger.error(\"Twilio Error: API responded with code #{e.code} for #{call.attributes.inspect}\")\n add_error(:base, I18n.t('call_tool.errors.unknown'))\n end\n end",
"def send_voice(voice_messages)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'voice_messages' => voice_messages\r\n )\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: voice_messages.to_json\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def call_to\n @number = params[:number]\n user_id = session[:user_id]\n user = User.find(user_id)\n\n @error = \"\"\n device = user.primary_device\n\n if device\n # originate callback\n src = device.extension\n dst = @number\n #var2 = \"__MOR_CALLC_ACTION_ID=#{action.id.to_s}\"\n\n server = Confline.get_value(\"Web_Callback_Server\").to_i\n server = 1 if server == 0\n\n channel = \"Local/#{src}@mor_cb_src/n\"\n st = originate_call(device.id, src, channel, \"mor_cb_dst\", dst, device.callerid_number, nil, server)\n @error = _('Cannot_connect_to_asterisk_server') if st.to_i != 0\n else\n @error = _('No_device')\n end\n\n render(:layout => false)\n end",
"def triage_select\n case params['Digits']\n when '*'\n @phone_call.miss! 'after_hours'\n render action: :goodbye, formats: [:xml]\n return\n when '1'\n @phone_call.transfer! Member.robot\n @phone_call.miss! 'after_hours'\n @nurseline_phone_call = @phone_call.transferred_to_phone_call\n render action: :transfer_nurse, formats: [:xml]\n return\n end\n\n redirect_to action: :triage_menu, id: @phone_call.id\n end",
"def send_survey\n Message.send_survey_to(self)\n end",
"def make_call(to, path, call_back_path)\n from = '+18015131966'\n req_params = {\n from: from,\n to: to,\n url: \"#{ENV['CALL_SERVICE_URL']}#{path}\",\n if_machine: \"Hangup\",\n status_callback: \"#{ENV['CALL_SERVICE_URL']}#{call_back_path}\",\n timeout: 10\n\n }\n\n if Rails.env == \"development\"\n url = \"http://127.0.0.1:4567/make_call\"\n RestClient.post url, req_params\n else\n client = Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_TOKEN\"])\n account = client.account\n call = account.calls.create(req_params)\n end\n end",
"def request!\n self.type = :subscribe\n reply_if_needed!\n end",
"def make_call(call_count, to_number, from_number)\n call_count.times do \n Adhearsion::OutboundCall.originate(\"SIP/#{to_number}@SIPSERVICEHERE\", :from => \"#{from_number}\", :controller => FooController)\n end\n end",
"def get_token\n campaign_id = Campaign.find(params[:id]).id \n call = Call.new\n call.campaign_id = campaign_id\n call.target_name = call.campaign.target_name\n call.twilio_token\n render :json => call\n end",
"def create\n @subscriber = Subscriber.find_or_create_by_phonenumber(params[:subscriber][:phonenumber])\n @client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n @subscriber.phonenumber = params[:subscriber][:phonenumber]\n @subscriber.phonenumber = @subscriber.phonenumber.gsub(/\\D/, \"\") \n @address = params[:address] + ', ' + params[:city] + ', ' + params[:state] + ' ' + params[:zip]\n if (params[:address] != '')\n coords = Geocoder.coordinates(@address)\n latitude = coords[0]\n longitude = coords[1]\n else\n latitude = params[:subscriber][:latitude]\n longitude = params[:subscriber][:latitude]\n end\n @subscriber.latitude = latitude\n @subscriber.longitude = longitude\n @subscriber.zone = Timezone::Zone.new(:latlon => [latitude, longitude]).rules.last[\"name\"]\n @subscriber.iss_event = params[:subscriber][:iss_event]\n @subscriber.iridium_event = params[:subscriber][:iridium_event]\n\n respond_to do |format|\n if @subscriber.save\n\n @client.account.sms.messages.create(\n :from => ENV['TWILIO_FROM_NUMBER'],\n :to => @subscriber.phonenumber,\n :body => 'Welcome to the Predict the Sky notification service, your time zone is ' + @subscriber.zone + '! Txt STOP to unsubscribe.'\n )\n format.html { redirect_to :root, notice: 'Subscriber was successfully created.' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"def provider_gather\n\n\t\tcontact = TwilioContact.where(id: params[:id]).first\n\n\t\t# determine if the provider wants to talk to client\n\t\tif params[:Digits] == '1'\n\t\t\tcontact.delay.make_callback(\"paused\")\n\t\t\tcontact.accepted = true\n\t\t\tcontact.save\n\t\t\t@number = contact.call_job.phone\n\t\telse\n\t\t\trender 'end_call'\n\t\tend\n\n\t\t# save request to history\n\t\tparams[:Action] = \"Provider_Gather\"\n\t\tTwilioHistory.create(history_params);\n\n\t\trespond_to :xml\n\tend",
"def sms\n \t\n \t#flash[:notice] = params\n \t#redirect_to root_path\n\n TwilioTextMessenger.new( params[:phone], params[:message]).call\n \t\n end",
"def sms\n # Give Twilio the TwiML payload instructions\n twiml_payload\n end",
"def create\n @voice = Voice.new(voice_params)\n output_filepath = download_voice(params[:voice][:url])\n File.open(\"#{Rails.root}/#{output_filepath}\") do |f|\n @voice.voice_file = f\n end\n o, e, s = Open3.capture3(\"wget -nv --delete-after '#{@voice.url}'\")\n e.chomp =~ /.*URL:(.*) \\[.*\\] -> /\n @voice.url = Regexp.last_match(1)\n return render :edit if @voice.invalid?\n @voice.save!\n\n system(\"rm #{output_filepath}\")\n\n flash[:success] = 'Voice was successfully created.'\n redirect_to voices_path\n end",
"def recording\n @call = Call.find(params[:id])\n @call.update_attribute :recording_url, params[:RecordingUrl] || @call.recording_url\n @call.update_attribute :recording_duration, params[:RecordingDuration] || @call.recording_duration\n \n render \"calls/twiml/recording/#{@call.template}.xml.erb\"\n end",
"def calling_speak\n speak\n end",
"def create\n account_sid = 'AC14aa346613c89fec467663aad46c05a2'\n auth_token = '0e43d0a04e110f7faa2692e388b0c7f5'\n \n client = Twilio::REST::Client.new(account_sid, auth_token)\n\n @city = params[:FromCity].capitalize\n @state = params[:FromState]\n\n render 'process_sms.xml.erb', :content_type => 'text/xml'\n end",
"def send_to_phone\n if params[:level_source] && params[:phone] && (level_source = LevelSource.find(params[:level_source]))\n send_sms(level_source_url(level_source), params[:phone])\n elsif params[:channel_id] && params[:phone] && ProjectsController::STANDALONE_PROJECTS.include?(params[:type])\n url =\n if params[:type] == 'weblab'\n \"https://codeprojects.org/#{params[:channel_id]}\"\n else\n polymorphic_url([\"#{params[:type]}_project_share\", 'projects'], channel_id: params[:channel_id])\n end\n send_sms(url, params[:phone])\n else\n head :not_acceptable\n end\n end",
"def connection_gather\n active_connection = Ivr::Connection.find(params[:connection_id])\n active_connection.update(status_from_user: Ivr::Connection::USER_RESPONSE_CODES[params['Digits']])\n response = Twilio::TwiML::Response.new do |r|\n if active_call.finished_loop? || active_call.next_target.nil?\n close_call(r)\n else\n r.Play AudioFileFetcher.encouraging_audio_for_count(active_call.encouraging_count)\n ready_for_connection?(r)\n close_call(r)\n end\n end\n\n render_twiml response\n end",
"def incoming\n from = params[\"From\"]\n\n if Number.find_by(number: from).blank?\n Number.create(number:from)\n end\n\n number = Number.find_by(number: from)\n\n if number.user.blank? && number.skip_sign_up == false\n boot_twilio\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from,\n body: \"If you would like to register your name so we can give you credit for your pictures, send a text with 'Register' followed by your name :)\"\n )\n\n number.update(skip_sign_up: true)\n end\n body = params[\"Body\"]\n split = body.split(\" \")\n\n if split[0]&.downcase == 'register'\n if number.user.blank?\n User.create(\n name: split.drop(1).join(\" \"),\n number: number\n )\n\n boot_twilio\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from,\n body: \"Successfully registered #{from} to #{number.user.name}\"\n )\n elsif number.user.present?\n boot_twilio\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from,\n body: \"#{from} is already registered to #{number.user.name}. Text William @ 4046801732 if this isn't right.\"\n )\n end\n elsif params[\"MediaUrl0\"].present?\n Pic.create(\n number: number,\n description: params[\"Body\"],\n path: params[\"MediaUrl0\"]\n )\n reply_body = \"Thanks for for sending the pics of the party!\"\n if number.user.present?\n reply_body = \"#{number.user.name}, Thanks for sending pics!\"\n end\n\n from_number = params[\"From\"]\n boot_twilio\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from_number,\n body: reply_body\n )\n end\n end",
"def twilio_sms\n sms = {\n :sid => params[:SmsSid], \n :from => params[:From],\n :to => params[:To],\n :body => params[:Body],\n #:status => params[:SmsStatus], # this will be used later for confirmation with Twilio \n }\n @txt = Txt.new(sms) \n \n @status_report = TWILIO_CONFIG[\"base_url\"].to_s + '/home/twilio_status'\n\n #@txt.twilio_reply_sms\n\n respond_to do |format|\n if @txt.save and @txt.match_coupon?(sms)\n flash[:notice] = 'Message was successfully received.' \n format.xml { @txt }\n else\n flash[:notice] = 'Delivery failed.' \n format.xml { @txt }\n end\n end\n\n end",
"def relay_response\n sim_response = AuthorizeNet::SIM::Response.new(params)\n if sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])\n render :text => sim_response.direct_post_reply(\n url_for(:controller => self.controller_name, :action => 'receipt', :only_path => false, \n :gateway => OPTIONS[:gateways][:authorize_net]), \n :include => true)\n else\n # return back to purchase page - will display error message there\n render :text => sim_response.direct_post_reply(\n url_for(:controller => self.controller_name, :action => 'purchase', :only_path => false, \n :order_id => params[:x_invoice_num], :failure => true), \n :include => true)\n end\n end",
"def reply\n body_arr = params[:Body].split(' ')\n method = body_arr[0]\n if method.upcase == 'REGISTER'\n p \"Registering User #{body_arr[1]} from #{params[:From]}\"\n User.register(params[:From], body_arr[1])\n send_sms(params[:From], \"User registered. Hello #{body_arr[1]}!\")\n Thread.new(params[:From], &method(:send_question))\n head 201 && return # Response is given to Twilio server for possible future use. \n elsif User.get(params[:From], 'name').nil?\n p 'User does not exist!'\n\n send_sms(params[:From], \"Please register with the form 'REGISTER <name>'.\")\n head 404 && return\n else \n # process answer\n answer = method\n p \"Processing answer #{answer}\"\n #TODO-v1: critical section to prevent user from keeping hitting the endpoint \n if answer == Question.get(User.get(params[:From], 'curr_ques_id'), 'answer')\n prev_count = User.get(params[:From], 'count')\n User.update(params[:From], 'count', prev_count.to_i + 1)\n if User.get(params[:From], 'count') == '5' #TODO: dynamic number\n send_sms(params[:From], 'Congratulations, you hit 5 question! Reward is sent. Answered question is cleared to 0')\n User.update(params[:From], 'count', 0) \n else\n send_sms(params[:From], \"Answer recorded.\\nYou have answered #{User.get(params[:From], 'count')} questions correctly.\")\n end\n else \n send_sms(params[:From], \"Wrong answer.\\nDon't be upset. You still have answered #{User.get(params[:From], 'count')} questions correctly.\")\n end\n User.update(params[:From], 'curr_ques_id', '-1') # So that user cannot answer the same question again and again! Fixed the repeat msg problem \n Thread.new(params[:From], &method(:send_question))\n head 204 && return\n end\n end",
"def incoming_verification\n # API Check\n raise 'You shall not pass!' unless params[:api_key] == Settings.twilio.webhooks_api_key\n\n # Handle verification\n user = get_user_for_phone_verification\n user.mark_phone_as_verified! if user\n\n render nothing: true\n end",
"def set_twilio_params\n\t @incoming_phone = params[:From]\n\t @message = params[:Body]\n\t anonymous_phone_number = params[:To]\n\n\t @interview = Interview.where(phone_number: anonymous_phone_number).first\n\t end",
"def request_voice(nick)\n #TODO: fiber blocks on getting the registration form\n # user fills-in the form and submit\n # rooms returns result\n raise NotImplementedError\n end",
"def exportTwilio\n # send messages to all people\n message1 = params.delete(:message1)\n message2 = params.delete(:message2)\n message1 = to_gsm0338(message1)\n message2 = to_gsm0338(message2) if message2.present?\n messages = Array[message1, message2]\n smsCampaign = params.delete(:twiliowufoo_campaign)\n @q = Person.ransack(params[:q])\n @people = @q.result.includes(:tags)\n Rails.logger.info(\"[SearchController#exportTwilio] people #{@people}\")\n phone_numbers = @people.collect(&:phone_number)\n Rails.logger.info(\"[SearchController#exportTwilio] people #{phone_numbers}\")\n phone_numbers = phone_numbers.reject { |e| e.to_s.blank? }\n @job_enqueue = Delayed::Job.enqueue SendTwilioMessagesJob.new(messages, phone_numbers, smsCampaign)\n if @job_enqueue.save\n Rails.logger.info(\"[SearchController#exportTwilio] Sent #{phone_numbers} to Twilio\")\n respond_to do |format|\n format.js {}\n end\n else\n Rails.logger.error('[SearchController#exportTwilio] failed to send text messages')\n format.all { render text: 'failed to send text messages', status: 400 }\n end\n end",
"def subscribe\n \nend",
"def sendSMS(to, body = \"No body was send for this message.\", media = nil)\n\naccount_sid = $accountsid\nauth_token = $authtoken\n@client = Twilio::REST::Client.new(account_sid, auth_token)\n\nif media\n message = @client.messages.create(\n body: body,\n from: $phone,\n media_url: [media],\n to: to\n)\nelse\n message = @client.messages.create(\n body: body,\n from: $phone,\n to: to\n)\nend\nreturn message.sid\nend",
"def start\n response = Twilio::TwiML::Response.new do |r|\n r.Pause\n play_audio(r, 'intro_message')\n ready_for_connection?(r)\n close_call(r)\n end\n\n render_twiml response\n end",
"def send_sms\n Sms.send_sms(session[:zeepusername], params[:sendmsg][:messagebody])\n \n @zeep_response = \"Message sent to #{session[:zeepusername]}!\"\n \n render :action => \"testloop\"\n \n end",
"def subscribe\n debug [self.name, \"incoming\"]\n subscribe_request\n end",
"def send_request; end",
"def to_s\n '#<Twilio::REST::Voice>'\n end",
"def twiml\n sms = { from: params[:From],\n to: params[:To],\n body: params[:Body] }\n\n from_user = User.find_by_phone_number(params[:From])\n sms[:from_user_id] = from_user.id if from_user\n to_user = User.find_by_phone_number(params[:To])\n sms[:to_user_id] = to_user.id if to_user\n\n # save the message into the DB\n @sms = Sms.create(sms)\n from_user = @sms.from_user\n\n # response logic\n # if from_user && from_user.response.nil?\n # if sms[:body].downcase.include?(\"yes\")\n # twilio.respond_to_yes(sms[:from])\n # from_user.response = true\n # from_user.save\n # elsif sms[:body].downcase.include?(\"no\")\n # twilio.send_sms(sms[:from], \"Got it. Have a great day!\")\n # from_user.response = false\n # from_user.save\n # end\n # end\n\n # Empty response to Twilio (Do nothing more)\n render xml: Twilio::TwiML::Response.new.text\n end",
"def create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset)\n data = Twilio::Values.of({\n 'From' => from,\n 'To' => to,\n 'StatusCallback' => status_callback,\n 'StatusCallbackMethod' => status_callback_method,\n 'StatusCallbackEvent' => Twilio.serialize_list(status_callback_event) { |e| e },\n 'Timeout' => timeout,\n 'Record' => record,\n 'Muted' => muted,\n 'Beep' => beep,\n 'StartConferenceOnEnter' => start_conference_on_enter,\n 'EndConferenceOnExit' => end_conference_on_exit,\n 'WaitUrl' => wait_url,\n 'WaitMethod' => wait_method,\n 'EarlyMedia' => early_media,\n 'MaxParticipants' => max_participants,\n 'ConferenceRecord' => conference_record,\n 'ConferenceTrim' => conference_trim,\n 'ConferenceStatusCallback' => conference_status_callback,\n 'ConferenceStatusCallbackMethod' => conference_status_callback_method,\n 'ConferenceStatusCallbackEvent' => Twilio.serialize_list(conference_status_callback_event) { |e| e },\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SipAuthUsername' => sip_auth_username,\n 'SipAuthPassword' => sip_auth_password,\n 'Region' => region,\n 'ConferenceRecordingStatusCallback' => conference_recording_status_callback,\n 'ConferenceRecordingStatusCallbackMethod' => conference_recording_status_callback_method,\n 'RecordingStatusCallbackEvent' => Twilio.serialize_list(recording_status_callback_event) { |e| e },\n 'ConferenceRecordingStatusCallbackEvent' => Twilio.serialize_list(conference_recording_status_callback_event) { |e| e },\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n ParticipantInstance.new(\n @version,\n payload,\n account_sid: @solution[:account_sid],\n conference_sid: @solution[:conference_sid],\n )\n end",
"def send_voice(messages)\r\n\r\n # validate required parameters\r\n validate_parameters({\r\n 'messages' => messages\r\n })\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.post _query_url, headers: _headers, parameters: messages.to_json\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def huzzah\n # ===========================================================================\n # 6. Send an SMS Message to 415-555-1212\n # uses a HTTP POST, and a new variable t for the information (because it needs \"Body\")\n \n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n \n t = {\n 'From' => CALLER_ID,\n 'To' => phone,\n 'Body' => message\n }\n resp = account.request(\"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/SMS/Messages\",\n \"POST\", t)\n end",
"def create\n\n\n coupon_id = params[:phone][:coupon_id]\n c = Coupon.find(coupon_id)\n\n\n\n @phone = Phone.new(phone_params)\n\n respond_to do |format|\n if @phone.save\n\n Promotion.create(phone_id: @phone.id, coupon_id: c.id)\n # set up a client to talk to the Twilio REST API\n @client = Twilio::REST::Client.new ENV['account_sid'], ENV['auth_token']\n\n @client.account.messages.create({\n :from => '+19548585330',\n :to => '+1'+@phone.mobile,\n :body => \"Thank you! your coupon promo code is #{c.promocode} --- This is a DEMO\",\n })\n\n if c.max_count < 1\n c.expiration = true\n c.save\n else\n c.max_count = c.max_count - 1\n c.save\n end\n\n\n\n\n format.html { redirect_to coupons_path, notice: 'Thank you!. You will receive a SMS with your promo code.' }\n format.json { render :show, status: :created, location: @phone }\n else\n format.html { render :new }\n format.json { render json: @phone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @number = Number.new(number_params)\n\n if !@number.business_number.blank?\n @number.business_number = \"+1\"+Phony.normalize(@number.business_number) \n end\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n number = @client.account.incoming_phone_numbers.create(:area_code => @number.area_code[1..3], :voice_url => BwCallTracking::Application.config.voice_url, :status_callback => BwCallTracking::Application.config.voice_url)\n @number.tracking_number = number.phone_number\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n respond_to do |format|\n if @number.save\n format.html { redirect_to numbers_url, notice: 'Number was successfully created.' }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_connection\n response = Twilio::TwiML::Response.new do |r|\n if active_call.next_target.present?\n connection = active_call.create_connection!\n play_audio(r, connection.connecting_message_key)\n play_audio(r, 'star_to_disconnect')\n target_number = ENV['FAKE_CONGRESS_NUMBER'] || connection.legislator.phone\n r.Dial target_number, 'action' => ivr_calls_connection_gather_prompt_url, 'hangupOnStar' => true, 'callerId' => caller_id\n else\n close_call(r)\n end\n end\n\n render_twiml response\n end",
"def twilio\n account_sid = ENV[\"TWILIO_SID\"]\n auth_token = ENV['TWILIO_TOKEN']\n client = Twilio::REST::Client.new account_sid, auth_token\n\n from = \"8452633595\"\n\n client.account.messages.create(\n :from => from,\n :to => self.phone,\n :body => \"#{self.title} - #{self.full_desc} ($#{self.price})\"\n )\n puts \"Sent message\"\n end",
"def on_outbound\n nil\n end",
"def create_subscription\n session[:merchant_subscription_id] = 'User' + sprintf('%03d', rand(1000)) + 'Subscription' + sprintf('%04d', rand(10000))\n\n # prepare payload\n data = {\n :Amount => params[:product] == '1' ? 1.99 : 3.99,\n :Category => 1,\n :Channel => 'MOBILE_WEB',\n :Description => 'Word game 1',\n :MerchantTransactionId => session[:merchant_subscription_id],\n :MerchantProductId => 'wordGame1',\n :MerchantPaymentRedirectUrl => settings.subscription_redirect_url,\n :MerchantSubscriptionIdList => 'sampleSubscription1',\n :IsPurchaseOnNoActiveSubscription => 'false',\n :SubscriptionRecurringNumber => '99999',\n :SubscriptionRecurringPeriod => 'MONTHLY',\n :SubscriptionRecurringPeriodAmount => 1\n }\n\n response = RestClient.post settings.notary_app_sign_url, :payload => data.to_json\n from_json = JSON.parse response\n\n redirect settings.FQDN + \"/Commerce/Payment/Rest/2/Subscriptions?clientid=#{settings.api_key}&SignedPaymentDetail=#{from_json['signed_payload']}&Signature=#{from_json['signature']}\"\nend",
"def create\n @user_voice = UserVoice.new(user_voice_params)\n\n if @user_voice.save\n flash.now[:success] = \"좋은 의견, 진심으로 감사합니다! 더 좋은 서비스가 되도록 노력하겠습니다!!!\"\n else\n flash.now[:danger] = \"문제가 발생했습니다. 불편을 드려 죄송합니다.\"\n end\n\n respond_to do |format|\n format.js { render layout: false }\n end \n end",
"def to_s\n '<Twilio::REST::Voice::V1>';\n end",
"def launch_call(dial_strategy)\n #Determine if the channel type is IAX2 or SIP and make a determination on how to dial\n channel_type = @config[\"profiles\"][dial_strategy[:profile]][\"channel\"].split('/')\n if channel_type[0] == \"IAX2\"\n channel = @config[\"channel\"] + dial_strategy[:number].to_s\n else\n channel = $HELPERS[\"hammer\"][profile][\"channel\"] + dial_strategy[:number].to_s\n end\n \n @thread_lock.synchronize do\n response = @adhearsion.proxy.originate( { \"Channel\" => channel,\n \"Context\" => @config[\"profiles\"][dial_strategy[:profile]][\"context\"],\n \"Exten\" => @config[\"profiles\"][dial_strategy[:profile]][\"extension\"],\n \"Priority\" => @config[\"profiles\"][dial_strategy[:profile]][\"priority\"],\n \"Callerid\" => dial_strategy[:callerid],\n \"Timeout\" => @config[\"profiles\"][dial_strategy[:profile]][\"timeout\"],\n \"Variable\" => dial_strategy[:instructions],\n\t\t\t\t\t \"Async\" => @config[\"profiles\"][dial_strategy[:profile]][\"async\"] } )\n end\n\t\t\t\t\t \n return response\n end",
"def set_caller_survey\n # Get phone_number from the incoming GET request from Twilio\n @phone_number = Sanitize.clean(params[:From])\n\n # Get a survey\n @survey = Survey.last\n\n # Create new Survey Participant with phone_number\n @caller = SurveyParticipant.where(phone_number: @phone_number).first_or_create()\n end",
"def invite\n \n end",
"def assert_requests!\n super\n expect(action_request.uri.to_s).to eq(current_config[:voice_request_url])\n end",
"def inscription\n @association = Association.new\n @ci = ChampIntervention.new\n @convention = Convention.new\n @conv_co = \"\"\n @index = 0\n @questionnaire = Quest.new()\n session[:original_uri] = request.request_uri\n session[:token] = nil\n @token = make_token()\n session[:token] = @token\n end",
"def receive_sms\n @view = \"sms\"\n @body = params[\"Body\"]\n @phone_number = params[\"From\"]\n set_user_create_message_parse_and_point\n end",
"def create\n call = Call.create_or_update(params)\n user_selection = params[:Digits]\n\n response = case user_selection\n when FORWARD_CALL then forward_call\n when LEAVE_A_MESSAGE then record_voicemail\n else main_menu\n end\n\n render xml: response.to_s\n end",
"def set_voice\n @voice = Voice.find(params[:id])\n end",
"def call\n account_sid = 'ACe330ba04d082392df4cb3511dcb72cec'\n auth_token = '2008ea097713e401a16c54029058da82'\n\n # set up a client to talk to the Twilio REST API\n @client = Twilio::REST::Client.new account_sid, auth_token\n\n @client.account.messages.create(\n :from => '+18152642023',\n :to => @number,\n :body => 'hahahayolo'\n )\n end",
"def speech; end",
"def phone_call(message)\n Ruboty::Call::Actions::Call.new(message).call\n end",
"def voice(phone_number, **params)\n\n self.post(VERIFY_VOICE_RESOURCE,\n phone_number: phone_number,\n **params)\n end",
"def new_voicemail_email(call)\n @user = call.user\n @call = call\n @recording = call.recording\n mail to: @user.email, subject: \"Voicemail message from #{@call.caller_number}\"\n end",
"def reply_to_sender(phone_number, msg)\n Rails.logger.debug('TropoController::reply_to_sender')\n #get_system_org.create_gateway!.send_raw(phone_number, msg)\n @tropo.say(msg)\n end",
"def say(payload)\n {\n action: 'say',\n options: {\n payload: payload,\n voice: 'male',\n language: 'en-US'\n }\n }\nend"
] |
[
"0.66509074",
"0.654617",
"0.65284324",
"0.64826334",
"0.6399475",
"0.63198316",
"0.62926495",
"0.6153834",
"0.5982701",
"0.5957627",
"0.5921058",
"0.5900613",
"0.5880843",
"0.58600676",
"0.57690597",
"0.5768218",
"0.57637024",
"0.5746355",
"0.5735717",
"0.5719375",
"0.56846833",
"0.56305635",
"0.5623838",
"0.5618737",
"0.56082225",
"0.55892694",
"0.5573881",
"0.55661064",
"0.55461967",
"0.5540374",
"0.5534613",
"0.5532043",
"0.5491525",
"0.54821545",
"0.54709923",
"0.5463548",
"0.545908",
"0.5452256",
"0.5452213",
"0.5423061",
"0.5410643",
"0.54068315",
"0.5397478",
"0.5397252",
"0.5391953",
"0.5373471",
"0.5368831",
"0.5360095",
"0.5347131",
"0.5346334",
"0.5345371",
"0.5337366",
"0.5335481",
"0.53130555",
"0.5311961",
"0.53081024",
"0.5301894",
"0.52932113",
"0.52916145",
"0.52832234",
"0.52800936",
"0.52793396",
"0.52646303",
"0.5252481",
"0.52521485",
"0.52376926",
"0.52332735",
"0.5223192",
"0.5215147",
"0.5184411",
"0.51825905",
"0.5169866",
"0.5140495",
"0.51389927",
"0.51187545",
"0.51114935",
"0.51059914",
"0.50884473",
"0.50878245",
"0.5085619",
"0.5074095",
"0.5071979",
"0.50617206",
"0.50584227",
"0.5055791",
"0.50515795",
"0.5050899",
"0.50476325",
"0.50406826",
"0.503912",
"0.50387657",
"0.50386864",
"0.50358915",
"0.5033925",
"0.5027159",
"0.5025583",
"0.49995792",
"0.49974564",
"0.49931467",
"0.49916136",
"0.4988916"
] |
0.0
|
-1
|
Make voice calls through the browser. This web request gets called by Twilio based on your Twilio settings, which can be modified at
|
def voice
from_number = params['FromNumber'].blank? ? ENV['TWILIO_CALLER_ID'] : params['FromNumber']
twiml = Twilio::TwiML::Response.new do |r|
if params['To'] and params['To'] != ''
r.Dial callerId: from_number do |d|
# wrap the phone number or client name in the appropriate TwiML verb
# by checking if the number given has only digits and format symbols
if params['To'] =~ /^[\d\+\-\(\) ]+$/
d.Number params['To']
else
d.Client params['To']
end
end
else
r.Say "Thanks for calling!"
end
end
render xml: twiml.text
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def voice\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'Hey there. Congrats on integrating Twilio into your Rails 4 app.', :voice => 'alice'\n r.Play 'http://linode.rabasa.com/cantina.mp3'\n end\n \n render_twiml response\n end",
"def voice\n # Give Twilio the TwiML payload instructions\n twiml_payload\n end",
"def makecall\n \n client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])\n @call = client.account.calls.create(\n :from => TWILIO_CONFIG['from'], # From your Twilio number\n :to => '+19493228496', # To any number\n # Fetch instructions from this URL when the call connects\n :url => 'http://snipit.herokuapp.com/voicein'\n )\n end",
"def voice\n reminder = Reminder.find(params[:id])\n \tresponse = Twilio::TwiML::Response.new do |r|\n r.Say 'This is a reminder message from the Remmyo service.',:voice => 'alice'\n \t r.Say reminder.message, :voice => 'alice'\n r.Say 'End of message.',:voice => 'man'\n # r.Play 'http://linode.rabasa.com/cantina.mp3'\n \tend\n\n \trender_twiml response\n end",
"def send_voice(voice_messages)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'voice_messages' => voice_messages\r\n )\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: voice_messages.to_json\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def request_for_twiml!(path, options = {})\n @current_path = normalize_redirect_path(path)\n\n # Post the query\n rack_test_session_wrapper = Capybara.current_session.driver\n @response = rack_test_session_wrapper.send(options[:method] || :post, @current_path,\n :format => :xml,\n :CallSid => @root_call.sid,\n :From => @root_call.from_number,\n :Digits => formatted_digits(options[:digits].to_s, :finish_on_key => options[:finish_on_key]),\n :To => @root_call.to_number,\n :AnsweredBy => (options[:is_machine] ? \"machine\" : \"human\"),\n :CallStatus => options.fetch(:call_status, \"in-progress\")\n )\n\n # All Twilio responses must be a success.\n raise \"Bad response: #{@response.status}\" unless @response.status == 200\n\n # Load the xml\n data = @response.body\n @response_xml = Nokogiri::XML.parse(data)\n set_xml(@response_xml.at_xpath(\"Response\"))\n end",
"def start\n find_or_create_active_call\n response = Twilio::TwiML::Response.new do |r|\n r.Pause\n ready_for_connection?(r)\n r.Say('Please try again later.')\n play_audio(r, 'goodbye')\n end\n\n render_twiml response\n end",
"def index\n @calls = Call.all\n @account_sid = 'AC17355db7790d2916f0e059ec874d62aa' \n @auth_token = '626448ea4774753933df10fa70d779b4' \n \n # set up a client to talk to the Twilio REST API \n # @client = Twilio::REST::Client.new(@account_sid, @auth_token)\n \n # @call = @client.account.calls.create({ \n # :from => '+6421428583',\n # :to => '+644769123', \n # :method => 'GET', \n # :fallback_method => 'GET', \n # :status_callback_method => 'GET', \n # :record => 'false'\n # })\n\n # This application sid will play a Welcome Message.\n @demo_app_sid = 'APabe7650f654fc34655fc81ae71caa3ff'\n @capability = Twilio::Util::Capability.new( @account_sid, @auth_token)\n @capability.allow_client_outgoing @demo_app_sid\n @token = @capability.generate\n # @erb :index, :locals => {:token => @token} \n\n\n\n \n\n end",
"def receive_browser_call\n campaign_id = params[:campaign_id].to_i\n Sharelink.add_clicker(campaign_id, session[:referrer_id], current_user) if session[:referrer_id]\n Call.create(:campaign_id => campaign_id, :user_id => params[:id], :twilio_id => params[:CallSid])\n outbound_call = Campaign.outbound_call_instructions(campaign_id)\n render :xml => outbound_call.text\n end",
"def learn_ruby\n # user = User.find_by(:token => 'Coi1Y73r3-ZWg7qfV8YItw')\n # user.destroy\n account_sid = ENV['TWILIO_ACCOUNT_SID']\n auth_token = ENV['TWILIO_AUTH_TOKEN']\n @client = Twilio::REST::Client.new account_sid, auth_token\n @client.account.calls.create(\n :url => \"http://demo.twilio.com/docs/voice.xml\",\n :to => \"+841269162753\",\n :from => \"+14157809231\")\n # log = user.logs.create(caller: \"samngu\")\n render json: {:ok => true}\n end",
"def send_voice(messages)\r\n\r\n # validate required parameters\r\n validate_parameters({\r\n 'messages' => messages\r\n })\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.post _query_url, headers: _headers, parameters: messages.to_json\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"def twilio\n @number = params[:phone_number]\n \n #Text message info\n t = {\n \n 'From' => CALLER_ID,\n 'To' => @number,\n 'Body' => (\"Visit uhpartments.com when you walk through an apartment\")\n }\n\n begin\n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n resp = account.request(\"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/SMS/Messages\",\n 'POST',\n t)\n resp.error! unless resp.kind_of? Net::HTTPSuccess\n rescue StandardError => bang\n #This area will be called if an error happens with the Twilio API\n flash[:alert] = \"Bad number.\"\n redirect_to({ :action => :home })\n \n return\n end\n\n redirect_to({ :action => :home, :alert => \"SMS sent.\" })\n end",
"def voice(phone_number, **params)\n\n self.post(VERIFY_VOICE_RESOURCE,\n phone_number: phone_number,\n **params)\n end",
"def consume\n consume_phone_number = params[:To]\n \n Rails.logger.info \"Current page is: #{params[:current_page]}\"\n \n # Check what was pressed.\n if params[:Digits].blank?\n # Show main menu\n response = VoiceExtension::MenuOption::build_menu_option\n else\n begin\n page = VoiceExtension::Page.where(name: params[:current_page]).first\n response = VoiceExtension::MenuOption::build_menu_option(params[:Digits].to_s, page)\n rescue\n Rails.logger.error \"Unable to generate menu: #{$!.message}\"\n Rails.logger.error $!.backtrace.join(\"\\n\")\n response = Twilio::TwiML::Response.new do |r|\n r.Say VoiceExtension::MenuOption::GENERIC_ERROR_MESSAGE_TO_VOICE, :voice => 'woman'\n end\n end\n end\n \n begin\n render :text => response.text\n rescue\n Rails.logger.error $!.message\n end\n end",
"def speak\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'hello there', :voice => 'woman'\n end\n @xml=response.text\nend",
"def number(twilio=false, name=nil, area_code=nil)\n if twilio\n # Check if twilio configuration exists. If not throw and errors because twilio was passed as true.\n if !@config[:configuration][:twilio].blank? and (!@config[:configuration][:twilio][:account_id].blank? and !@config[:configuration][:twilio][:api_key].blank?)\n account = @config[:configuration][:twilio][:account_id]\n key = @config[:configuration][:twilio][:api_key]\n\n # Initialize twilio client.\n twilio = Twilio::REST::Client.new account, key\n\n # If any area code is provide look for local numbers, if not get a toll free.\n if area_code.blank?\n available_numbers = twilio.account.available_phone_numbers.get('US').toll_free.list\n else\n available_numbers = twilio.account.available_phone_numbers.get('US').local.list(area_code: area_code) unless area_code.blank?\n end\n\n # Select the first number available.\n available_number = available_numbers.first\n\n # If available numbers is blank throw an error because something went wrong.\n if available_numbers.blank?\n raise StandardError, \"No Available Numbers\"\n else\n\n # Convert the phone number into something a artificial voice can say.\n phone_number = available_number.phone_number.gsub(\"+1\",\"\")\n phone_number = \"#{phone_number[0..2]}-#{phone_number[3..5]}-#{phone_number[6..10]}\"\n\n\n # Setting the transciption email\n # email = @config[:configuration][:twilio][:transcription_email].blank? ? \"developers%40level.agency\" : @config[:configuration][:twilio][:transcription_email]\n email = \"developers%40level.agency\"\n # Put together the voicemail Twimil.\n voice_message = \"http://twimlets.com/voicemail?Email=#{email}&Message=You%20reached%20the%20voicemail%20box%20of%20#{phone_number}.%20%20Please%20leave%20a%20message%20after%20the%20beep.&Transcribe=true&\"\n\n # Here we buy the number, set the voice_url to the voicemail Twimil and set the\n # sms_url to echo so Twilio will capture the message but not reply to it.\n number = twilio.account.incoming_phone_numbers.create({\n phone_number: available_number.phone_number,\n friendly_name: name,\n voice_url: voice_message,\n voice_method: \"GET\",\n sms_url: \"http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E\",\n sms_method: \"GET\"\n })\n\n # If number is blank throw and error because something went wrong.\n if number.blank?\n raise StandardError, \"Unable to allocate Twilio number\"\n else\n number.phone_number\n end\n end\n else\n raise ArgumentError, \"Cannot find Twilio Account ID and API key in configuration\"\n end\n else\n Faker::PhoneNumber.phone_number\n end\n end",
"def phone_call(message)\n Ruboty::Call::Actions::Call.new(message).call\n end",
"def start\n response = Twilio::TwiML::Response.new do |r|\n r.Pause\n play_audio(r, 'intro_message')\n ready_for_connection?(r)\n close_call(r)\n end\n\n render_twiml response\n end",
"def speak\n speak_what = params[:text_to_speak]\n logger.debug \"speak_what=#{speak_what}\"\n if !speak_what.present? then return end\n speak_what_encoded = ERB::Util.url_encode(speak_what)\n logger.debug \"speak_what_encoded=#{speak_what_encoded}\"\n uri = \"#{HOST}:#{PORT}/sayall/#{speak_what_encoded}\"\n begin\n logger.debug \"uri=#{uri}\"\n response = open(uri).read \n rescue ActionController::UnknownFormat => e\n if e.include? '204'\n # do nothing\n else\n logger.debug \"Exception in text_to_speech_controller: #{e.to_s}\"\n raise e\n end\n rescue Exception => e\n logger.debug \"Exception in text_to_speech_controller: #{e.to_s}\"\n raise e \n end\n redirect_to :controller => 'presets', :action => 'display'\n end",
"def make_call(to, path, call_back_path)\n from = '+18015131966'\n req_params = {\n from: from,\n to: to,\n url: \"#{ENV['CALL_SERVICE_URL']}#{path}\",\n if_machine: \"Hangup\",\n status_callback: \"#{ENV['CALL_SERVICE_URL']}#{call_back_path}\",\n timeout: 10\n\n }\n\n if Rails.env == \"development\"\n url = \"http://127.0.0.1:4567/make_call\"\n RestClient.post url, req_params\n else\n client = Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_TOKEN\"])\n account = client.account\n call = account.calls.create(req_params)\n end\n end",
"def start\n response = Authy::PhoneVerification.start(\n via: 'sms',\n country_code: 1,\n phone_number: params[:phone]\n )\n render json: response\n end",
"def call\n system(SPEECH_COMMAND)\n end",
"def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tdocument.body.innerHTML = \"<iframe src=tel:#{datastore['phoneNumber']}></iframe>\";\n\t\t\tXSSF_POST(\"Phone call launched\",'#{self.name}');\n\t\t}\n\t\t\n\t\tsend_response(cli, code)\n\tend",
"def send_joke\r\n client = Twilio::REST::Client.new Rails.application.secrets.twilio_account_sid, Rails.application.secrets.twilio_auth_token\r\n message = client.messages.create from: '347-933-6917', to: params[:phone_number], body: Joke.pick_joke\r\n redirect_to :back\r\n end",
"def huzzah\n # ===========================================================================\n # 6. Send an SMS Message to 415-555-1212\n # uses a HTTP POST, and a new variable t for the information (because it needs \"Body\")\n \n account = Twilio::RestAccount.new(ACCOUNT_SID, ACCOUNT_TOKEN)\n \n t = {\n 'From' => CALLER_ID,\n 'To' => phone,\n 'Body' => message\n }\n resp = account.request(\"/#{API_VERSION}/Accounts/#{ACCOUNT_SID}/SMS/Messages\",\n \"POST\", t)\n end",
"def request_voice(nick)\n #TODO: fiber blocks on getting the registration form\n # user fills-in the form and submit\n # rooms returns result\n raise NotImplementedError\n end",
"def speech_analysis(url)\r\n return iod_request('recognizespeech',\r\n {:url => url, :language => $audio_language, :apikey => $api_key})\r\nend",
"def initiate_conference\n @call = Call.find(params[:id])\n @call.participants.each do |participant|\n #TWILIO_CLIENT.account.calls.create({from: '+12065382886', to: \"+1#{participant.phone}\", url: \"http://dial-me-in.herokuapp.com/calls/#{@call.id}/handle_call\"})\n end\n\n redirect_to @call\n end",
"def transcribe\n @call = Call.find(params[:id])\n @call.update_attribute :transcription_text, params[:TranscriptionText] || @call.transcription_text\n @call.update_attribute :transcription_status, params[:TranscriptionStatus] || @call.transcription_status\n \n render \"calls/twiml/recording/#{@call.template}.xml.erb\"\n end",
"def menu\n account = Account.where(:consume_phone_number => params[:To]).first\n menu_option = account.menu_options.where(:name => params[:object_name].downcase.strip).first\n response = menu_option.build_voice_response(params[:Digits])\n \n render :text => response.text\n end",
"def build_twilio_wrapper\n @twilio_wrapper = ::VoiceExtension::TwilioVoiceWrapper::Voice.new\n end",
"def call\n tg = TicketGroup.find(params[:ticket_group_id])\n event_name = 'testing name'\n row = 'test row'\n section = 'test section'\n if tg\n event = tg.custom_event\n event_name = event.name\n section = tg.section\n row = tg.row\n end\n if session[:buyer]\n buyer = Buyer.find(session[:buyer])\n hit_tropo_end_point({\n 'name' => buyer.first_name,\n 'event_name' => event_name,\n #'section' => section,\n #'row' => row,\n 'action' => 'voice',\n 'call_type' => AppSettings::CALL_TYPE[:voice]\n })\n flash[:message] = \"successfully called!\"\n else\n respond_to do |format|\n flash[:error] = \"sign up or sign in as a buyer first!\"\n format.html { redirect_to(\"/buyers/new\")}\n end\n end\n end",
"def reminderCall\n @twilio_number = ENV['TWILIO_NUMBER']\n @client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n call = @client.account.calls.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :url => 'https://clockairos.herokuapp.com/twilio/call',\n :method => 'POST',\n :fallback_method => 'GET',\n :status_callback_method => 'GET',\n :if_machine => 'Hangup',\n :timeout => '30',\n :record => 'false'\n )\n puts call.to\n end",
"def reply # acts as endpoint\n \tmessage_body = params[\"Body\"] # grab params from Twilio's request\n \tfrom_number = params[\"From\"]\n \tboot_twilio\n \tsms = @client.messages.create( # send to inbound number made by end user\n from: Rails.application.secrets.twilio_from_number,\n to: from_number,\n body: \"Hello there, thanks for texting me. Your number is #{from_number}.\"\n \t)\n end",
"def chat request_pb, options:, &block\n request_json = JSON.parse ::Google::Showcase::V1beta1::EchoRequest.encode_json(request_pb)\n\n uri = \"\"\n\n result_json = @client_stub.make__request(\n uri: uri,\n options: options,\n &block\n )\n\n ::Google::Showcase::V1beta1::EchoResponse.decode_json result_json[:body]\n end",
"def phone_playback(number,\r\n audio_url)\r\n # Prepare query url.\r\n _path_url = '/phone-playback'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'output-case' => 'camel',\r\n 'number' => number,\r\n 'audio-url' => audio_url\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: _parameters\r\n )\r\n CustomQueryAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n PhonePlaybackResponse.from_hash(decoded)\r\n end",
"def callback\n twilio_id = params[:CallSid]\n call = Call.where('twilio_id = ?', twilio_id).first\n call.get_recording_info(twilio_id, params[:CallDuration], params[:AnsweredBy])\n render :json => 'callback success'\n end",
"def play\n voice = User.find_by(id: current_user.id).tts_voice\n logger.info '================ START TTS ==============='\n answer_audio_file = TtsService.call(@entry, voice)\n logger.info '================ END TTS ==============='\n respond_to do |format|\n format.html do\n response.headers[\"Cache-Control\"] = \"no-cache, no-store\"\n response.headers[\"Pragma\"] = \"no-cache\"\n response.headers[\"Expires\"] = \"Mon, 01 Jan 1990 00:00:00 GMT\"\n expires_in 1.seconds, public: true\n send_file(answer_audio_file, type: 'audio/mpeg', disposition: 'inline')\n end\n end\n end",
"def to(phone, content, options)\n send_with_block do\n res = Net::HTTP.post_form(URI.parse(URL),\n userCode: options[:username],\n userPass: options[:password],\n DesNo: phone,\n Msg: content,\n Channel: 0)\n result res.body\n end\n end",
"def send(phone, message)\n url = get_url\n url.query = get_data(phone, message)\n \n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = (url.scheme == 'https')\n \n res = https.get(url.request_uri)\n \n if res.code.to_i != 200\n raise Exception.new(\"Server responded with HTTP \" + res.code)\n end\n \n if res.body != OK\n raise Exception.new(get_error_message(res.body))\n end\n end",
"def set_voice\n @voice = Voice.find(params[:id])\n end",
"def voice\n twiml do |r|\n r.Say \"Welcome to #{@session.current_state.titleize}... This area is currently under construction.\"\n r.Pause length: 2\n r.Say \"Have a nice day\"\n end\n end",
"def re_record_prompt\n active_recording = active_call.recordings.create!(duration: params['RecordingDuration'], recording_url: params['RecordingUrl'])\n response = Twilio::TwiML::Response.new do |r|\n r.Say 'Thank you.'\n play_audio(r, 'recording_play_back')\n play_audio(r, 'recording_recrcord_instructions')\n r.Gather(\n action: ivr_recordings_new_recording_url,\n method: 'get',\n 'numDigits' => 1,\n 'finishOnKey' => ''\n ) do |gather|\n r.Play(active_recording.recording_url)\n play_audio(r, 'recording_play_back')\n play_audio(r, 'recording_recrcord_instructions')\n end\n play_audio(r, 'goodbye')\n r.Hangup\n end\n\n render_twiml response\n end",
"def sms\n \t\n \t#flash[:notice] = params\n \t#redirect_to root_path\n\n TwilioTextMessenger.new( params[:phone], params[:message]).call\n \t\n end",
"def send_request(conference_id, phone_number, db_call_id)\n #for rest_params, just care about those 3 passed params, forget about others for now.\n rest_params = {\n \"method\" => Constants::SINCH_CALL_METHOD,\n \"conferenceCallout\" =>\n {\n \"destination\" => {\"type\" => \"number\", \"endpoint\" => phone_number},\n \"domain\" => \"pstn\",\n \"custom\" => db_call_id,\n \"locale\" => \"en-US\",\n \"greeting\" => \"Welcome to my conference\",\n \"conferenceId\" => conference_id,\n \"enableAce\" => false,\n \"enableDice\" => true\n }\n }\n res = RestClient.post Constants::SINCH_API_URL, JSON.generate(rest_params), {content_type: :json, :Authorization => 'Basic MjNjYWVjNGUtNDY3YS00ODZhLTkyZjAtNDNjMDhiMDZhZDU2Om52eENGZ0xjZ2t1cWtIeEZxd1hKRWc9PQ=='}\n #TODO will remove this when we launch\n puts \"=======#{res.body}\"\n puts \"=======#{res.code}\"\n res.body\n end",
"def speech_recognized(object, connection, phrase)\n\t\tif @state == :DEFAULT_STATE \n\t\t\tif phrase.match(/^next/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRINextPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n \n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to next page.\")\n\t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\telsif phrase.match(/^back/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRIPreviousPage\") # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Gone to previous page.\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n\t\t\t elsif phrase.match(/^search for (.+)/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n \t\t\t\t# @tweetText = $1\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\n \"Port\" => 800,\n \"Binmode\" => true,\n # \"Timeout\" => 10,\n \"Telnetmode\" => true,\n \"Prompt\" => \"\"\n ) { |resp| print \"==> \"+resp }\n # pass username and password as commands not .login method\n @telnet.cmd(\"iam:SIRISearch\"+$1) # { |c| print c }\n # @telnet.puts(\"\") { |c| print c }\n # @telnet.write(\"\\n\\n\\n\\n\\ Ciao\")\n # @response = ''\n # @telnet.cmd(\"String\" => \"response\", \"FailEOF\" => false) # { |c| print c; @response += c }\n @telnet.close\n # return self.generate_search_response(connection.lastRefId, $1);\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok, which one do you want?\")\n \t\t\t\t# return self.generate_tweet_response(connection.lastRefId, $1);\n \t\t\t elsif phrase.match(/^the first/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex0\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the second/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex1\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the third/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex2\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fourth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex3\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t elsif phrase.match(/^the fifth/i)\n \t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n \t\t\t\t@state = :DEFAULT_STATE\n @telnet = Net::Telnet::new(\"Host\" => \"192.168.2.9\",\"Port\" => 800,\"Binmode\" => true,\"Telnetmode\" => true,\"Prompt\" => \"\") { |resp| print \"==> \"+resp }\n @telnet.cmd(\"iam:SIRISearchIndex4\") # { |c| print c } \n @telnet.close\n \t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Here it is.\")\n \t\t\tend\n\t\t\t\n\t\telsif @state == :CONFIRM_STATE\n\t\t\tif phrase.match(/yes/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\t# @twitterClient.update(@tweetText) # this should probably be done in a seperate thread\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok it has been posted to Twitter.\")\n\t\t\tend\n\t\t\tif phrase.match(/no/i)\n\t\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\t\t@state = :DEFAULT_STATE\n\t\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Ok I won't send it.\")\n\t\t\tend\n\n\t\t\tself.plugin_manager.block_rest_of_session_from_server\n\t\t\treturn generate_siri_utterance(connection.lastRefId, \"Do you want me to send it?\", \"I'm sorry. I don't understand. Do you want me to send it? Say yes or no.\", true)\n\t\tend\n\n\t\tobject\n\tend",
"def call\n account_sid = 'ACe330ba04d082392df4cb3511dcb72cec'\n auth_token = '2008ea097713e401a16c54029058da82'\n\n # set up a client to talk to the Twilio REST API\n @client = Twilio::REST::Client.new account_sid, auth_token\n\n @client.account.messages.create(\n :from => '+18152642023',\n :to => @number,\n :body => 'hahahayolo'\n )\n end",
"def outboundcall\n # This FromPhoneNumber should have been verified in the associated sub-account\n render_twiml generateTwiml(params[:FromPhoneNumber], params[:ToPhoneNumber])\n end",
"def outgoing\n from_phone = parse_sim_sid(params[:From])\n response = Twilio::TwiML::VoiceResponse.new\n response.dial(caller_id: from_phone) do |d|\n d.number params[:To]\n end\n\n render xml: response.to_xml\n end",
"def call\n uri = URI.parse(ovh_domain)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n request = build_request\n add_headers(request)\n\n response = http.request(request)\n stdout_warn_log \"Made call to API: #{response.body}\"\n stdout_error_log 'Error: Call to API failed' && context.fail! unless response.is_a? Net::HTTPSuccess\n response\n end",
"def get_token\n campaign_id = Campaign.find(params[:id]).id \n call = Call.new\n call.campaign_id = campaign_id\n call.target_name = call.campaign.target_name\n call.twilio_token\n render :json => call\n end",
"def recording\n @call = Call.find(params[:id])\n @call.update_attribute :recording_url, params[:RecordingUrl] || @call.recording_url\n @call.update_attribute :recording_duration, params[:RecordingDuration] || @call.recording_duration\n \n render \"calls/twiml/recording/#{@call.template}.xml.erb\"\n end",
"def send_text(call_job)\n from = '+18015131966'\n\n req_params = {\n from: from,\n to: call_job.phone,\n status_callback: \"#{ENV['CALL_SERVICE_URL']}twilio/provider_text_status_callback.xml\",\n body: call_job.body\n }\n\n if Rails.env == \"development\"\n url = \"http://127.0.0.1:4567/send_text\"\n RestClient.post url, req_params\n else\n client = Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_TOKEN\"])\n\n account = client.account\n message = account.sms.messages.create(req_params)\n end\n end",
"def send_to_phone\n if params[:level_source] && params[:phone] && (level_source = LevelSource.find(params[:level_source]))\n send_sms(level_source_url(level_source), params[:phone])\n elsif params[:channel_id] && params[:phone] && ProjectsController::STANDALONE_PROJECTS.include?(params[:type])\n url =\n if params[:type] == 'weblab'\n \"https://codeprojects.org/#{params[:channel_id]}\"\n else\n polymorphic_url([\"#{params[:type]}_project_share\", 'projects'], channel_id: params[:channel_id])\n end\n send_sms(url, params[:phone])\n else\n head :not_acceptable\n end\n end",
"def calling_speak\n speak\n end",
"def send_text(text, phone)\n account_sid = ENV[\"ACCOUNT_SID\"]\n auth_token = ENV[\"AUTH_TOKEN\"]\n client = Twilio::REST::Client.new account_sid, auth_token\n\n account = client.account\n message = account.sms.messages.create({\n :from => ENV[\"PHONE\"],\n :to => phone,\n :body => text})\n puts message\n end",
"def send_to_phone\n if params[:level_source] && params[:phone] && (level_source = LevelSource.find(params[:level_source]))\n send_sms(level_source, params[:phone])\n render status: :ok, nothing: true\n else\n render status: :not_acceptable, nothing: true\n end\n end",
"def slack_call(method, args)\n client.web_client.send(method, args)\n end",
"def say_hello(options)\n via_option = options[:via] ? \"_via_#{options[:via].to_s.downcase}\" : \"\"\n with_option = options[:with] ? \"_with_#{options[:with].to_s.downcase}\" : \"\"\n\n Net::HTTP.start(\"localhost\", 3000) do |http|\n http.request_post(\"/sync_hello/execute#{via_option}#{with_option}\",\n \"sleep=0.5\")\n end\n end",
"def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call),\n status_callback: member_call_event_url(call),\n status_callback_method: 'POST',\n status_callback_event: %w[initiated ringing answered completed]\n }\n client.calls.create params\n rescue Twilio::REST::RestError => e\n # 13223: Dial: Invalid phone number format\n # 13224: Dial: Invalid phone number\n # 13225: Dial: Forbidden phone number\n # 13226: Dial: Invalid country code\n # 21211: Invalid 'To' Phone Number\n # 21214: 'To' phone number cannot be reached\n call.action.destroy!\n call.update!(twilio_error_code: e.code, status: 'failed', action_id: nil)\n if (e.code >= 13_223 && e.code <= 13_226) || [21_211, 21_214].include?(e.code)\n add_error(:member_phone_number, I18n.t('call_tool.errors.phone_number.cant_connect'))\n else\n Rails.logger.error(\"Twilio Error: API responded with code #{e.code} for #{call.attributes.inspect}\")\n add_error(:base, I18n.t('call_tool.errors.unknown'))\n end\n end",
"def create\n @voice = Voice.new(voice_params)\n output_filepath = download_voice(params[:voice][:url])\n File.open(\"#{Rails.root}/#{output_filepath}\") do |f|\n @voice.voice_file = f\n end\n o, e, s = Open3.capture3(\"wget -nv --delete-after '#{@voice.url}'\")\n e.chomp =~ /.*URL:(.*) \\[.*\\] -> /\n @voice.url = Regexp.last_match(1)\n return render :edit if @voice.invalid?\n @voice.save!\n\n system(\"rm #{output_filepath}\")\n\n flash[:success] = 'Voice was successfully created.'\n redirect_to voices_path\n end",
"def voice_client\r\n @voice_client ||= Voice::Client.new(config: config)\r\n end",
"def call_to\n @number = params[:number]\n user_id = session[:user_id]\n user = User.find(user_id)\n\n @error = \"\"\n device = user.primary_device\n\n if device\n # originate callback\n src = device.extension\n dst = @number\n #var2 = \"__MOR_CALLC_ACTION_ID=#{action.id.to_s}\"\n\n server = Confline.get_value(\"Web_Callback_Server\").to_i\n server = 1 if server == 0\n\n channel = \"Local/#{src}@mor_cb_src/n\"\n st = originate_call(device.id, src, channel, \"mor_cb_dst\", dst, device.callerid_number, nil, server)\n @error = _('Cannot_connect_to_asterisk_server') if st.to_i != 0\n else\n @error = _('No_device')\n end\n\n render(:layout => false)\n end",
"def tv_enquiry(user_input_tokens)\n television_enquiry(user_input_tokens)\n end",
"def send_message\n response = RestClient::Request.new(\n :method => :post,\n :url => \"https://api.twilio.com/2010-04-01/Accounts/#{ENV['TWILIO_ACCOUNT_SID']}/Messages.json\",\n :user => ENV['TWILIO_ACCOUNT_SID'],\n :password => ENV['TWILIO_AUTH_TOKEN'],\n :payload => { :Body => body,\n :To => Contact.find(self.contact_id).number,\n :From => ENV['USER_NUMBER'] }\n ).execute\n end",
"def speak(text)\n @conn.post 'speak.json', :message => {:body => text}\n end",
"def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, if_machine: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, url: :unset, application_sid: :unset)\n data = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'Url' => url,\n 'ApplicationSid' => application_sid,\n 'Method' => method,\n 'FallbackUrl' => fallback_url,\n 'FallbackMethod' => fallback_method,\n 'StatusCallback' => status_callback,\n 'StatusCallbackEvent' => status_callback_event,\n 'StatusCallbackMethod' => status_callback_method,\n 'SendDigits' => send_digits,\n 'IfMachine' => if_machine,\n 'Timeout' => timeout,\n 'Record' => record,\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SipAuthUsername' => sip_auth_username,\n 'SipAuthPassword' => sip_auth_password,\n 'MachineDetection' => machine_detection,\n 'MachineDetectionTimeout' => machine_detection_timeout,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end",
"def send_sms phone, message\n message = URI.escape message\n response = RestClient.get \"#{sender_base_url}/?from=#{@from}&to=#{phone}&text=#{message}&pass=#{@application_pass}\"\n @response = Response.new response\n end",
"def twilio\n account_sid = ENV[\"TWILIO_SID\"]\n auth_token = ENV['TWILIO_TOKEN']\n client = Twilio::REST::Client.new account_sid, auth_token\n\n from = \"8452633595\"\n\n client.account.messages.create(\n :from => from,\n :to => self.phone,\n :body => \"#{self.title} - #{self.full_desc} ($#{self.price})\"\n )\n puts \"Sent message\"\n end",
"def launch_call(dial_strategy)\n #Determine if the channel type is IAX2 or SIP and make a determination on how to dial\n channel_type = @config[\"profiles\"][dial_strategy[:profile]][\"channel\"].split('/')\n if channel_type[0] == \"IAX2\"\n channel = @config[\"channel\"] + dial_strategy[:number].to_s\n else\n channel = $HELPERS[\"hammer\"][profile][\"channel\"] + dial_strategy[:number].to_s\n end\n \n @thread_lock.synchronize do\n response = @adhearsion.proxy.originate( { \"Channel\" => channel,\n \"Context\" => @config[\"profiles\"][dial_strategy[:profile]][\"context\"],\n \"Exten\" => @config[\"profiles\"][dial_strategy[:profile]][\"extension\"],\n \"Priority\" => @config[\"profiles\"][dial_strategy[:profile]][\"priority\"],\n \"Callerid\" => dial_strategy[:callerid],\n \"Timeout\" => @config[\"profiles\"][dial_strategy[:profile]][\"timeout\"],\n \"Variable\" => dial_strategy[:instructions],\n\t\t\t\t\t \"Async\" => @config[\"profiles\"][dial_strategy[:profile]][\"async\"] } )\n end\n\t\t\t\t\t \n return response\n end",
"def voice_send_post_with_http_info(voice_messages, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VoiceApi.voice_send_post ...'\n end\n # verify the required parameter 'voice_messages' is set\n if @api_client.config.client_side_validation && voice_messages.nil?\n fail ArgumentError, \"Missing the required parameter 'voice_messages' when calling VoiceApi.voice_send_post\"\n end\n # resource path\n local_var_path = '/voice/send'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(voice_messages)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VoiceApi#voice_send_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new; send_sms; end",
"def answer\n return render nothing: true unless params[:Event] == 'StartApp'\n\n @from = params[:From]\n company_number = CompanyNumber.find_by_sip_endpoint params[:To]\n Call.create! from: @from, call_uuid: params[:CallUUID], company_number: company_number\n @user_numbers = company_number.users.joins(:user_numbers).select('user_numbers.sip_endpoint')\n end",
"def say(payload)\n {\n action: 'say',\n options: {\n payload: payload,\n voice: 'male',\n language: 'en-US'\n }\n }\nend",
"def create\n @user_voice = UserVoice.new(user_voice_params)\n\n if @user_voice.save\n flash.now[:success] = \"좋은 의견, 진심으로 감사합니다! 더 좋은 서비스가 되도록 노력하겠습니다!!!\"\n else\n flash.now[:danger] = \"문제가 발생했습니다. 불편을 드려 죄송합니다.\"\n end\n\n respond_to do |format|\n format.js { render layout: false }\n end \n end",
"def create\n @call = Call.new(params[:call])\n \n respond_to do |format|\n if @call.save\n \n result = OutgoingCallerId.find(:last)\n twcall = @twilio_client.account.calls.create(\n from: result.phone_number,\n to: @call.to, \n url: \"#{url_for(@call)}/twiml.xml\")\n \n @call.update_attribute :sid, twcall.sid\n format.html { redirect_to @call, notice: \"Call was successfully created.#{url_for(@call)}\" }\n format.json { render json: @call, status: :created, location: @call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end",
"def voice!\n return true if voice?\n\n raise 'You must be voiced to use this command.'\n end",
"def set_user_voice\n @user_voice = UserVoice.find(params[:id])\n end",
"def configure_phone\n @config[\"config\"][\"phone\"] = {}\n if @args.empty?\n box(\"You will now need to register a Twilio account to drive texts/calls from the app, upgrade it past the free trial by providing payment information, and input the account SID and auth token. You can do so #{TTY::Link.link_to(\"here.\", \"http://url.perlmutterapp.com/twilio\")}\")\n phone_verified = false\n until phone_verified\n @config[\"config\"][\"phone\"][\"account_sid\"] = @prompt.ask(prompt_box(\"What is your Twilio account SID?\"), required: true)\n @config[\"config\"][\"phone\"][\"auth_token\"] = @prompt.ask(prompt_box(\"What is your Twilio auth token?\"), required: true)\n phone_verified = verify_phone\n end\n else\n @config[\"config\"][\"phone\"][\"account_sid\"] = get_argument_value(\"account_sid\", true, nil)\n @config[\"config\"][\"phone\"][\"auth_token\"] = get_argument_value(\"auth_token\", true, nil)\n phone_verified = verify_phone\n unless phone_verified\n raise ArgumentError\n end\n end\nend",
"def voice_price_post_with_http_info(voice_messages, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VoiceApi.voice_price_post ...'\n end\n # verify the required parameter 'voice_messages' is set\n if @api_client.config.client_side_validation && voice_messages.nil?\n fail ArgumentError, \"Missing the required parameter 'voice_messages' when calling VoiceApi.voice_price_post\"\n end\n # resource path\n local_var_path = '/voice/price'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(voice_messages)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VoiceApi#voice_price_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def make_request(url)\n res = Typhoeus::Request.new(\n url,\n method: :get,\n headers: {\n \"Accept-Charset\": \"application/x-www-form-urlencoded; charset=UTF-8\",\n \"Accept-Language\" => \"en-US,en;q=0.9,pt;q=0.8\",\n \"X-Riot-Token\" => @api_key.to_s,\n \"User-Agent\": \"https://github.com/drish/rioter\"\n }\n ).run\n parse!(res)\n end",
"def voice(nick)\n change_permissions(:voice, nick)\n end",
"def sms\n account_sid = <your account sid>\n auth_token = <your auth token>\n client = Twilio::REST::Client.new(account_sid, auth_token)\n\n client.messages.create(\n from: <twilio number>,\n to: <your number>,\n body: @message\n )\nend",
"def sms\n # Give Twilio the TwiML payload instructions\n twiml_payload\n end",
"def enable\n {\n method: \"WebAudio.enable\"\n }\n end",
"def play(params)\n path = @version + '/Call/Play/'\n method = 'POST'\n return request(path, method, params)\n end",
"def send_text(sms, phones)\n phones.each do |phone|\n post_response = Faraday.post do |request|\n request.url \"https://api.twilio.com/2010-04-01/Accounts/#{ACCOUNT_SID}/SMS/Messages.json\"\n request.headers['Authorization'] = \"Basic \" + Base64.strict_encode64(\"#{ACCOUNT_SID}:#{AUTH_TOKEN}\")\n request.body = URI.encode_www_form({'From' => PHONE_NUMBER, 'To' => phone.phone_number, 'Body' => sms.message})\n end\n end\n end",
"def speech; end",
"def phone_link_to(number, options={})\n defaults = {:service => :skype}\n options = defaults.merge(options).symbolize_keys\n\n # link_to(\"test\", \"callto://#{number.to_s}\")\n content_tag(:a, number, :href => \"callto:#{number}\" )\n end",
"def triage_select\n case params['Digits']\n when '*'\n @phone_call.miss! 'after_hours'\n render action: :goodbye, formats: [:xml]\n return\n when '1'\n @phone_call.transfer! Member.robot\n @phone_call.miss! 'after_hours'\n @nurseline_phone_call = @phone_call.transferred_to_phone_call\n render action: :transfer_nurse, formats: [:xml]\n return\n end\n\n redirect_to action: :triage_menu, id: @phone_call.id\n end",
"def voice_receipts_post_with_http_info(url, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VoiceApi.voice_receipts_post ...'\n end\n # verify the required parameter 'url' is set\n if @api_client.config.client_side_validation && url.nil?\n fail ArgumentError, \"Missing the required parameter 'url' when calling VoiceApi.voice_receipts_post\"\n end\n # resource path\n local_var_path = '/voice/receipts'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(url)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'String')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VoiceApi#voice_receipts_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def to_s\n '#<Twilio::REST::Voice>'\n end",
"def send_twilio_mms\n # Get your Account Sid and Auth Token from twilio.com/user/account\n\n account_sid = 'add your account sid'\n auth_token = 'add your auth token'\n\n # set up a client to talk to the Twilio REST API\n client = Twilio::REST::Client.new account_sid, auth_token\n\n\n mms_message_body = \"name:#{self.contact.name}\"\n mms_message_body += \"\" #quick way to create spacing inbetween txt lines\n mms_message_body += \"phone: #{self.contact.phone_number}\"\n mms_message_body += \"\" #quick way to create spacing inbetween txt lines\n mms_message_body += \"#{self.message}\"\n end",
"def twilio_text\n \n @twilio_number = ENV['TWILIO_NUMBER']\n @client = Twilio::REST::Client.new ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN']\n time_str = self.time\n content = \"#{self.content} Sent from the Twilio App. Please do not reply\"\n message = @client.account.messages.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :body => content\n )\n puts message\n end",
"def send_voice(channel, *users)\n send_multiple_mode(channel, '+', 'v', users)\n end",
"def get_voice_languages\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/voice/lang'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def set_variant\n # request.variant = :phone if request.user_agent.include?('iPhone')\n # o con la gema browser\n request.variant = :phone if browser.device.mobile?\n end",
"def speak_into(msg)\n require 'net/http'\n channel = \"/0001\"\n\n message = {:channel => channel, :data => msg}\n uri = URI.parse(\"http://localhost:#{FAYE_PORT}/faye\")\n begin\n Net::HTTP.post_form(uri, :message => message.to_json)\n rescue Exception => e\n $stderr.puts \"failed to send message to faye server and thus webclient\"\n $stderr.puts e.message\n return false\n end\n true\n end",
"def connection_gather\n active_connection = Ivr::Connection.find(params[:connection_id])\n active_connection.update(status_from_user: Ivr::Connection::USER_RESPONSE_CODES[params['Digits']])\n response = Twilio::TwiML::Response.new do |r|\n if active_call.finished_loop? || active_call.next_target.nil?\n close_call(r)\n else\n r.Play AudioFileFetcher.encouraging_audio_for_count(active_call.encouraging_count)\n ready_for_connection?(r)\n close_call(r)\n end\n end\n\n render_twiml response\n end",
"def send_sms\n Sms.send_sms(session[:zeepusername], params[:sendmsg][:messagebody])\n \n @zeep_response = \"Message sent to #{session[:zeepusername]}!\"\n \n render :action => \"testloop\"\n \n end"
] |
[
"0.6941941",
"0.685278",
"0.671485",
"0.6287461",
"0.62238187",
"0.62175095",
"0.6157951",
"0.6140277",
"0.6009408",
"0.5933411",
"0.59127563",
"0.5902672",
"0.58733183",
"0.5809024",
"0.57945144",
"0.5780976",
"0.5671255",
"0.56499344",
"0.56469446",
"0.5625455",
"0.55781907",
"0.55650747",
"0.5561758",
"0.55198914",
"0.5516945",
"0.55107886",
"0.54959893",
"0.5492711",
"0.5476899",
"0.54606485",
"0.5460169",
"0.54575956",
"0.54531777",
"0.54220724",
"0.54096556",
"0.54054606",
"0.5401766",
"0.5396772",
"0.53703",
"0.535042",
"0.53442025",
"0.5306238",
"0.52971417",
"0.52947384",
"0.528985",
"0.5284569",
"0.5248711",
"0.5244482",
"0.5239346",
"0.52234536",
"0.52225107",
"0.5214428",
"0.5214125",
"0.520486",
"0.51902205",
"0.5162408",
"0.5156866",
"0.51513594",
"0.51487243",
"0.51417935",
"0.5135117",
"0.51249605",
"0.51113486",
"0.50918615",
"0.5090189",
"0.5074476",
"0.5070273",
"0.50674087",
"0.5040746",
"0.50395715",
"0.5019824",
"0.50147605",
"0.5013914",
"0.5012845",
"0.5009792",
"0.5000205",
"0.4989169",
"0.49620596",
"0.49619657",
"0.49617624",
"0.49611926",
"0.49584174",
"0.49426445",
"0.4924514",
"0.4923879",
"0.4914758",
"0.4901946",
"0.48958063",
"0.487913",
"0.4878638",
"0.48732656",
"0.4871048",
"0.48704624",
"0.48696953",
"0.48629862",
"0.4859758",
"0.4851238",
"0.4849873",
"0.48410338",
"0.48289207"
] |
0.7038924
|
0
|
Text from the browser:
|
def text
lead = Lead.find(params[:lead_id])
client = Twilio::REST::Client.new
if params[:auto_text] || !params[:body].blank?
client.messages.create(
from: ENV['TWILIO_PHONE_NUMBER'],
to: lead.phone,
body: params[:auto_text] ? custom_message(lead.first_name) : params[:body]
)
flash[:success] = "Text Sent!"
else
flash[:alert] = "NO TEXT SENT"
end
redirect_to "/leads/#{lead.id}/edit"
rescue Twilio::REST::RequestError => error
redirect_to "/leads/#{lead.id}/edit"
flash[:alert] = "NO TEXT SENT - #{error}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def page_text\r\n @web_browser.text\r\n end",
"def page_text\n @web_browser.text\n end",
"def text()\r\n $jssh_socket.send(\"#{BODY_VAR}.textContent;\\n\", 0)\r\n return read_socket().strip\r\n end",
"def text\r\n @driver.at_css('body').text\r\n end",
"def text page\n @client.text page\n end",
"def text\n @text\n end",
"def text\n @text\n end",
"def text\n platform.text\n end",
"def text\n wait\n $browser.find_element(:xpath, @locator).text\n end",
"def getText\n @text\n end",
"def getText\n @text\n end",
"def text\n body.text\n end",
"def text\n xpath(\"/html/body\").inner_text\n end",
"def text\n `$q(#{trident?} ? this.__native__.innerText : this.__native__.textContent)`\n end",
"def get_text\n `#{@element}.textContent`\n end",
"def get_text\n Net::HTTP.get(URI('http://' + url.gsub(/http:\\/\\//,''))).downcase.split(//)#gsub(/[[:[punct]:]:]/, ' ').downcase.gsub(/\\s+/, @@end_token).split(//)\n end",
"def text\n document.text\n end",
"def as_text\n @text\n end",
"def text\n text = \"\"\n\n if html_part\n text = html_part.decode_body.to_s\n @is_text_html = true\n end\n\n if !text.present? && text_part\n text = text_part.decode_body.to_s \n @is_text_html = false\n end\n\n if !text.present?\n text = body.decoded.to_s \n @is_text_html = false\n end\n\n text\n end",
"def text ; view.text ; end",
"def output\n @text\n end",
"def get_text\n return self.text\n end",
"def text\n @peer.text\n end",
"def text\n @body\n end",
"def text\n getvalue\n end",
"def text\n text = @tag_data[:text]\n # convert_newlines_to_br\n text.gsub!(\"\\r\\n\", \"\\n\")\n text.gsub!(\"\\n\", \"\\n\")\n text\n end",
"def text text\n end",
"def text\n\tif @object_id != nil\n\t @text = @selenium.get_text(@object_id)\n\telse\n\t for wait in 1..20 do\n\t\tbegin\n\t\t @text = @selenium.get_text(@locator)\n\t\t break\n\t\trescue => e\n\t\t sleep(0.5)\n\t\tend\n\t end\n\tend\n\treturn @text\n end",
"def body_as_text\n page.driver.html.text\n end",
"def text\n return @text if defined? @text\n\n @text = Henkei.read :text, data\n end",
"def text()\n return @driver.get_sc_core_query_element_text(@handle, @index)\n end",
"def get_text\n raise NotImplementedError\n end",
"def curate_text\n # FIXME: Gonna need to chomp newlines\n @text += self.content[:text][:host_info]\n @text += self.content[:text][:state_info]\n @text += self.content[:text][:alert_ack_url]\n end",
"def result_for_title\r\n result_for_txt.text\r\n end",
"def\n getText\n @text\n end",
"def text\n result_hash['text']\n end",
"def text\n element.text\n end",
"def content\n text\n end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def text; end",
"def display_text(text)\n print(text)\n end",
"def text\n @text.join('')\n end",
"def get_element_text(loc)\n @browser.element(parse_location(loc)).text\n end",
"def text(driver = $focus_driver)\r\n return driver.find_element(self).text\r\n end",
"def text_content\n @_node.getTextContent\n end",
"def text\n self.body\n end",
"def scrape_text\n\n end",
"def extracted_text\n response = Crocodoc.connection.get 'download/text', :uuid => @uuid\n return response.body.split(\"\\f\")\n end",
"def to_s\n text\n end",
"def to_s\n text\n end",
"def open_text\n \"\"\n end",
"def text\n\t\t\t@data[\"extract\"]\n\t\tend",
"def text\n param(-1)\n end",
"def text\n to_s\n end",
"def text\n @text ||= nokoxmlelement.inner_html\n end",
"def text\n return @edit_line.text\n end",
"def inner_text; end",
"def inner_text; end",
"def text\n v=@real.text\n v == \"\" ? nil : v\n end",
"def text\n v=@real.text\n v == \"\" ? nil : v\n end",
"def text(locator)\n find_element(locator).text\n end",
"def get_popup_text()\r\n $jssh_socket.send(\"popuptext;\\n\", 0)\r\n return_value = read_socket()\r\n # reset the variable\r\n $jssh_socket.send(\"popuptext = '';\\n\", 0)\r\n read_socket()\r\n return return_value\r\n end",
"def raw_text\n text = ''\n\n objects = get_objects(get_data(@file))\n objects = decode_objects(objects)\n\n objects.each { |o| text += o[:data] if(o[:data] and is_text_header?(o[:header])) }\n\n text\n end",
"def text\n @tag_data[:text]\n end",
"def text\n @node.inner_text.strip\n end",
"def text\n @value[:text].to_s\n end",
"def get_text(element)\n element.text\n end",
"def to_s\n text\n end",
"def html\n @browser.html()\n end",
"def text\n @grpc.text\n end",
"def text\n attributes.fetch(:text)\n end",
"def text\n attributes.fetch(:text)\n end",
"def text\n attributes.fetch(:text)\n end",
"def to_s\n text\n end",
"def get_body_for_html_display\n text = self.body.strip\n text = CGI.escapeHTML(text)\n text = MySociety::Format.make_clickable(text, :contract => 1)\n text = text.gsub(/\\n/, '<br>')\n return text\n end",
"def text\n wait_for_exists\n @alert.text\n end",
"def text\n lines.join(\"\\n\")\n end",
"def to_s\n @text\n end",
"def print_message_text()\n @renderer.puts(\"Msg: #{@message_to_post.text_for_display}\")\n end",
"def text\n text = [title, abstract].join(\"\\n\")\n\n Misc.fixutf8(text)\n end",
"def getFrameText( frameName = \"\" )\n container = getObjectFrameReference( \"\" , frameName )\n return container.body.innerText\n end",
"def text\n metadata&.dig('event', 'text')\n end",
"def preview_text\n return @preview_text\n end",
"def preview_text\n return @preview_text\n end",
"def to_s\n @text\n end",
"def to_s\n @text\n end",
"def script\n @value[:text]\n end",
"def script\n @value[:text]\n end",
"def getText\n return getProperty('text').to_s\n end"
] |
[
"0.82757133",
"0.8255489",
"0.7434022",
"0.7407637",
"0.71398896",
"0.70645154",
"0.6986736",
"0.6983879",
"0.6983516",
"0.6913855",
"0.6913855",
"0.68931794",
"0.68634737",
"0.67455363",
"0.6712321",
"0.67032033",
"0.66906345",
"0.6684982",
"0.66149116",
"0.65861547",
"0.6585642",
"0.657962",
"0.6549476",
"0.65378195",
"0.6535747",
"0.653439",
"0.65337604",
"0.6533216",
"0.65143996",
"0.65051216",
"0.65007365",
"0.6457871",
"0.6437801",
"0.63833547",
"0.6383035",
"0.63601243",
"0.63598347",
"0.6340581",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63303536",
"0.63272804",
"0.6325437",
"0.6298837",
"0.62959564",
"0.6273502",
"0.6269245",
"0.62621796",
"0.6256295",
"0.625148",
"0.625148",
"0.62379557",
"0.62331754",
"0.6202116",
"0.6199853",
"0.6194837",
"0.6189269",
"0.6180087",
"0.6180087",
"0.61752844",
"0.61752844",
"0.61677927",
"0.61653835",
"0.6162713",
"0.61617434",
"0.61548716",
"0.6140165",
"0.6133723",
"0.6125721",
"0.6116926",
"0.61095273",
"0.61064994",
"0.61064994",
"0.61064994",
"0.6098158",
"0.60931695",
"0.60922575",
"0.6088876",
"0.6068858",
"0.6063103",
"0.6062571",
"0.6059723",
"0.605414",
"0.6050407",
"0.60457754",
"0.60369813",
"0.60369813",
"0.60362464",
"0.60362464",
"0.6030037"
] |
0.0
|
-1
|
GET /users GET /users.json
|
def index
@teams = Team.order(:name)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def list_users\n self.class.get('/users')\n end",
"def users\n get('get_users')\n end",
"def index\n users = User.all\n json_response(users)\n end",
"def show\n @users = User.all\n json_response(@users)\n end",
"def list\r\n users = User.all\r\n render json: users\r\n end",
"def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"def get \n render :json => User.find(params[:id])\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n users = User.all\n render json: { users: users }, status: :ok\n end",
"def index\r\n users = User.all\r\n render json: users\r\n end",
"def users(params = {})\n params.merge!(key: 'users')\n objects_from_response(Code42::User, :get, 'user', params)\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def users(params = {})\n make_get_request('/account/users', params)\n end",
"def index\n users = User.all\n render json: users \n end",
"def index\n user= User.all\n render json: {users:user}\n end",
"def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n json_response(User.all) \n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"def index\n users = User.all \n render json: users \n end",
"def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend",
"def list\n render json: User.all\n end",
"def index\n\t\t@users = User.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @users.map(&:as_json) }\n\t\tend\n\tend",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def user\n render :json=> User.find(params[:id])\n end",
"def index\n\n users = User.all \n render json: users\n\n end",
"def show\n render json: Users.find(params[\"id\"])\n end",
"def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html\n format.json { render json: @users }\n end\n end",
"def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end",
"def index\n \t@users = User.all\n\n respond_to do |format| \n format.json { render json: @users }\n end\n end",
"def list\n get('users')['users']\n end",
"def index\n render ActiveModelSerializers::SerializableResource.new(@users,\n each_serializer: UserSerializer\n ).to_json, status: 200\n end",
"def index\n @users = User.all \n render json: @users, status: :ok \n end",
"def index\n @users = User.all\n logger.debug(\"user index\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n render json: User.all\n end",
"def index\n @users = User.order_by(last_name: :desc)\n if @users\n render json: Oj.dump(json_for(@users, include: ['phones', 'cards'], meta: meta), mode: :compat)\n else\n return head :unauthorized\n end\n end",
"def users(params = {})\n response = get('users/lookup.json', params)\n response.map {|user| Croudia::Object::User.new(user) }\n end",
"def index\n render json: User.all\n end",
"def index\n render json: User.all\n end",
"def show\n user = User.find(params[:id])\n render json: @user\nend",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def list_users(user_id)\n self.class.get(\"/users/#{user_id}\")\n end",
"def index\n @users = User.all(limit: 100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.as_json(user: current_user) }\n end\n end",
"def index\n\t\t@users = User.all\n\n\t\trespond_to do |format|\n\t\t format.html # index.html.erb\n\t\t format.json { render json: @users }\n\t\tend\n\tend",
"def get_users\r\n # Prepare query url.\r\n _path_url = '/users'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n decoded.map { |element| User.from_hash(element) }\r\n end",
"def show\n # When a http GET request to '/users/1' is received, have it show,\n # in json format, user 1's information.\n @id = params[:id]\n @user = User.find(@id)\n render json: @user\n end",
"def show\n user = User.find(params[:id])\n\n render json: user\n end",
"def index \n render json: User.all\n end",
"def index\n @myusers = Myuser.all\n\n render json: @myusers\n end",
"def index\n\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end",
"def list\n response = @client.get(\"/users\")\n response[\"users\"].map {|u| User.new(@client, u) }\n end",
"def index\n @users = User.all\n\n respond_with do |format|\n format.json do\n render json: @users,\n each_serializer: Api::UserSerializer,\n root: 'users'\n end\n end\n end",
"def users\n\t\trespond_with User.all\n\tend",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end"
] |
[
"0.82095146",
"0.78731215",
"0.7858865",
"0.7810778",
"0.78045267",
"0.7676475",
"0.7657986",
"0.7631493",
"0.75824183",
"0.7528372",
"0.74869",
"0.74485946",
"0.7439104",
"0.74374914",
"0.74262154",
"0.7398303",
"0.7398303",
"0.7398303",
"0.7398303",
"0.737529",
"0.7372981",
"0.7369009",
"0.73685193",
"0.7366883",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.735904",
"0.73512685",
"0.7350608",
"0.7350608",
"0.7350608",
"0.7350608",
"0.7350608",
"0.7350608",
"0.7347275",
"0.7343338",
"0.73314357",
"0.7323161",
"0.7322608",
"0.73126465",
"0.72958624",
"0.72747993",
"0.7265046",
"0.72616965",
"0.726037",
"0.72234005",
"0.7219029",
"0.71925837",
"0.7188133",
"0.71872604",
"0.718094",
"0.7171082",
"0.7170757",
"0.71558034",
"0.71549016",
"0.71549016",
"0.71407264",
"0.71345514",
"0.71341175",
"0.7131415",
"0.71309614",
"0.71189266",
"0.7114392",
"0.7112572",
"0.7108232",
"0.70985675",
"0.709542",
"0.709542",
"0.7090595",
"0.7089061",
"0.70887804",
"0.7088026",
"0.7084927",
"0.7084927",
"0.7084927",
"0.7084927",
"0.7084927",
"0.7084927",
"0.7084927",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336",
"0.7081336"
] |
0.0
|
-1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.