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.



18817
18818
18819
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18817

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18815
18816
18817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18815

def value
  @value
end

Class Method Details

.ALLObject



18837
18838
18839
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18837

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



18822
18823
18824
18825
18826
18827
18828
18829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18822

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



18841
18842
18843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18841

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



18832
18833
18834
18835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18832

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

.organizationObject



18845
18846
18847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18845

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

Instance Method Details

#to_hashObject



18849
18850
18851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18849

def to_hash
  value
end