Open DanRathbun opened 6 years ago
There is already a is_pro? method on the SketchUp class so I think an is_trial? method suits there too. SketchUp::Licensing is according to its description used for extension licenses.
SketchUp::Licensing
is according to its description used for extension licenses.
Yes, I read this, which is why I wrote Sketchup
OR ..., and why I prefixed the method name with "app_
".
Regardless, the Sketchup::Licensing
module belongs to Trimble and they can change it's description and use to suit the needs of the API. Currently the module has only one method whose name specifically refers to "extension", so it would make sense if an application specific method's name referred to the application.
The biggest reason to put this method in the Sketchup::Licensing
module is so that this method cannot be changed. A frozen module is where things like this belong. (The Sketchup
module is not frozen.)
Somewhere I logged a request to create an is_pro?
method in the frozen Sketchup::Licensing
module and deprecate the old one.
so I think an
is_trial?
method suits there too.
This might cause the need for is_licensed?
(and perhaps an is_expired?
) method as well.
Otherwise for the expired state you need a compound test ...
if !Sketchup::Licensing.app_is_trial? && !Sketchup::Licensing.app_is_licensed?
# expired !
end
And... if a "shop" desktop edition is released, then a Sketchup::Licensing.app_is_shop?
method as well.
Logged as SU-40199
SketchUp Ruby API Issue
(1) Deprecate the
Sketchup::Model#get_product_family
instance method.(2) Create a new
app_trial_state()
module method for the SketchUp application, in either theSketchup
orSketchup::Licensing
modules. The latter is preferred as it is a frozen module.(3) Create clones of the needed trial state constants in the proper module namespace.
(4) If the new method is compatible with the old deprecated one, then the old deprecated one can be made to simply call the new one.
Persons writing code for pre-18 versions can use a rescue modifier thus ...
Historical Note: The
Sketchup::Model#get_product_family
method should never have been an instance method, nor been encapsulated by theSketchup::Model
class.Reference Question Issue: