Class: Motoko::Resolvers::Fact

Inherits:
BaseResolver show all
Defined in:
lib/motoko/resolvers/fact.rb

Instance Attribute Summary collapse

Attributes inherited from BaseResolver

#formatter, #human_name, #name

Instance Method Summary collapse

Methods inherited from BaseResolver

#align, #value

Methods included from Utils::SnakeToCamel

#snake_to_camel_case

Constructor Details

#initialize(name, options) ⇒ Fact

Returns a new instance of Fact.



8
9
10
11
12
# File 'lib/motoko/resolvers/fact.rb', line 8

def initialize(name, options)
  @fact = options.delete('fact') || name

  super
end

Instance Attribute Details

#factObject

Returns the value of attribute fact.



6
7
8
# File 'lib/motoko/resolvers/fact.rb', line 6

def fact
  @fact
end

Instance Method Details

#resolve_for(node) ⇒ Object



14
15
16
# File 'lib/motoko/resolvers/fact.rb', line 14

def resolve_for(node)
  node.fact(fact)
end