Class: Maia::Devices
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(models) ⇒ Devices
constructor
A new instance of Devices.
- #tokens ⇒ Object
Constructor Details
#initialize(models) ⇒ Devices
Returns a new instance of Devices.
5 6 7 |
# File 'lib/maia/devices.rb', line 5 def initialize(models) @models = models end |
Instance Method Details
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/maia/devices.rb', line 9 def each(&block) tokens.each(&block) end |
#tokens ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/maia/devices.rb', line 13 def tokens return [] if @models.empty? Maia::Device.owned_by(@models).tokens.map do |token| Maia::Token.new token end end |