Class: AsposeSlidesCloud::LineFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_slides_cloud/models/line_format.rb

Overview

Line format.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LineFormat

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
# File 'lib/aspose_slides_cloud/models/line_format.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?(:'Alignment')
    self.alignment = attributes[:'Alignment']
  end

  if attributes.has_key?(:'CapStyle')
    self.cap_style = attributes[:'CapStyle']
  end

  if attributes.has_key?(:'DashStyle')
    self.dash_style = attributes[:'DashStyle']
  end

  if attributes.has_key?(:'JoinStyle')
    self.join_style = attributes[:'JoinStyle']
  end

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

  if attributes.has_key?(:'BeginArrowHead')
    self.begin_arrow_head = attributes[:'BeginArrowHead']
  end

  if attributes.has_key?(:'EndArrowHead')
    self.end_arrow_head = attributes[:'EndArrowHead']
  end

  if attributes.has_key?(:'CustomDashPattern')
    self.custom_dash_pattern = attributes[:'CustomDashPattern']
  end

  if attributes.has_key?(:'FillFormat')
    self.fill_format = attributes[:'FillFormat']
  end

  if attributes.has_key?(:'MiterLimit')
    self.miter_limit = attributes[:'MiterLimit']
  end

  if attributes.has_key?(:'Width')
    self.width = attributes[:'Width']
  end
end

Instance Attribute Details

#alignmentObject

Alignment.



29
30
31
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 29

def alignment
  @alignment
end

#begin_arrow_headObject

Begin arrowhead.



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

def begin_arrow_head
  @begin_arrow_head
end

#cap_styleObject

Cap style.



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

def cap_style
  @cap_style
end

#custom_dash_patternObject

Custom dash pattern.



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

def custom_dash_pattern
  @custom_dash_pattern
end

#dash_styleObject

Dash style.



35
36
37
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 35

def dash_style
  @dash_style
end

#end_arrow_headObject

End arrowhead.



47
48
49
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 47

def end_arrow_head
  @end_arrow_head
end

#fill_formatObject

Fill format.



53
54
55
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 53

def fill_format
  @fill_format
end

#join_styleObject

Join style.



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

def join_style
  @join_style
end

#miter_limitObject

Miter limit.



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

def miter_limit
  @miter_limit
end

#styleObject

Style.



41
42
43
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 41

def style
  @style
end

#widthObject

Width.



59
60
61
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 59

def width
  @width
end

Class Method Details

.attribute_mapObject

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



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 84

def self.attribute_map
  {
    :'alignment' => :'Alignment',
    :'cap_style' => :'CapStyle',
    :'dash_style' => :'DashStyle',
    :'join_style' => :'JoinStyle',
    :'style' => :'Style',
    :'begin_arrow_head' => :'BeginArrowHead',
    :'end_arrow_head' => :'EndArrowHead',
    :'custom_dash_pattern' => :'CustomDashPattern',
    :'fill_format' => :'FillFormat',
    :'miter_limit' => :'MiterLimit',
    :'width' => :'Width',
  }
end

.swagger_typesObject

Attribute type mapping.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 101

def self.swagger_types
  {
    :'alignment' => :'String',
    :'cap_style' => :'String',
    :'dash_style' => :'String',
    :'join_style' => :'String',
    :'style' => :'String',
    :'begin_arrow_head' => :'ArrowHeadProperties',
    :'end_arrow_head' => :'ArrowHeadProperties',
    :'custom_dash_pattern' => :'CustomDashPattern',
    :'fill_format' => :'FillFormat',
    :'miter_limit' => :'Float',
    :'width' => :'Float',
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 245

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      alignment == o.alignment &&
      cap_style == o.cap_style &&
      dash_style == o.dash_style &&
      join_style == o.join_style &&
      style == o.style &&
      begin_arrow_head == o.begin_arrow_head &&
      end_arrow_head == o.end_arrow_head &&
      custom_dash_pattern == o.custom_dash_pattern &&
      fill_format == o.fill_format &&
      miter_limit == o.miter_limit &&
      width == o.width
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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 309

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 = AsposeSlidesCloud.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



375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 375

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



276
277
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
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 276

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    mapKey = self.class.attribute_map[key]
    if !mapKey.nil?
      val = attributes[mapKey]
      if val.nil?
        mapKeyString = mapKey.to_s
        mapKeyString[0] = mapKeyString[0].downcase
        mapKey = mapKeyString.to_sym
        val = attributes[mapKey]
      end
      if !val.nil?
        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 val.is_a?(Array)
            self.send("#{key}=", val.map { |v| _deserialize($1, v) })
          end
        else
          self.send("#{key}=", _deserialize(type, val))
        end
      end
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


263
264
265
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 263

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



269
270
271
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 269

def hash
  [alignment, cap_style, dash_style, join_style, style, begin_arrow_head, end_arrow_head, custom_dash_pattern, fill_format, miter_limit, width].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



172
173
174
175
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 172

def list_invalid_properties
  invalid_properties = Array.new
  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



355
356
357
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 355

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



361
362
363
364
365
366
367
368
369
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 361

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



349
350
351
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 349

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



179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 179

def valid?
  alignment_validator = EnumAttributeValidator.new('String', ['Center', 'Inset', 'NotDefined'])
  return false unless alignment_validator.valid?(@alignment)
  cap_style_validator = EnumAttributeValidator.new('String', ['Round', 'Square', 'Flat', 'NotDefined'])
  return false unless cap_style_validator.valid?(@cap_style)
  dash_style_validator = EnumAttributeValidator.new('String', ['Solid', 'Dot', 'Dash', 'LargeDash', 'DashDot', 'LargeDashDot', 'LargeDashDotDot', 'SystemDash', 'SystemDot', 'SystemDashDot', 'SystemDashDotDot', 'Custom', 'NotDefined'])
  return false unless dash_style_validator.valid?(@dash_style)
  join_style_validator = EnumAttributeValidator.new('String', ['Round', 'Bevel', 'Miter', 'NotDefined'])
  return false unless join_style_validator.valid?(@join_style)
  style_validator = EnumAttributeValidator.new('String', ['Single', 'ThinThin', 'ThinThick', 'ThickThin', 'ThickBetweenThin', 'NotDefined'])
  return false unless style_validator.valid?(@style)
  true
end