Module: Mockolate::Parameters::Attributes::Macros::ClassMethods
- Includes:
- Parser
- Defined in:
- lib/mockolate/parameters/attributes/macros.rb
Instance Method Summary collapse
-
#attribute(attr) { ... } ⇒ Object
Handles single attribute which may have constant values.
-
#attributes(*attrs) ⇒ Object
Handles multiple attributes.
Methods included from Parser
Methods included from Types
Instance Method Details
#attribute(attr) { ... } ⇒ Object
Handles single attribute which may have constant values
18 19 20 21 |
# File 'lib/mockolate/parameters/attributes/macros.rb', line 18 def attribute(attr, &block) parse!(attr, &block) # class_variable_get(:@@_public_attributes).merge end |
#attributes(*attrs) ⇒ Object
Handles multiple attributes
25 26 27 28 29 30 31 32 |
# File 'lib/mockolate/parameters/attributes/macros.rb', line 25 def attributes(*attrs) parse!(attrs) # attr.each do |attr| # return parse_hash(attr) if attr.is_a? Hash # parse_symbol # end # class_variable_get(:@@_public_attributes).push *attrs end |