Class: Atomy::Method::Branch
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#default_arguments ⇒ Object
readonly
Returns the value of attribute default_arguments.
-
#name ⇒ Object
Returns the value of attribute name.
-
#post_arguments ⇒ Object
readonly
Returns the value of attribute post_arguments.
-
#proc_argument ⇒ Object
readonly
Returns the value of attribute proc_argument.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
-
#splat_argument ⇒ Object
readonly
Returns the value of attribute splat_argument.
Instance Method Summary collapse
- #as_method ⇒ Object
- #default_arguments_count ⇒ Object
- #for_method! ⇒ Object
-
#initialize(receiver = nil, arguments = [], default_arguments = [], splat_argument = nil, post_arguments = [], proc_argument = nil, &body) ⇒ Branch
constructor
A new instance of Branch.
- #method? ⇒ Boolean
- #post_arguments_count ⇒ Object
- #pre_arguments_count ⇒ Object
- #splat_index ⇒ Object
Constructor Details
#initialize(receiver = nil, arguments = [], default_arguments = [], splat_argument = nil, post_arguments = [], proc_argument = nil, &body) ⇒ Branch
Returns a new instance of Branch.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/atomy/method.rb', line 40 def initialize(receiver = nil, arguments = [], default_arguments = [], splat_argument = nil, post_arguments = [], proc_argument = nil, &body) @body = body.block @receiver = receiver @arguments = arguments @default_arguments = default_arguments @splat_argument = splat_argument @post_arguments = post_arguments @proc_argument = proc_argument end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def arguments @arguments end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def body @body end |
#default_arguments ⇒ Object (readonly)
Returns the value of attribute default_arguments.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def default_arguments @default_arguments end |
#name ⇒ Object
Returns the value of attribute name.
38 39 40 |
# File 'lib/atomy/method.rb', line 38 def name @name end |
#post_arguments ⇒ Object (readonly)
Returns the value of attribute post_arguments.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def post_arguments @post_arguments end |
#proc_argument ⇒ Object (readonly)
Returns the value of attribute proc_argument.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def proc_argument @proc_argument end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def receiver @receiver end |
#splat_argument ⇒ Object (readonly)
Returns the value of attribute splat_argument.
35 36 37 |
# File 'lib/atomy/method.rb', line 35 def splat_argument @splat_argument end |
Instance Method Details
#as_method ⇒ Object
77 78 79 |
# File 'lib/atomy/method.rb', line 77 def as_method Rubinius::BlockEnvironment::AsMethod.new(@body) end |
#default_arguments_count ⇒ Object
56 57 58 |
# File 'lib/atomy/method.rb', line 56 def default_arguments_count @default_arguments.size end |
#for_method! ⇒ Object
68 69 70 71 |
# File 'lib/atomy/method.rb', line 68 def for_method! @method = true self end |
#method? ⇒ Boolean
73 74 75 |
# File 'lib/atomy/method.rb', line 73 def method? @method end |
#post_arguments_count ⇒ Object
60 61 62 |
# File 'lib/atomy/method.rb', line 60 def post_arguments_count @post_arguments.size end |
#pre_arguments_count ⇒ Object
52 53 54 |
# File 'lib/atomy/method.rb', line 52 def pre_arguments_count @arguments.size end |
#splat_index ⇒ Object
64 65 66 |
# File 'lib/atomy/method.rb', line 64 def splat_index @arguments.size + @default_arguments.size if @splat_argument end |