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.



25716
25717
25718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25716

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25714
25715
25716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25714

def value
  @value
end

Class Method Details

.ALLObject



25736
25737
25738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25736

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



25721
25722
25723
25724
25725
25726
25727
25728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25721

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



25740
25741
25742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25740

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



25731
25732
25733
25734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25731

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

.organizationObject



25744
25745
25746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25744

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

Instance Method Details

#to_hashObject



25748
25749
25750
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25748

def to_hash
  value
end