Class: Google::Apis::SheetsV4::NumberFormat

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/sheets_v4/classes.rb,
generated/google/apis/sheets_v4/representations.rb,
generated/google/apis/sheets_v4/representations.rb

Overview

The number format of a cell.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ NumberFormat

Returns a new instance of NumberFormat



2112
2113
2114
# File 'generated/google/apis/sheets_v4/classes.rb', line 2112

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#patternString

Pattern string used for formatting. If not set, a default pattern based on the user's locale will be used if necessary for the given type. See the Date and Number Formats guide for more information about the supported patterns. Corresponds to the JSON property pattern

Returns:

  • (String)


2110
2111
2112
# File 'generated/google/apis/sheets_v4/classes.rb', line 2110

def pattern
  @pattern
end

#typeString

The type of the number format. When writing, this field must be set. Corresponds to the JSON property type

Returns:

  • (String)


2102
2103
2104
# File 'generated/google/apis/sheets_v4/classes.rb', line 2102

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2117
2118
2119
2120
# File 'generated/google/apis/sheets_v4/classes.rb', line 2117

def update!(**args)
  @type = args[:type] if args.key?(:type)
  @pattern = args[:pattern] if args.key?(:pattern)
end