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.



25160
25161
25162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25160

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25158
25159
25160
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25158

def value
  @value
end

Class Method Details

.ALLObject



25180
25181
25182
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25180

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



25165
25166
25167
25168
25169
25170
25171
25172
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25165

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



25192
25193
25194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25192

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

.draftObject



25184
25185
25186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25184

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



25175
25176
25177
25178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25175

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

.publishedObject



25188
25189
25190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25188

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

Instance Method Details

#to_hashObject



25196
25197
25198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25196

def to_hash
  value
end