Class: Sendowl::License
- Inherits:
-
Object
- Object
- Sendowl::License
- Defined in:
- lib/sendowl/resources/license.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#order_refunded ⇒ Object
readonly
Returns the value of attribute order_refunded.
-
#product_id ⇒ Object
readonly
Returns the value of attribute product_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(product_id:, key:, id: nil, order_id: nil, order_refunded: nil) ⇒ License
constructor
A new instance of License.
- #valid? ⇒ Boolean
Constructor Details
#initialize(product_id:, key:, id: nil, order_id: nil, order_refunded: nil) ⇒ License
Returns a new instance of License.
5 6 7 8 9 10 11 |
# File 'lib/sendowl/resources/license.rb', line 5 def initialize(product_id:, key:, id: nil, order_id: nil, order_refunded: nil) @id = id @order_id = order_id @product_id = product_id @key = key @order_refunded = order_refunded end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/sendowl/resources/license.rb', line 3 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/sendowl/resources/license.rb', line 3 def key @key end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
3 4 5 |
# File 'lib/sendowl/resources/license.rb', line 3 def order_id @order_id end |
#order_refunded ⇒ Object (readonly)
Returns the value of attribute order_refunded.
3 4 5 |
# File 'lib/sendowl/resources/license.rb', line 3 def order_refunded @order_refunded end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
3 4 5 |
# File 'lib/sendowl/resources/license.rb', line 3 def product_id @product_id end |
Class Method Details
.parse(response) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sendowl/resources/license.rb', line 23 def parse(response) case response when Array response.map { |x| parse x } when Hash if response["licenses"] response["licenses"]["invalid_keys"] else new response["license"].transform_keys { |k| k.to_sym } end else response end end |