Class: Dusen::Description

Inherits:
Object
  • Object
show all
Defined in:
lib/dusen/description.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(syntax) ⇒ Description

Returns a new instance of Description.



9
10
11
# File 'lib/dusen/description.rb', line 9

def initialize(syntax)
  @syntax = syntax
end

Instance Attribute Details

#syntaxObject (readonly)

Returns the value of attribute syntax.



7
8
9
# File 'lib/dusen/description.rb', line 7

def syntax
  @syntax
end

Class Method Details

.parse_syntax(syntax, &dsl) ⇒ Object



17
18
19
20
21
# File 'lib/dusen/description.rb', line 17

def self.parse_syntax(syntax, &dsl)
  description = new(syntax)
  description.instance_eval(&dsl)
  description.syntax
end

Instance Method Details

#search_by(field, &scoper) ⇒ Object



13
14
15
# File 'lib/dusen/description.rb', line 13

def search_by(field, &scoper)
  @syntax.learn_field(field, &scoper)
end