Sha256: 2c4cc64c1abd8d2d10451e703b80531d50949bd073928d790cee38deac375b60

Contents?: true

Size: 1.41 KB

Versions: 13

Compression:

Stored size: 1.41 KB

Contents

class ConfigurableAttributeHandler < YARD::Handlers::Ruby::AttributeHandler
  handles method_call(:attr_configurable_str)
  handles method_call(:attr_configurable_client_beats)
  handles method_call(:attr_configurable_protocols)
  handles method_call(:attr_configurable_pool)
  handles method_call(:attr_configurable_buffer)
  handles method_call(:attr_configurable_int)
  handles method_call(:attr_configurable_bool)
  namespace_only
  
  def process
    name = statement.parameters.first.jump(:symbol, :ident).source[1..-1]
    namespace.attributes[scope][name] ||= SymbolHash[:read => nil, :write => nil]
    namespace.attributes[scope][name][:read] = YARD::CodeObjects::MethodObject.new(namespace, name)
    namespace.attributes[scope][name][:write] = YARD::CodeObjects::MethodObject.new(namespace, "#{name}=")
    register namespace.attributes[scope][name][:read]
    register namespace.attributes[scope][name][:write]
  end
end

class EventMethodsHandler < YARD::Handlers::Ruby::MethodHandler
  handles method_call(:create_event_methods)
  namespace_only
  
  def process
    base_name = statement.parameters.first.jump(:symbol, :ident).source[1..-1]
    statement.parameters[1..-1].each do |pref_sexp|
      if pref_sexp
        pref = pref_sexp.jump(:symbol, :ident).source[1..-1]
        name = "#{pref}_#{base_name}"
        object = YARD::CodeObjects::MethodObject.new(namespace, name)
        register object
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onstomp-1.0.12 yard_extensions.rb
onstomp-1.0.11 yard_extensions.rb
onstomp-1.0.10 yard_extensions.rb
onstomp-1.0.9 yard_extensions.rb
onstomp-1.0.8 yard_extensions.rb
onstomp-1.0.7 yard_extensions.rb
onstomp-1.0.6 yard_extensions.rb
onstomp-1.0.5 yard_extensions.rb
onstomp-1.0.4 yard_extensions.rb
onstomp-1.0.3 yard_extensions.rb
onstomp-1.0.2 yard_extensions.rb
onstomp-1.0.1 yard_extensions.rb
onstomp-1.0.0 yard_extensions.rb