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.



22534
22535
22536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22534

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22532
22533
22534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22532

def value
  @value
end

Class Method Details

.ALLObject



22554
22555
22556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22554

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



22539
22540
22541
22542
22543
22544
22545
22546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22539

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



22558
22559
22560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22558

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



22549
22550
22551
22552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22549

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

.organizationObject



22562
22563
22564
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22562

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

Instance Method Details

#to_hashObject



22566
22567
22568
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22566

def to_hash
  value
end