Method: OryClient::CreateSubscriptionCommon#initialize
- Defined in:
- lib/ory-client/models/create_subscription_common.rb
#initialize(attributes = {}) ⇒ CreateSubscriptionCommon
Initializes the object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/ory-client/models/create_subscription_common.rb', line 88 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `OryClient::CreateSubscriptionCommon` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `OryClient::CreateSubscriptionCommon`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'interval') self.interval = attributes[:'interval'] else self.interval = nil end if attributes.key?(:'plan') self.plan = attributes[:'plan'] else self.plan = nil end if attributes.key?(:'return_to') self.return_to = attributes[:'return_to'] end end |