Class: Nem::Model::UnlockedInfo
- Inherits:
-
Object
- Object
- Nem::Model::UnlockedInfo
- Includes:
- Nem::Mixin::Assignable
- Defined in:
- lib/nem/model/unlocked_info.rb
Instance Attribute Summary collapse
-
#max_unlocked ⇒ Object
readonly
Returns the value of attribute max_unlocked.
-
#num_unlocked ⇒ Object
readonly
Returns the value of attribute num_unlocked.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Nem::Mixin::Assignable
Instance Attribute Details
#max_unlocked ⇒ Object (readonly)
Returns the value of attribute max_unlocked.
6 7 8 |
# File 'lib/nem/model/unlocked_info.rb', line 6 def max_unlocked @max_unlocked end |
#num_unlocked ⇒ Object (readonly)
Returns the value of attribute num_unlocked.
6 7 8 |
# File 'lib/nem/model/unlocked_info.rb', line 6 def num_unlocked @num_unlocked end |
Class Method Details
.new_from_unlocked_info(hash) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/nem/model/unlocked_info.rb', line 8 def self.new_from_unlocked_info(hash) new( max_unlocked: hash[:'max-unlocked'], num_unlocked: hash[:'num-unlocked'] ) end |
Instance Method Details
#freeslot ⇒ Object
19 20 21 |
# File 'lib/nem/model/unlocked_info.rb', line 19 def freeslot @max_unlocked - @num_unlocked end |
#has_freeslot? ⇒ Boolean
15 16 17 |
# File 'lib/nem/model/unlocked_info.rb', line 15 def has_freeslot? ! @max_unlocked == @num_unlocked end |