Class: YardSequel::AssociationOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/yard-sequel/association_options.rb

Overview

Holds the options of an association macro call and makes them easily accessible.

Instance Method Summary collapse

Constructor Details

#initialize(ast_node_hash) ⇒ AssociationOptions


10
11
12
13
14
15
# File 'lib/yard-sequel/association_options.rb', line 10

def initialize(ast_node_hash)
  @ast_node_hash = {}
  ast_node_hash.each do |name, parameter|
    @ast_node_hash[parse_symbol_node name] = parse_symbol_node parameter
  end
end

Instance Method Details

#[](option_name) ⇒ Yard::Parser::Ruby::AstNode


20
21
22
# File 'lib/yard-sequel/association_options.rb', line 20

def [](option_name)
  @ast_node_hash[option_name]
end