Class: Betterdocs::Dsl::Result::CollectionProperty

Inherits:
Property show all
Defined in:
lib/betterdocs/dsl/result/collection_property.rb

Instance Attribute Summary

Attributes included from Naming

#options

Attributes inherited from Betterdocs::Dsl::Representer

#name, #representer

Instance Method Summary collapse

Methods inherited from Property

#actual_property_name, #add_to_collector, #assign, #initialize, #sanitizer, #sub_representer?

Methods included from Naming

#below_path, #full_name, #initialize, #nesting_name, #path, #public_name

Methods included from Common

#set_context

Methods inherited from Betterdocs::Dsl::Representer

#add_to_collector, #assign, #assign?, #initialize

Constructor Details

This class inherits a constructor from Betterdocs::Dsl::Result::Property

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Betterdocs::Dsl::Common

Instance Method Details

#compute_value(object) ⇒ Object



4
5
6
7
8
# File 'lib/betterdocs/dsl/result/collection_property.rb', line 4

def compute_value(object)
  object.__send__(name).to_a.compact.map do |v|
    represent_with.hashify(v)
  end
end