Class: Io::Flow::V0::Models::RatecardOwner

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

Returns a new instance of RatecardOwner.



18323
18324
18325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18323

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18321
18322
18323
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18321

def value
  @value
end

Class Method Details

.ALLObject



18343
18344
18345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18343

def RatecardOwner.ALL
  @@all ||= [RatecardOwner.flow, RatecardOwner.organization]
end

.apply(value) ⇒ Object

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



18328
18329
18330
18331
18332
18333
18334
18335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18328

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

.flowObject



18347
18348
18349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18347

def RatecardOwner.flow
  @@_flow ||= RatecardOwner.new('flow')
end

.from_string(value) ⇒ Object

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



18338
18339
18340
18341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18338

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

.organizationObject



18351
18352
18353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18351

def RatecardOwner.organization
  @@_organization ||= RatecardOwner.new('organization')
end

Instance Method Details

#to_hashObject



18355
18356
18357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18355

def to_hash
  value
end