Skip to content

Commit bca6079

Browse files
committed
Add the new feature about removing characters on TextProcessingController.
1 parent d585beb commit bca6079

12 files changed

+953
-5
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/24.9)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/24.10)
22

33

44
Aspose.Cells Cloud for Ruby enables you to handle various aspects of Excel files, including cell data, styles, formulas, charts, pivot tables, data validation, comments, drawing objects, images, hyperlinks, and so on. Additionally, it supports operations such as splitting, merging, repairing, and converting to other compatible file formats.
@@ -22,12 +22,12 @@ Enhance your Ruby applications with the [Aspose.Cells Cloud](https://products.as
2222
- Security Management: Offers a range of security features like data encryption, access control, and permission management to safeguard the security and integrity of spreadsheet data.
2323

2424

25-
## Feature & Enhancements in Version 24.9
25+
## Feature & Enhancements in Version 24.10
2626

2727
Full list of issues covering all changes in this release:
2828

29-
- Add word case function for TextProcessingController.
30-
- Support to export Worksheet to HTML with cell address or id.
29+
- Add the new feature about removing characters on TextProcessingController.
30+
3131

3232
## Support file format
3333

@@ -126,6 +126,11 @@ request = AsposeCellsCloud::PutConvertWorkbookRequest.new(:File=>mapFiles,:for
126126

127127
# Release history version
128128

129+
## Enhancements in Version 24.9
130+
131+
- Add word case function for TextProcessingController.
132+
- Support to export Worksheet to HTML with cell address or id.
133+
129134
## Enhancements in Version 24.8
130135

131136
- Add text trim feature on Cells Cloud Services.

docs/PostRemoveCharactersRequest.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AsposeCellsCloud::Request::PostRemoveCharacters
2+
3+
## Load the model package
4+
```perl
5+
use AsposeCellsCloud::Request::PostRemoveCharacters;
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**remove_characters_options** | **RemoveCharactersOptions** | |
12+
13+
[[Back to Model list]](../README.md#documentation-for-requests) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+

docs/RemoveCharactersByCharacter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AsposeCellsCloud::Object::RemoveCharactersByCharacter
2+
3+
## Load the model package
4+
```perl
5+
use AsposeCellsCloud::Object::RemoveCharactersByCharacter;
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**RemoveTextMethod** | **string** | |
12+
**RemoveCharacters** | **ARRAY[string]** | |
13+
**RemoveCharacterSetsType** | **string** | |
14+
15+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
16+

docs/RemoveCharactersByPosition.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AsposeCellsCloud::Object::RemoveCharactersByPosition
2+
3+
## Load the model package
4+
```perl
5+
use AsposeCellsCloud::Object::RemoveCharactersByPosition;
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**TheFirstNCharacters** | **int** | |
12+
**TheLastNCharacters** | **int** | |
13+
**AllCharactersBeforeText** | **string** | |
14+
**AllCharactersAfterText** | **string** | |
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+

docs/RemoveCharactersOptions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AsposeCellsCloud::Object::RemoveCharactersOptions
2+
3+
## Load the model package
4+
```perl
5+
use AsposeCellsCloud::Object::RemoveCharactersOptions;
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**Name** | **string** | |
12+
**DataSource** | **DataSource** | |
13+
**FileInfo** | **FileInfo** | |
14+
**Worksheet** | **string** | |
15+
**Range** | **string** | |
16+
**RemoveCharactersByCharacter** | **RemoveCharactersByCharacter** | |
17+
**RemoveCharactersByPosition** | **RemoveCharactersByPosition** | |
18+
19+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
20+

lib/aspose_cells_cloud.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@
351351
require 'aspose_cells_cloud/models/pivot_tables'
352352
require 'aspose_cells_cloud/models/add_text_options'
353353
require 'aspose_cells_cloud/models/base_operate_options'
354+
require 'aspose_cells_cloud/models/remove_characters_by_character'
355+
require 'aspose_cells_cloud/models/remove_characters_by_position'
356+
require 'aspose_cells_cloud/models/remove_characters_options'
354357
require 'aspose_cells_cloud/models/scope_item'
355358
require 'aspose_cells_cloud/models/scope_options'
356359
require 'aspose_cells_cloud/models/trim_content_options'
@@ -706,6 +709,7 @@
706709
require 'aspose_cells_cloud/requests/post_add_text_content_request'
707710
require 'aspose_cells_cloud/requests/post_trim_content_request'
708711
require 'aspose_cells_cloud/requests/post_update_word_case_request'
712+
require 'aspose_cells_cloud/requests/post_remove_characters_request'
709713
require 'aspose_cells_cloud/requests/get_workbook_default_style_request'
710714
require 'aspose_cells_cloud/requests/get_workbook_text_items_request'
711715
require 'aspose_cells_cloud/requests/get_workbook_names_request'

lib/aspose_cells_cloud/api/cells_api.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,13 @@ def post_update_word_case( post_update_word_case_request, opts = {})
20942094
return data
20952095
end
20962096

2097+
2098+
def post_remove_characters( post_remove_characters_request, opts = {})
2099+
2100+
data, _status_code, _headers = post_remove_characters_request.create_http_request(@api_client,opts )
2101+
return data
2102+
end
2103+
20972104
# Retrieve the description of the default style for the workbook .
20982105

20992106
def get_workbook_default_style( get_workbook_default_style_request, opts = {})
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
=begin
2+
--------------------------------------------------------------------------------------------------------------------
3+
<copyright company="Aspose" file="RemoveCharactersByCharacterrb.cs">
4+
Copyright (c) 2024 Aspose.Cells Cloud
5+
</copyright>
6+
<summary>
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
</summary>
25+
--------------------------------------------------------------------------------------------------------------------
26+
=end
27+
28+
29+
require 'date'
30+
31+
module AsposeCellsCloud
32+
33+
class RemoveCharactersByCharacter
34+
#
35+
attr_accessor :remove_text_method
36+
#
37+
attr_accessor :remove_characters
38+
#
39+
attr_accessor :remove_character_sets_type
40+
41+
# Attribute mapping from ruby-style variable name to JSON key.
42+
def self.attribute_map
43+
{
44+
:'remove_text_method' => :'RemoveTextMethod',
45+
:'remove_characters' => :'RemoveCharacters',
46+
:'remove_character_sets_type' => :'RemoveCharacterSetsType'
47+
}
48+
end
49+
50+
# Attribute type mapping.
51+
def self.swagger_types
52+
{
53+
:'remove_text_method' => :'String',
54+
:'remove_characters' => :'Array<String>',
55+
:'remove_character_sets_type' => :'String'
56+
}
57+
end
58+
59+
# Initializes the object
60+
# @param [Hash] attributes Model attributes in the form of hash
61+
def initialize(attributes = {})
62+
return unless attributes.is_a?(Hash)
63+
64+
# convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66+
67+
if attributes.has_key?(:'RemoveTextMethod')
68+
self.remove_text_method = attributes[:'RemoveTextMethod']
69+
end
70+
if attributes.has_key?(:'RemoveCharacters')
71+
self.remove_characters = attributes[:'RemoveCharacters']
72+
end
73+
if attributes.has_key?(:'RemoveCharacterSetsType')
74+
self.remove_character_sets_type = attributes[:'RemoveCharacterSetsType']
75+
end
76+
77+
end
78+
79+
# Show invalid properties with the reasons. Usually used together with valid?
80+
# @return Array for valid properies with the reasons
81+
def list_invalid_properties
82+
invalid_properties = Array.new
83+
if @remove_text_method.nil?
84+
invalid_properties.push("invalid value for 'remove_text_method', remove_text_method cannot be nil.")
85+
end
86+
if @remove_characters.nil?
87+
invalid_properties.push("invalid value for 'remove_characters', remove_characters cannot be nil.")
88+
end
89+
if @remove_character_sets_type.nil?
90+
invalid_properties.push("invalid value for 'remove_character_sets_type', remove_character_sets_type cannot be nil.")
91+
end
92+
93+
return invalid_properties
94+
end
95+
96+
# Check to see if the all the properties in the model are valid
97+
# @return true if the model is valid
98+
def valid?
99+
return false if @remove_text_method.nil?
100+
return false if @remove_characters.nil?
101+
return false if @remove_character_sets_type.nil?
102+
return true
103+
end
104+
105+
# Checks equality by comparing each attribute.
106+
# @param [Object] Object to be compared
107+
def ==(o)
108+
return true if self.equal?(o)
109+
self.class == o.class &&
110+
remove_text_method == o.remove_text_method &&
111+
remove_characters == o.remove_characters &&
112+
remove_character_sets_type == o.remove_character_sets_type
113+
std_dev == o.std_dev
114+
end
115+
116+
# @see the `==` method
117+
# @param [Object] Object to be compared
118+
def eql?(o)
119+
self == o
120+
end
121+
122+
# Calculates hash code according to all attributes.
123+
# @return [Fixnum] Hash code
124+
def hash
125+
[ remove_text_method , remove_characters , remove_character_sets_type ].hash
126+
end
127+
128+
# Builds the object from hash
129+
# @param [Hash] attributes Model attributes in the form of hash
130+
# @return [Object] Returns the model itself
131+
def build_from_hash(attributes)
132+
return nil unless attributes.is_a?(Hash)
133+
self.class.swagger_types.each_pair do |key, type|
134+
if type =~ /\AArray<(.*)>/i
135+
# check to ensure the input is an array given that the the attribute
136+
# is documented as an array but the input is not
137+
if attributes[self.class.attribute_map[key]].is_a?(Array)
138+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
139+
end
140+
elsif !attributes[self.class.attribute_map[key]].nil?
141+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142+
end # or else data not found in attributes(hash), not an issue as the data can be optional
143+
end
144+
145+
self
146+
end
147+
148+
# Deserializes the data based on type
149+
# @param string type Data type
150+
# @param string value Value to be deserialized
151+
# @return [Object] Deserialized data
152+
def _deserialize(type, value)
153+
case type.to_sym
154+
when :DateTime
155+
DateTime.parse(value)
156+
when :Date
157+
Date.parse(value)
158+
when :String
159+
value.to_s
160+
when :Integer
161+
value.to_i
162+
when :Float
163+
value.to_f
164+
when :BOOLEAN
165+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166+
true
167+
else
168+
false
169+
end
170+
when :Object
171+
# generic object (usually a Hash), return directly
172+
value
173+
when /\AArray<(?<inner_type>.+)>\z/
174+
inner_type = Regexp.last_match[:inner_type]
175+
value.map { |v| _deserialize(inner_type, v) }
176+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177+
k_type = Regexp.last_match[:k_type]
178+
v_type = Regexp.last_match[:v_type]
179+
{}.tap do |hash|
180+
value.each do |k, v|
181+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182+
end
183+
end
184+
else # model
185+
temp_model = AsposeCellsCloud.const_get(type).new
186+
temp_model.build_from_hash(value)
187+
end
188+
end
189+
190+
# Returns the string representation of the object
191+
# @return [String] String presentation of the object
192+
def to_s
193+
to_hash.to_s
194+
end
195+
196+
# to_body is an alias to to_hash (backward compatibility)
197+
# @return [Hash] Returns the object in the form of hash
198+
def to_body
199+
to_hash
200+
end
201+
202+
# Returns the object in the form of hash
203+
# @return [Hash] Returns the object in the form of hash
204+
def to_hash
205+
hash = {}
206+
self.class.attribute_map.each_pair do |attr, param|
207+
value = self.send(attr)
208+
next if value.nil?
209+
hash[param] = _to_hash(value)
210+
end
211+
hash
212+
end
213+
214+
# Outputs non-array value in the form of hash
215+
# For object, use to_hash. Otherwise, just return the value
216+
# @param [Object] value Any valid value
217+
# @return [Hash] Returns the value in the form of hash
218+
def _to_hash(value)
219+
if value.is_a?(Array)
220+
value.compact.map{ |v| _to_hash(v) }
221+
elsif value.is_a?(Hash)
222+
{}.tap do |hash|
223+
value.each { |k, v| hash[k] = _to_hash(v) }
224+
end
225+
elsif value.respond_to? :to_hash
226+
value.to_hash
227+
else
228+
value
229+
end
230+
end
231+
232+
end
233+
234+
end

0 commit comments

Comments
 (0)