Class: Falsify::Metafield

Inherits:
Object
  • Object
show all
Defined in:
lib/falsify/models/customer/metafield.rb

Overview

Attaches additional metadata to a shop's resources

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, namespace:, value:, value_type:, description: nil) ⇒ void

Parameters:

  • key (String)
  • namespace (String)
  • value (String, Integer)
  • value_type (String)
  • description (String) (defaults to: nil)


28
29
30
31
32
33
34
# File 'lib/falsify/models/customer/metafield.rb', line 28

def initialize(key:, namespace:, value:, value_type:, description: nil)
  self.key = key
  self.namespace = namespace
  self.value = value
  self.value_type = value_type
  self.description = description
end

Instance Attribute Details

#descriptionString?

Additional information about the metafield (optional)

Returns:

  • (String, nil)


20
21
22
# File 'lib/falsify/models/customer/metafield.rb', line 20

def description
  @description
end

#keyBoolean

An identifier for the metafield (maximum of 30 characters, required)

Returns:

  • (Boolean)


6
7
8
# File 'lib/falsify/models/customer/metafield.rb', line 6

def key
  @key
end

#namespaceString

A container for a set of metadata (maximum of 20 characters, required) Namespaces help distinguish between metadata that you created and metadata created by another individual with a similar namespace.

Returns:

  • (String)


10
11
12
# File 'lib/falsify/models/customer/metafield.rb', line 10

def namespace
  @namespace
end

#valueString, Integer

Information to be stored as metadata (required)

Returns:

  • (String, Integer)


13
14
15
# File 'lib/falsify/models/customer/metafield.rb', line 13

def value
  @value
end

#value_typeString

The value type (required) Valid values: string and integer.

Returns:

  • (String)


17
18
19
# File 'lib/falsify/models/customer/metafield.rb', line 17

def value_type
  @value_type
end