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.



23671
23672
23673
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23671

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23669
23670
23671
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23669

def value
  @value
end

Class Method Details

.ALLObject



23691
23692
23693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23691

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



23676
23677
23678
23679
23680
23681
23682
23683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23676

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



23695
23696
23697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23695

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



23686
23687
23688
23689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23686

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

.organizationObject



23699
23700
23701
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23699

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

Instance Method Details

#to_hashObject



23703
23704
23705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23703

def to_hash
  value
end