Well, an array is an Enumerable.


On Tue, Apr 15, 2014 at 10:58 AM, Shea Valentine
<notifications@github.com>wrote:

> In lib/crichton/representor.rb:
>
> > +    def to_hash
> > +      @to_hash ||= @representor_hash
> > +    end
> > +
> > +    # @return [String] the yaml representation of the object
> > +    def to_yaml
> > +      @to_s ||= YAML.dump(@representor_hash)
> > +    end
> > +
> > +    # @return [Hash] the resource attributes inferred from representor[:semantics]
> > +    def attributes
> > +      attributes = @representor_hash[:semantics] || {}
> > +      @attributes ||= Hash[ attributes.map { |k,v| [ k, v[:value]] } ]
> > +    end
> > +
> > +    # @return [Enumerable] who's elements are all <Crichton:Representor> objects
>
> It will be an Enumerable I think.
> The lazy.map should return an enumerable...
> Doing Enumerable.first should give you the first element, and you still
> have an enumerable.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mdsol/crichton-representors/pull/1/files#r11648034>
> .
>