Class: Apkstats::Entity::Permission
- Inherits:
-
Object
- Object
- Apkstats::Entity::Permission
- Defined in:
- lib/apkstats/entity/permission.rb
Instance Attribute Summary collapse
-
#max_sdk ⇒ Object
readonly
String?.
-
#name ⇒ Object
readonly
String.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name, max_sdk: nil) ⇒ Permission
constructor
A new instance of Permission.
- #to_s ⇒ Object
Constructor Details
#initialize(name, max_sdk: nil) ⇒ Permission
Returns a new instance of Permission.
11 12 13 14 |
# File 'lib/apkstats/entity/permission.rb', line 11 def initialize(name, max_sdk: nil) @name = name @max_sdk = max_sdk end |
Instance Attribute Details
#max_sdk ⇒ Object (readonly)
String?
9 10 11 |
# File 'lib/apkstats/entity/permission.rb', line 9 def max_sdk @max_sdk end |
#name ⇒ Object (readonly)
String
6 7 8 |
# File 'lib/apkstats/entity/permission.rb', line 6 def name @name end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 27 28 |
# File 'lib/apkstats/entity/permission.rb', line 24 def ==(other) return if !other || other.class != self.class to_s == other.to_s end |
#eql?(other) ⇒ Boolean
30 31 32 |
# File 'lib/apkstats/entity/permission.rb', line 30 def eql?(other) to_s.eql?(other.to_s) end |
#hash ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/apkstats/entity/permission.rb', line 34 def hash h = name.hash if max_sdk h *= 31 h += max_sdk.hash end h end |
#to_s ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/apkstats/entity/permission.rb', line 16 def to_s if max_sdk "#{name} maxSdkVersion=#{max_sdk}" else name end end |