Class: AsposeCellsCloud::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_cells_cloud/models/line.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Line

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/aspose_cells_cloud/models/line.rb', line 119

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'Style')
    self.style = attributes[:'Style']
  end

  if attributes.has_key?(:'IsAuto')
    self.is_auto = attributes[:'IsAuto']
  end

  if attributes.has_key?(:'BeginArrowLength')
    self.begin_arrow_length = attributes[:'BeginArrowLength']
  end

  if attributes.has_key?(:'Weight')
    self.weight = attributes[:'Weight']
  end

  if attributes.has_key?(:'GradientFill')
    self.gradient_fill = attributes[:'GradientFill']
  end

  if attributes.has_key?(:'Color')
    self.color = attributes[:'Color']
  end

  if attributes.has_key?(:'CompoundType')
    self.compound_type = attributes[:'CompoundType']
  end

  if attributes.has_key?(:'WeightPt')
    self.weight_pt = attributes[:'WeightPt']
  end

  if attributes.has_key?(:'IsVisible')
    self.is_visible = attributes[:'IsVisible']
  end

  if attributes.has_key?(:'JoinType')
    self.join_type = attributes[:'JoinType']
  end

  if attributes.has_key?(:'EndArrowLength')
    self.end_arrow_length = attributes[:'EndArrowLength']
  end

  if attributes.has_key?(:'IsAutomaticColor')
    self.is_automatic_color = attributes[:'IsAutomaticColor']
  end

  if attributes.has_key?(:'DashType')
    self.dash_type = attributes[:'DashType']
  end

  if attributes.has_key?(:'BeginType')
    self.begin_type = attributes[:'BeginType']
  end

  if attributes.has_key?(:'CapType')
    self.cap_type = attributes[:'CapType']
  end

  if attributes.has_key?(:'EndType')
    self.end_type = attributes[:'EndType']
  end

  if attributes.has_key?(:'BeginArrowWidth')
    self.begin_arrow_width = attributes[:'BeginArrowWidth']
  end

  if attributes.has_key?(:'EndArrowWidth')
    self.end_arrow_width = attributes[:'EndArrowWidth']
  end

  if attributes.has_key?(:'Transparency')
    self.transparency = attributes[:'Transparency']
  end

end

Instance Attribute Details

#begin_arrow_lengthObject

Returns the value of attribute begin_arrow_length.



32
33
34
# File 'lib/aspose_cells_cloud/models/line.rb', line 32

def begin_arrow_length
  @begin_arrow_length
end

#begin_arrow_widthObject

Returns the value of attribute begin_arrow_width.



60
61
62
# File 'lib/aspose_cells_cloud/models/line.rb', line 60

def begin_arrow_width
  @begin_arrow_width
end

#begin_typeObject

Returns the value of attribute begin_type.



54
55
56
# File 'lib/aspose_cells_cloud/models/line.rb', line 54

def begin_type
  @begin_type
end

#cap_typeObject

Returns the value of attribute cap_type.



56
57
58
# File 'lib/aspose_cells_cloud/models/line.rb', line 56

def cap_type
  @cap_type
end

#colorObject

Returns the value of attribute color.



38
39
40
# File 'lib/aspose_cells_cloud/models/line.rb', line 38

def color
  @color
end

#compound_typeObject

Returns the value of attribute compound_type.



40
41
42
# File 'lib/aspose_cells_cloud/models/line.rb', line 40

def compound_type
  @compound_type
end

#dash_typeObject

Returns the value of attribute dash_type.



52
53
54
# File 'lib/aspose_cells_cloud/models/line.rb', line 52

def dash_type
  @dash_type
end

#end_arrow_lengthObject

Returns the value of attribute end_arrow_length.



48
49
50
# File 'lib/aspose_cells_cloud/models/line.rb', line 48

def end_arrow_length
  @end_arrow_length
end

#end_arrow_widthObject

Returns the value of attribute end_arrow_width.



62
63
64
# File 'lib/aspose_cells_cloud/models/line.rb', line 62

def end_arrow_width
  @end_arrow_width
end

#end_typeObject

Returns the value of attribute end_type.



58
59
60
# File 'lib/aspose_cells_cloud/models/line.rb', line 58

def end_type
  @end_type
end

#gradient_fillObject

Returns the value of attribute gradient_fill.



36
37
38
# File 'lib/aspose_cells_cloud/models/line.rb', line 36

def gradient_fill
  @gradient_fill
end

#is_autoObject

Returns the value of attribute is_auto.



30
31
32
# File 'lib/aspose_cells_cloud/models/line.rb', line 30

def is_auto
  @is_auto
end

#is_automatic_colorObject

Returns the value of attribute is_automatic_color.



50
51
52
# File 'lib/aspose_cells_cloud/models/line.rb', line 50

def is_automatic_color
  @is_automatic_color
end

#is_visibleObject

Returns the value of attribute is_visible.



