Class: ActiveInteractor::Context::Input

Inherits:
Base
  • Object
show all
Defined in:
lib/active_interactor/context/input.rb

Constant Summary

Constants included from Type::DeclerationMethods

Type::DeclerationMethods::Boolean

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from ActiveInteractor::Context::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveInteractor::Context::Base

Class Method Details

.argument(*attribute_args) ⇒ Object



11
12
13
# File 'lib/active_interactor/context/input.rb', line 11

def self.argument(*attribute_args)
  attribute_set.add(*attribute_args)
end

.argument_namesObject



15
16
17
# File 'lib/active_interactor/context/input.rb', line 15

def self.argument_names
  attribute_set.attribute_names
end

.argumentsObject



19
20
21
# File 'lib/active_interactor/context/input.rb', line 19

def self.arguments
  attribute_set.attributes
end

Instance Method Details

#argumentsObject



23
24
25
26
27
# File 'lib/active_interactor/context/input.rb', line 23

def arguments
  attribute_set.attributes.each_with_object({}) do |attribute, result|
    result[attribute.name] = attribute.value
  end
end

#as_json(*args, &block) ⇒ Object



6
7
8
# File 'lib/active_interactor/context/input.rb', line 6

def as_json(*args, &block)
  arguments.as_json(*args, &block)
end

#to_h(*args, &block) ⇒ Object



7
8
9
# File 'lib/active_interactor/context/input.rb', line 7

def to_h(*args, &block)
  arguments.to_h(*args, &block)
end

#to_hash(*args, &block) ⇒ Object



8
9
10
# File 'lib/active_interactor/context/input.rb', line 8

def to_hash(*args, &block)
  arguments.to_hash(*args, &block)
end

#to_json(*args, &block) ⇒ Object



9
10
11
# File 'lib/active_interactor/context/input.rb', line 9

def to_json(*args, &block)
  arguments.to_json(*args, &block)
end