Class: Io::Flow::V0::Models::PriceBookStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PriceBookStatus

Returns a new instance of PriceBookStatus.



19297
19298
19299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19297

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19295
19296
19297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19295

def value
  @value
end

Class Method Details

.ALLObject



19317
19318
19319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19317

def PriceBookStatus.ALL
  @@all ||= [PriceBookStatus.draft, PriceBookStatus.published, PriceBookStatus.archived]
end

.apply(value) ⇒ Object

Returns the instance of PriceBookStatus for this value, creating a new instance for an unknown value



19302
19303
19304
19305
19306
19307
19308
19309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19302

def PriceBookStatus.apply(value)
  if value.instance_of?(PriceBookStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PriceBookStatus.new(value))
  end
end

.archivedObject



19329
19330
19331
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19329

def PriceBookStatus.archived
  @@_archived ||= PriceBookStatus.new('archived')
end

.draftObject



19321
19322
19323
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19321

def PriceBookStatus.draft
  @@_draft ||= PriceBookStatus.new('draft')
end

.from_string(value) ⇒ Object

Returns the instance of PriceBookStatus for this value, or nil if not found



19312
19313
19314
19315
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19312

def PriceBookStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PriceBookStatus.ALL.find { |v| v.value == value }
end

.publishedObject



19325
19326
19327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19325

def PriceBookStatus.published
  @@_published ||= PriceBookStatus.new('published')
end

Instance Method Details

#to_hashObject



19333
19334
19335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19333

def to_hash
  value
end