Class: Nem::Model::UnlockedInfo

Inherits:
Object
  • Object
show all
Includes:
Nem::Mixin::Assignable
Defined in:
lib/nem/model/unlocked_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Nem::Mixin::Assignable

#initialize

Instance Attribute Details

#max_unlockedObject (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_unlockedObject (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

#freeslotObject



19
20
21
# File 'lib/nem/model/unlocked_info.rb', line 19

def freeslot
  @max_unlocked - @num_unlocked
end

#has_freeslot?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/nem/model/unlocked_info.rb', line 15

def has_freeslot?
  ! @max_unlocked == @num_unlocked
end