Class: Io::Flow::V0::Models::InvitationErrorCode

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) ⇒ InvitationErrorCode

Returns a new instance of InvitationErrorCode.



8313
8314
8315
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8313

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8311
8312
8313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8311

def value
  @value
end

Class Method Details

.ALLObject



8333
8334
8335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8333

def InvitationErrorCode.ALL
  @@all ||= [InvitationErrorCode.expired, InvitationErrorCode.invalid_email]
end

.apply(value) ⇒ Object

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



8318
8319
8320
8321
8322
8323
8324
8325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8318

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

.expiredObject



8337
8338
8339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8337

def InvitationErrorCode.expired
  @@_expired ||= InvitationErrorCode.new('expired')
end

.from_string(value) ⇒ Object

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



8328
8329
8330
8331
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8328

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

.invalid_emailObject



8341
8342
8343
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8341

def InvitationErrorCode.invalid_email
  @@_invalid_email ||= InvitationErrorCode.new('invalid_email')
end

Instance Method Details

#to_hashObject



8345
8346
8347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8345

def to_hash
  value
end