Module: Alf::Viewpoint::ClassMethods
- Included in:
- Alf::Viewpoint
- Defined in:
- lib/alf-viewpoint/alf/viewpoint.rb
Instance Method Summary collapse
- #build(context = {}) ⇒ Object (also: #[])
- #depends(as, *viewpoints) ⇒ Object
- #expects(*viewpoints) ⇒ Object
- #members ⇒ Object
- #metadata ⇒ Object
- #method_added(m) ⇒ Object
- #native(as, native_name = as) ⇒ Object
- #parse(*args, &bl) ⇒ Object
- #parser(connection = nil) ⇒ Object
Instance Method Details
#build(context = {}) ⇒ Object Also known as: []
19 20 21 22 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 19 def build(context = {}) x = self .to_module(context){ include(x) } end |
#depends(as, *viewpoints) ⇒ Object
15 16 17 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 15 def depends(as, *viewpoints) .depends(as => viewpoints) end |
#expects(*viewpoints) ⇒ Object
11 12 13 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 11 def expects(*viewpoints) .expects(viewpoints) end |
#members ⇒ Object
39 40 41 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 39 def members .all_members end |
#metadata ⇒ Object
7 8 9 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 7 def ||= Metadata.new end |
#method_added(m) ⇒ Object
43 44 45 46 47 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 43 def method_added(m) super.tap{ .add_members([m]) if public_method_defined?(m) } end |
#native(as, native_name = as) ⇒ Object
33 34 35 36 37 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 33 def native(as, native_name = as) define_method(as) do Algebra.named_operand(native_name) end end |
#parse(*args, &bl) ⇒ Object
29 30 31 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 29 def parse(*args, &bl) parser.parse(*args, &bl) end |
#parser(connection = nil) ⇒ Object
25 26 27 |
# File 'lib/alf-viewpoint/alf/viewpoint.rb', line 25 def parser(connection = nil) Lang::Lispy.new([ self ], connection) end |