Class: AsposeSlidesCloud::LineFormat
- Inherits:
-
Object
- Object
- AsposeSlidesCloud::LineFormat
- Defined in:
- lib/aspose_slides_cloud/models/line_format.rb
Overview
Line format.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#alignment ⇒ Object
Alignment.
-
#begin_arrow_head ⇒ Object
Begin arrowhead.
-
#cap_style ⇒ Object
Cap style.
-
#custom_dash_pattern ⇒ Object
Custom dash pattern.
-
#dash_style ⇒ Object
Dash style.
-
#end_arrow_head ⇒ Object
End arrowhead.
-
#fill_format ⇒ Object
Fill format.
-
#join_style ⇒ Object
Join style.
-
#miter_limit ⇒ Object
Miter limit.
-
#sketch_type ⇒ Object
Sketch type.
-
#style ⇒ Object
Style.
-
#width ⇒ Object
Width.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ LineFormat
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ LineFormat
Initializes the object
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 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 124 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?(:'SketchType') self.sketch_type = attributes[:'SketchType'] 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
#alignment ⇒ Object
Alignment.
29 30 31 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 29 def alignment @alignment end |
#begin_arrow_head ⇒ Object
Begin arrowhead.
47 48 49 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 47 def begin_arrow_head @begin_arrow_head end |
#cap_style ⇒ Object
Cap style.
32 33 34 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 32 def cap_style @cap_style end |
#custom_dash_pattern ⇒ Object
Custom dash pattern.
53 54 55 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 53 def custom_dash_pattern @custom_dash_pattern end |
#dash_style ⇒ Object
Dash style.
35 36 37 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 35 def dash_style @dash_style end |
#end_arrow_head ⇒ Object
End arrowhead.
50 51 52 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 50 def end_arrow_head @end_arrow_head end |
#fill_format ⇒ Object
Fill format.
56 57 58 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 56 def fill_format @fill_format end |
#join_style ⇒ Object
Join style.
38 39 40 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 38 def join_style @join_style end |
#miter_limit ⇒ Object
Miter limit.
59 60 61 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 59 def miter_limit @miter_limit end |
#sketch_type ⇒ Object
Sketch type.
44 45 46 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 44 def sketch_type @sketch_type end |
#style ⇒ Object
Style.
41 42 43 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 41 def style @style end |
#width ⇒ Object
Width.
62 63 64 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 62 def width @width end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 87 def self.attribute_map { :'alignment' => :'Alignment', :'cap_style' => :'CapStyle', :'dash_style' => :'DashStyle', :'join_style' => :'JoinStyle', :'style' => :'Style', :'sketch_type' => :'SketchType', :'begin_arrow_head' => :'BeginArrowHead', :'end_arrow_head' => :'EndArrowHead', :'custom_dash_pattern' => :'CustomDashPattern', :'fill_format' => :'FillFormat', :'miter_limit' => :'MiterLimit', :'width' => :'Width', } end |
.swagger_types ⇒ Object
Attribute type mapping.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 105 def self.swagger_types { :'alignment' => :'String', :'cap_style' => :'String', :'dash_style' => :'String', :'join_style' => :'String', :'style' => :'String', :'sketch_type' => :'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.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 266 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 && sketch_type == o.sketch_type && 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
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 331 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 registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value) if registry_type type = registry_type end 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
401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 401 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
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 298 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
285 286 287 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 285 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
291 292 293 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 291 def hash [alignment, cap_style, dash_style, join_style, style, sketch_type, begin_arrow_head, end_arrow_head, custom_dash_pattern, fill_format, miter_limit, width].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
181 182 183 184 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 181 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
381 382 383 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 381 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
387 388 389 390 391 392 393 394 395 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 387 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_s ⇒ String
Returns the string representation of the object
375 376 377 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 375 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/aspose_slides_cloud/models/line_format.rb', line 188 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) sketch_type_validator = EnumAttributeValidator.new('String', ['None', 'Curved', 'Freehand', 'Scribble', 'NotDefined']) return false unless sketch_type_validator.valid?(@sketch_type) true end |