Sha256: 897c1b54709ef445d8617bb431f45229e96bf257edf8186d5d434adca97d31b3

Contents?: true

Size: 788 Bytes

Versions: 35

Compression:

Stored size: 788 Bytes

Contents

class JsonAttrAccessorHandler < SkrMetaMethodHandler

    namespace_only
    handles method_call(:json_attr_accessor)

    def process

        call_params.each do | method_name |
            method_definition = namespace.instance_attributes[method_name.to_sym] || {}

            { read: method_name, write: "#{method_name}=" }.each do |(rw, name)|
                rw_object = register YARD::CodeObjects::MethodObject.new(namespace, name)
                rw_object.docstring.add_tag YARD::Tags::Tag.new(:return, "Returns the value of attribute #{method_name}", 'Object' )
                rw_object.dynamic = true
                method_definition[rw] = rw_object
            end
            namespace.instance_attributes[method_name.to_sym] = method_definition
        end

    end

end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
hippo-fw-0.9.9 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.8 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.7 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.6 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.5 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.4 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.3 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.2 yard_ext/json_attr_accessor.rb
hippo-fw-0.9.1 yard_ext/json_attr_accessor.rb
lanes-0.8.3 yard_ext/json_attr_accessor.rb
lanes-0.8.2 yard_ext/json_attr_accessor.rb
lanes-0.8.1 yard_ext/json_attr_accessor.rb
lanes-0.8.0 yard_ext/json_attr_accessor.rb
lanes-0.7.0 yard_ext/json_attr_accessor.rb
lanes-0.6.1 yard_ext/json_attr_accessor.rb
lanes-0.6.0 yard_ext/json_attr_accessor.rb
lanes-0.5.6 yard_ext/json_attr_accessor.rb
lanes-0.5.5 yard_ext/json_attr_accessor.rb
lanes-0.5.0 yard_ext/json_attr_accessor.rb
lanes-0.4.0 yard_ext/json_attr_accessor.rb