Module: Scorpio::ResourceBase::Container::Array
- Includes:
- Enumerable, JSI::Util::Arraylike
- Defined in:
- lib/scorpio/resource_base.rb
Instance Method Summary collapse
Instance Method Details
#as_json(options = {}) ⇒ Object
589 590 591 |
# File 'lib/scorpio/resource_base.rb', line 589 def as_json( = {}) each_index.map { |i| JSI::Util.as_json(self[i], **) } end |
#each(**kw, &block) ⇒ Object
579 580 581 582 583 |
# File 'lib/scorpio/resource_base.rb', line 579 def each(**kw, &block) return(to_enum(__method__, **kw) { contained_object.size }) unless block contained_object.each_index { |i| yield(self[i, **kw]) } self end |
#to_ary(**kw) ⇒ Object
585 586 587 |
# File 'lib/scorpio/resource_base.rb', line 585 def to_ary(**kw) to_a(**kw) end |