44
45
46
# File 'lib/aspose_cells_cloud/models/line.rb', line 44

def is_visible
  @is_visible
end

#join_typeObject

Returns the value of attribute join_type.



46
47
48
# File 'lib/aspose_cells_cloud/models/line.rb', line 46

def join_type
  @join_type
end

#styleObject

Returns the value of attribute style.



28
29
30
# File 'lib/aspose_cells_cloud/models/line.rb', line 28

def style
  @style
end

#transparencyObject

Returns the value of attribute transparency.



64
65
66
# File 'lib/aspose_cells_cloud/models/line.rb', line 64

def transparency
  @transparency
end

#weightObject

Returns the value of attribute weight.



34
35
36
# File 'lib/aspose_cells_cloud/models/line.rb', line 34

def weight
  @weight
end

#weight_ptObject

Returns the value of attribute weight_pt.



42
43
44
# File 'lib/aspose_cells_cloud/models/line.rb', line 42

def weight_pt
  @weight_pt
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/aspose_cells_cloud/models/line.rb', line 68

def self.attribute_map
  {
    :'style' => :'Style',
    :'is_auto' => :'IsAuto',
    :'begin_arrow_length' => :'BeginArrowLength',
    :'weight' => :'Weight',
    :'gradient_fill' => :'GradientFill',
    :'color' => :'Color',
    :'compound_type' => :'CompoundType',
    :'weight_pt' => :'WeightPt',
    :'is_visible' => :'IsVisible',
    :'join_type' => :'JoinType',
    :'end_arrow_length' => :'EndArrowLength',
    :'is_automatic_color' => :'IsAutomaticColor',
    :'dash_type' => :'DashType',
    :'begin_type' => :'BeginType',
    :'cap_type' => :'CapType',
    :'end_type' => :'EndType',
    :'begin_arrow_width' => :'BeginArrowWidth',
    :'end_arrow_width' => :'EndArrowWidth',
    :'transparency' => :'Transparency'
  }
end

.swagger_typesObject

Attribute type mapping.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/aspose_cells_cloud/models/line.rb', line 93

def self.swagger_types
  {
    :'style' => :'String',
    :'is_auto' => :'BOOLEAN',
    :'begin_arrow_length' => :'String',
    :'weight' => :'String',
    :'gradient_fill' => :'GradientFill',
    :'color' => :'Color',
    :'compound_type' => :'String',
    :'weight_pt' => :'Float',
    :'is_visible' => :'BOOLEAN',
    :'join_type' => :'String',
    :'end_arrow_length' => :'String',
    :'is_automatic_color' => :'BOOLEAN',
    :'dash_type' => :'String',
    :'begin_type' => :'String',
    :'cap_type' => :'String',
    :'end_type' => :'String',
    :'begin_arrow_width' => :'String',
    :'end_arrow_width' => :'String',
    :'transparency' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/aspose_cells_cloud/models/line.rb', line 218

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      style == o.style &&
      is_auto == o.is_auto &&
      begin_arrow_length == o.begin_arrow_length &&
      weight == o.weight &&
      gradient_fill == o.gradient_fill &&
      color == o.color &&
      compound_type == o.compound_type &&
      weight_pt == o.weight_pt &&
      is_visible == o.is_visible &&
      join_type == o.join_type &&
      end_arrow_length == o.end_arrow_length &&
      is_automatic_color == o.is_automatic_color &&
      dash_type == o.dash_type &&
      begin_type == o.begin_type &&
      cap_type == o.cap_type &&
      end_type == o.end_type &&
      begin_arrow_width == o.begin_arrow_width &&
      end_arrow_width == o.end_arrow_width &&
      transparency == o.transparency
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/aspose_cells_cloud/models/line.rb', line 278

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = AsposeCellsCloud.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/aspose_cells_cloud/models/line.rb', line 344

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/aspose_cells_cloud/models/line.rb', line 257

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


244
245
246
# File 'lib/aspose_cells_cloud/models/line.rb', line 244

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



250
251
252
# File 'lib/aspose_cells_cloud/models/line.rb', line 250

def hash
  [style, is_auto, begin_arrow_length, weight, gradient_fill, color, compound_type, weight_pt, is_visible, join_type, end_arrow_length, is_automatic_color, dash_type, begin_type, cap_type, end_type, begin_arrow_width, end_arrow_width, transparency].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



205
206
207
208
# File 'lib/aspose_cells_cloud/models/line.rb', line 205

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



324
325
326
# File 'lib/aspose_cells_cloud/models/line.rb', line 324

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



330
331
332
333
334
335
336
337
338
# File 'lib/aspose_cells_cloud/models/line.rb', line 330

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



318
319
320
# File 'lib/aspose_cells_cloud/models/line.rb', line 318

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



212
213
214
# File 'lib/aspose_cells_cloud/models/line.rb', line 212

def valid?
  return true
end