Class: Ecoportal::API::GraphQL::Fragment

Inherits:
Object
  • Object
show all
Defined in:
lib/ecoportal/api/graphql/fragment.rb,
lib/ecoportal/api/graphql/fragment/pagination.rb,
lib/ecoportal/api/graphql/fragment/contractor_entity.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Fragment

Returns a new instance of Fragment.



26
27
28
29
# File 'lib/ecoportal/api/graphql/fragment.rb', line 26

def initialize(client)
  @client = client
  parse
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



24
25
26
# File 'lib/ecoportal/api/graphql/fragment.rb', line 24

def client
  @client
end

#fragmentsObject (readonly)

Returns the value of attribute fragments.



24
25
26
# File 'lib/ecoportal/api/graphql/fragment.rb', line 24

def fragments
  @fragments
end

Class Method Details

.const?(value) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
# File 'lib/ecoportal/api/graphql/fragment.rb', line 6

def const?(value)
  begin
    const_get(value)
  rescue NameError => e
    return false
  end
  true
end

.fragment(sym, heredoc) ⇒ Object



15
16
17
# File 'lib/ecoportal/api/graphql/fragment.rb', line 15

def fragment(sym, heredoc)
  fragments[sym] = heredoc
end

.fragmentsObject



19
20
21
# File 'lib/ecoportal/api/graphql/fragment.rb', line 19

def fragments
  @fragments ||= {}
end