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.



18551
18552
18553
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18551

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18549
18550
18551
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18549

def value
  @value
end

Class Method Details

.ALLObject



18571
18572
18573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18571

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



18556
18557
18558
18559
18560
18561
18562
18563
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18556

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



18575
18576
18577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18575

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



18566
18567
18568
18569
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18566

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

.organizationObject



18579
18580
18581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18579

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

Instance Method Details

#to_hashObject



18583
18584
18585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18583

def to_hash
  value
end