Class: RbsGoose::IO::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs_goose/io/example.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(typed_ruby:, refined_rbs:) ⇒ Example

Returns a new instance of Example.



15
16
17
18
# File 'lib/rbs_goose/io/example.rb', line 15

def initialize(typed_ruby:, refined_rbs:)
  @typed_ruby = typed_ruby
  @refined_rbs = refined_rbs
end

Instance Attribute Details

#refined_rbsObject (readonly)

Returns the value of attribute refined_rbs.



24
25
26
# File 'lib/rbs_goose/io/example.rb', line 24

def refined_rbs
  @refined_rbs
end

#typed_rubyObject (readonly)

Returns the value of attribute typed_ruby.



24
25
26
# File 'lib/rbs_goose/io/example.rb', line 24

def typed_ruby
  @typed_ruby
end

Class Method Details

.from_path(ruby_path:, rbs_path:, refined_rbs_dir:, base_path:) ⇒ Object



7
8
9
10
11
12
# File 'lib/rbs_goose/io/example.rb', line 7

def from_path(ruby_path:, rbs_path:, refined_rbs_dir:, base_path:)
  Example.new(
    typed_ruby: TypedRuby.from_path(ruby_path:, rbs_path:, base_path:),
    refined_rbs: File.new(path: rbs_path, base_path: ::File.join(base_path, refined_rbs_dir))
  )
end

Instance Method Details

#to_hObject



20
21
22
# File 'lib/rbs_goose/io/example.rb', line 20

def to_h
  { typed_ruby:, refined_rbs: }
end